Documentation
¶
Index ¶
- func Base64UrlDecode(data string) ([]byte, error)
- func Base64UrlEncode(data string) string
- func CheckEnvVariables(variables []string)
- func CheckOrganize(data string) (string, bool)
- func IsWebSocket(r *http.Request) bool
- func LoadEnv()
- func OutputMessage(w interface{}, mode MessageOutputMode, statusCode int, format string, ...)
- type MessageOutputMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64UrlDecode ¶
Base64UrlDecode encodes a byte slice to a base64 string
func Base64UrlEncode ¶
func CheckEnvVariables ¶
func CheckEnvVariables(variables []string)
Check if the required environment variables exist
func CheckOrganize ¶
Get the parameters separate by '::'
func IsWebSocket ¶ added in v1.2.1
Check if the request is WebSocket
func OutputMessage ¶
func OutputMessage(w interface{}, mode MessageOutputMode, statusCode int, format string, a ...interface{})
OutputMessage provides message output, output to HTTP or log according to mode
Types ¶
type MessageOutputMode ¶
type MessageOutputMode int
const ( // HTTPResponse means the message will be output as HTTP response HTTPResponse MessageOutputMode = iota // WebSocketResponse means the message will be output as WebSocket response WebSocketResponse // LogOutput means the message will be logged LogOutput // FatalOutput means the message will be logged and the program will be terminated FatalOutput )
Click to show internal directories.
Click to hide internal directories.