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 ¶
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 ¶
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 HttpCheckPanic ¶
func SliceStringContains ¶
Types ¶
type ContextKey ¶
type ContextKey int
RequestType ..
const ( //IsBrowserRequest ... IsBrowserRequest ContextKey = iota Subdomain Role Service TokenInfo VaultToken )
Click to show internal directories.
Click to hide internal directories.