Skip to content

MrAndreID/gopackage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MrAndreID / Go Package

Go Reference License: MIT

The MrAndreID/GoPackage is a collection of functions for package in Go Language.

Table of Contents

Installation

To use The MrAndreID/GoPackage, you must follow the steps below:

  • Get Dependancies
go get -u github.com/MrAndreID/gopackage

Usage

To use The MrAndreID/GoPackage, you must ensure that you meet the following requirements:

Custom Validator

import (
    "github.com/MrAndreID/gopackage"
	"github.com/labstack/echo/v4"
)

e := echo.New()
e.Validator = gopackage.CustomValidator()

Custom HTTP Error for Echo Framework

import (
    "github.com/MrAndreID/gopackage"
	"github.com/labstack/echo/v4"
)

e := echo.New()
e.HTTPErrorHandler = gopackage.EchoCustomHTTPErrorHandler

Custom JSON

import (
    "github.com/MrAndreID/gopackage"
	"github.com/labstack/echo/v4"
)

e := echo.New()
e.JSONSerializer = gopackage.CustomJSON()

GoRM Data Table

import (
    "github.com/MrAndreID/gopackage"
)

gopackage.DataTable(
    ctx,
    queryBuilder,
    []string{"name", "level"},
    "name",
    "asc",
    "id",
    "desc",
    page,
    &limit,
    request.Search,
    false,
)

Binding Request for Echo Framework

import (
    "github.com/MrAndreID/gopackage"
)

if err := gopackage.EchoBindRequest(c, &req); err != nil {
    return err
}

SeaweedFS Client

import (
    "github.com/MrAndreID/gopackage"
)

seaweedFSData, err := gopackage.NewSeaweedFS("127.0.0.1", "9333", false)

if err != nil {
    return err
}

publicURL, err := seaweedFSData.Upload(base64File)

if err != nil {
    return err
}

base64File, err := seaweedFSData.Download(publicURL)

if err != nil {
    return err
}

err := seaweedFSData.Delete(publicURL)

if err != nil {
    return err
}

Versioning

I use Semantic Versioning. For the versions available, see the tags on this repository.

Authors

Andrea Adam - MrAndreID

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

Official Documentation for Go Language

Documentation for Go Language can be found on the Go Package website.

License

The MrAndreID/GoPackage is released under the MIT License. See the LICENSE file for more information.

More

Documentation can be found on https://go.dev/.