Documentation ¶
Index ¶
- func CalculateMAC(message, key []byte) []byte
- func DeepCopyMapParam(param map[string]interface{}) map[string]interface{}
- func DeepCopyParam(param interface{}) interface{}
- func GetBoolParam(param map[string]interface{}, name string) (bool, error)
- func GetIntParam(param map[string]interface{}, name string) (int, error)
- func GetMapParam(param map[string]interface{}, name string) (map[string]interface{}, error)
- func GetNestedMapValue(param map[string]interface{}, nestedKey string) (interface{}, error)
- func GetStringParam(param map[string]interface{}, name string) (string, error)
- func GetStringSliceParam(param map[string]interface{}, name string) ([]string, error)
- func GogsParam(param map[string]interface{}) map[string]interface{}
- func InterfaceMapToStringMap(param interface{}) interface{}
- func JSONToMap(text []byte) (map[string]interface{}, error)
- func MergeMapParam(mapOrigin, mapNew map[string]interface{})
- func ValidateMAC(message, messageMAC, key []byte) bool
- type BaseLogger
- type HTTPServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeepCopyMapParam ¶
DeepCopyMapParam returns a deep copied map param object
func DeepCopyParam ¶
func DeepCopyParam(param interface{}) interface{}
DeepCopyParam returns a deep copied json param object
func GetBoolParam ¶
GetBoolParam get the bool param from the map
func GetIntParam ¶
GetIntParam get the int param from the map
func GetMapParam ¶
GetMapParam get the map param from the map
func GetNestedMapValue ¶
GetNestedMapValue get the value of a nested key from the map map["a/b/c"] = map["a"]["b"]["c"]
func GetStringParam ¶
GetStringParam get the string param from the map
func GetStringSliceParam ¶
GetStringSliceParam get the string slice param from the map (string or slice of strings)
func InterfaceMapToStringMap ¶
func InterfaceMapToStringMap(param interface{}) interface{}
InterfaceMapToStringMap will only keep map with string keys
func MergeMapParam ¶
func MergeMapParam(mapOrigin, mapNew map[string]interface{})
MergeMapParam merges the two maps
func ValidateMAC ¶
ValidateMAC checks the validation of message based on the key
Types ¶
type BaseLogger ¶
type BaseLogger struct {
// contains filtered or unexported fields
}
BaseLogger is a basic struct implement LoggerSetter
func (*BaseLogger) Debugf ¶
func (l *BaseLogger) Debugf(f string, v ...interface{})
Debugf log debug output
func (*BaseLogger) Errorf ¶
func (l *BaseLogger) Errorf(f string, v ...interface{})
Errorf log error output
func (*BaseLogger) Infof ¶
func (l *BaseLogger) Infof(f string, v ...interface{})
Infof log info output
func (*BaseLogger) SetLogger ¶
func (l *BaseLogger) SetLogger(logger interface{})
SetLogger will set logger
func (*BaseLogger) Warnf ¶
func (l *BaseLogger) Warnf(f string, v ...interface{})
Warnf log warn output
type HTTPServer ¶
type HTTPServer struct { BaseLogger UnixSocket string Host string Port int ServerHeader string ValidateFunc func(*http.Request, []byte) error ProcessFunc func(http.ResponseWriter, *http.Request, []byte) // contains filtered or unexported fields }
HTTPServer is a trigger which will listen to http request