menshend

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BadGateway = merry.New("Bad Gateway").WithHTTPCode(http.StatusBadGateway).WithUserMessage("Bad Gateway")
View Source
var BadRequest = merry.New("Bad request").WithHTTPCode(400).WithUserMessage("Bad request")
View Source
var InternalError = merry.New("Internal Error").WithHTTPCode(500).WithUserMessage("Internal Error")

BadRequest ...

View Source
var NotAuthorized = merry.New("Not Authorized").WithHTTPCode(401).WithUserMessage("Not Authorized")
View Source
var NotFound = merry.New("Resource not found").WithHTTPCode(404).WithUserMessage("Resource not found")
View Source
var PermissionError = merry.New("Permission Error").WithHTTPCode(403).WithUserMessage("Permission Error")

PermissionError this mean that the acl token has not access to x key on consul

Functions

func CheckPanic

func CheckPanic(e error)

CheckPanic if error exist exit and log the file and line from where the errors comes

func GenerateRandomBytes

func GenerateRandomBytes(n int) []byte

GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GenerateRandomString

func GenerateRandomString(s int) string

GenerateRandomString returns a URL-safe, base64 encoded securely generated random string. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.

func GetNow

func GetNow() int64

func HttpCheckPanic

func HttpCheckPanic(err error, userError merry.Error)

func SliceStringContains

func SliceStringContains(s []string, e string) bool

func StringPtr

func StringPtr(s string) *string

Types

type ContextKey

type ContextKey int

RequestType ..

const (
	//IsBrowserRequest ...
	IsBrowserRequest ContextKey = iota
	Subdomain
	Role
	Service
	TokenInfo
	VaultToken
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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