Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/softyesti/softutils_golang
https://github.com/softyesti/softutils_golang
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/softyesti/softutils_golang
- Owner: softyesti
- Created: 2023-12-05T20:09:59.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-10T17:40:07.000Z (9 months ago)
- Last Synced: 2024-04-10T21:28:15.470Z (9 months ago)
- Language: Go
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SoftUtils Golang
A set of tools for your golang applications.
A package for pdf file creation by html template file.
**How to use:**
```go
package mainimport "github.com/softyesti/softutils_golang/pkg/pdf"
func main() {
pdfi := &pdf.Pdf{
TemplatePath: "path"
TemplateData: interface{}
}bytes, err := pdfi.Generate()
if err != nil {
panic(err)
}
}
```## Soffice
A package that provides a bridge between golang and the libre office command line tool. This package focuses on file conversions.
**How to use:**
```go
package mainimport "github.com/softyesti/softutils_golang/pkg/soffice"
func main() {
office := &soffice.Soffice{
Path: "path" // optional custom libre office installation path
}bytes, err := office.ToPdf("file_path")
if err != nil {
panic(err)
}
}```
## MimeType
A package that provides mimetype utils like enum, find and compare functions.
**How to use:**
```go
package mainimport "github.com/softyesti/softutils_golang/pkg/mimetype"
func main() {
helper:= &mimetype.MimeType{}mimeTypeName, err := helper.GetMimeType(mimetype.PDFMimeType)
if err != nil {
panic(err)
}mimeTypeEnum, mimeTypeName := helper.GetMimeTypeByExtension("pdf")
isDocx, err := helper.CompareMimeType("application/msword", helper.DOCMimeType)
if err != nil {
panic(err)
}
}```