Documentation ¶
Index ¶
- func AddLog(l1 log.Logger, l2 ...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(t log.LogType, lvl log.LogLevel, json, color bool) (err error)
- func Log(field map[string]interface{})
- 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 Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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.