utils

package
v0.0.0-...-1dfef78 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var JWTSecret = []byte("chester")

Functions

func Bind

func Bind(src, dest interface{})

func GenerateID

func GenerateID(prefix string) string

func GenerateJWT

func GenerateJWT(u models.User) (string, error)

func Pretty

func Pretty(i interface{}) string

Types

type Error

type Error struct {
	Errors map[string]interface{} `json:"errors"`
}

func AccessForbidden

func AccessForbidden() Error

func NewEntityCastError

func NewEntityCastError(err error) Error

func NewError

func NewError(err error) Error

func NotFound

func NotFound() Error

type GSPClaim

type GSPClaim struct {
	User    models.User `json:"user"`
	IsAdmin bool        `json:"is_admin"`
	jwt.StandardClaims
}

func (*GSPClaim) Bind

func (c *GSPClaim) Bind(m jwt.Claims)

type SimpleReq

type SimpleReq struct {
	Message string `json:"message"`
}

func NewSimpleReq

func NewSimpleReq(message string) *SimpleReq

Jump to

Keyboard shortcuts

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