Documentation ¶
Index ¶
- func AddPrefix(origin string, prefixs []string) string
- func Get(url string) (resp []byte, err error)
- func GetCallerInfo(skip int) string
- func IsAllBlank(args ...interface{}) bool
- func IsAnyBlank(args ...interface{}) bool
- func MarshalSorted(v interface{}) ([]byte, error)
- func MarshalSortedFast(v interface{}) ([]byte, error)
- func Post(url string, body []byte, header map[string]string) (resp []byte, err error)
- func ToCamelCase(field string) string
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddPrefix ¶
AddPrefix add prefix to origin string, use delimiter :
func MarshalSorted ¶
MarshalSorted 自定义Marshal函数,用于生成按键排序的JSON字符串,只适用于结构体,基本数据类型或切片不行 @Description: json.Marshal加密map时会进行排序,因此只需将结构体转换成map即可,此方法使用先序列化为JSON,再解析JSON到map @param v @return []byte @return error
func MarshalSortedFast ¶
MarshalSortedFast 自定义Marshal函数,用于生成按键排序的JSON字符串,只适用于结构体,基本数据类型或切片不行 @Description: 此方法使用了反射转换到map,性能更快,但是对JSON tag支持不够完善 @param v @return []byte @return error
func Post ¶
Post 发送一个 POST json 请求到指定的 URL,使用提供的 body,并返回响应体
Types ¶
type Logger ¶
type Logger interface { Debugf(format string, args ...interface{}) Infof(format string, args ...interface{}) Warnf(format string, args ...interface{}) Errorf(format string, args ...interface{}) Debug(args ...interface{}) Info(args ...interface{}) Warn(args ...interface{}) Error(args ...interface{}) }
Logger define log interface
Click to show internal directories.
Click to hide internal directories.