Documentation ¶
Index ¶
- func AddLog(l1 _log.Logger)
- func Error(str string, args ...interface{})
- func Fatal(str string, args ...interface{})
- func GetKey(params ...interface{}) string
- func GetLogger(i ...int) _log.Logger
- func Info(str string, args ...interface{})
- func InitLog(lvl LogLevel, json, color bool)
- func Log(field map[string]interface{})
- func ParseToBoolPtr(str string) *bool
- func ParseToTimePtr(layout, str string) *time.Time
- func Recoverer(next http.Handler) http.Handler
- func RecovererGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (_ interface{}, err error)
- func ResponseWithGRPC(code int, err error) error
- func ResponseWithJSON(w http.ResponseWriter, code int, data interface{}, err error, ...)
- func SplitDate(date string) (year int, month int, day int, err error)
- func Validate(data interface{}) error
- type LogLevel
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseToBoolPtr ¶ added in v0.9.0
ParseToBoolPtr to parse str to bool pointer.
func ParseToTimePtr ¶ added in v0.9.0
ParseToTimePtr to parse str to time pointer.
func RecovererGRPC ¶
func RecovererGRPC(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (_ interface{}, err error)
RecovererGRPC is custom recoverer middleware.
func ResponseWithGRPC ¶
ResponseWithGRPC to convert http response code and error message to grpc error format.
func ResponseWithJSON ¶
func ResponseWithJSON(w http.ResponseWriter, code int, data interface{}, err error, meta ...interface{})
ResponseWithJSON to write response with JSON format.
Types ¶
Click to show internal directories.
Click to hide internal directories.