cocola

package module
v0.0.0-...-480e040 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 0 Imported by: 0

README

cocola

Error

Useage:
    import "github.com/maxjkfc/cocola/errors"


    func main()  {
        err  := errors.New(1 , "Error: Not Find it")
        fmt.Println(err.Error())
    }

Log

Use the go.uber.org/zap package

Useage:
    import "github.com/maxjkfc/cocola/log"

    func main(){
        log.NewZapConfig().Env(log.DEV).Level(log.DEBUG).Build()
        log.Log().Info("This is the zap log pkg" , nil)
    }

Token

Use the github.com/dgrijalva/jwt-go

Useage:
Create Token
    import "github.com/maxjkfc/cocola/token"
    import "fmt"


    func main(){
        token.SetKey("123")
        token.SetIssuer("xxx")
        j :=token.New()      
        j.Create(map[string]interface{}{
                    "name":"maxjkfc",
                    "phone":192939102,
                })
        fmt.Println(j.Get())
    }
Parse Token
    import "github.com/maxjkfc/cocola/token"
    import "fmt"


    func main(){
        token.SetKey("123")
        token.SetIssuer("xxx")
        j :=token.New()

        x := make(map[string]interface{})

        j.Parse(token , x)
        fmt.Println(x)
    }

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
db
protobuf
tools

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL