Documentation ¶
Index ¶
- Constants
- func AbortWithCodeErr(c echo.Context, code int, err error)
- func AcquireBuffer() *bytes.Buffer
- func AutoIncrID(id *int64)
- func Bind(c echo.Context, v interface{}, flag int) (err error)
- func BindEnv(c echo.Context, v interface{}) error
- func BindHeader(c echo.Context, v interface{}) error
- func BindParam(c echo.Context, v interface{}) error
- func CodeMsg(code int) string
- func CtxDebug(ec *Context, format string, args ...interface{})
- func CtxDebugKV(ec *Context, msg string, fields ...zap.Field)
- func CtxError(ec *Context, format string, args ...interface{})
- func CtxErrorKV(ec *Context, msg string, fields ...zap.Field)
- func CtxFatal(ec *Context, format string, args ...interface{})
- func CtxFatalKV(ec *Context, msg string, fields ...zap.Field)
- func CtxInfo(ec *Context, format string, args ...interface{})
- func CtxInfoKV(ec *Context, msg string, fields ...zap.Field)
- func CtxPanic(ec *Context, format string, args ...interface{})
- func CtxPanicKV(ec *Context, msg string, fields ...zap.Field)
- func CtxWarn(ec *Context, format string, args ...interface{})
- func CtxWarnKV(ec *Context, msg string, fields ...zap.Field)
- func Debug(format string, args ...interface{})
- func DebugKV(msg string, fields ...zap.Field)
- func EncodeJSON(v interface{}) (*bytes.Buffer, error)
- func EncodeValues(v interface{}) (url.Values, error)
- func EnvBool(c echo.Context, key string) (bool, error)
- func EnvInt64(c echo.Context, key string) (int64, error)
- func EnvString(c echo.Context, key string) (string, error)
- func EnvUint64(c echo.Context, key string) (uint64, error)
- func Error(format string, args ...interface{})
- func ErrorKV(msg string, fields ...zap.Field)
- func FasterJSONReflectedEncoder(w io.Writer) zapcore.ReflectedEncoder
- func Fatal(format string, args ...interface{})
- func FatalKV(msg string, fields ...zap.Field)
- func FinishWithCodeData(c echo.Context, code int, data interface{})
- func FlushLog() error
- func ForceRegisterBinder(flag int, fn func(echo.Context, interface{}) error)
- func ForceRegisterCode(code int, msg string, status int)
- func FormBindBody(c echo.Context, v interface{}) error
- func FormBindQuery(c echo.Context, v interface{}) error
- func FormBindQueryBody(c echo.Context, v interface{}) error
- func FormBool(c echo.Context, key string) (bool, error)
- func FormInt64(c echo.Context, key string) (int64, error)
- func FormString(c echo.Context, key string) (string, error)
- func FormUint64(c echo.Context, key string) (uint64, error)
- func GetHostname() (host string)
- func GetRequestHost(req *http.Request) (host string)
- func GetRequestID(c echo.Context) string
- func GetUUID(c echo.Context) (u string)
- func HTTPStatus(code int) int
- func HeaderBool(c echo.Context, key string) (bool, error)
- func HeaderInt64(c echo.Context, key string) (int64, error)
- func HeaderString(c echo.Context, key string) (string, error)
- func HeaderUint64(c echo.Context, key string) (uint64, error)
- func Info(format string, args ...interface{})
- func InfoKV(msg string, fields ...zap.Field)
- func IsEchotoolError(err error) bool
- func IsEmptyError(err error) bool
- func JSONBindBody(c echo.Context, v interface{}) error
- func MsgpackBindBody(c echo.Context, v interface{}) error
- func MustBind(c echo.Context, v interface{}, flag int, cbs ...CallbackFunc)
- func MustBindEnv(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustBindHeader(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustBindParam(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustDo(run RunFunc, codes ...int) interface{}
- func MustDoCallback(run RunFunc, code int, cbs ...CallbackFunc) interface{}
- func MustEncodeJSON(v interface{}, cbs ...CallbackFunc) *bytes.Buffer
- func MustEncodeValues(v interface{}, cbs ...CallbackFunc) url.Values
- func MustEnvBool(c echo.Context, key string, cbs ...CallbackFunc) bool
- func MustEnvInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
- func MustEnvString(c echo.Context, key string, cbs ...CallbackFunc) string
- func MustEnvUint64(c echo.Context, key string, cbs ...CallbackFunc) uint64
- func MustFormBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustFormBindQuery(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustFormBindQueryBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustFormBool(c echo.Context, key string, cbs ...CallbackFunc) bool
- func MustFormInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
- func MustFormString(c echo.Context, key string, cbs ...CallbackFunc) string
- func MustFormUint64(c echo.Context, key string, cbs ...CallbackFunc) uint64
- func MustHeaderBool(c echo.Context, key string, cbs ...CallbackFunc) bool
- func MustHeaderInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
- func MustHeaderString(c echo.Context, key string, cbs ...CallbackFunc) string
- func MustHeaderUInt64(c echo.Context, key string, cbs ...CallbackFunc) uint64
- func MustJSONBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustMsgpackBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustParamBool(c echo.Context, key string, cbs ...CallbackFunc) bool
- func MustParamInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
- func MustParamString(c echo.Context, key string, cbs ...CallbackFunc) string
- func MustParamUInt64(c echo.Context, key string, cbs ...CallbackFunc) uint64
- func MustPostFormBool(c echo.Context, key string, cbs ...CallbackFunc) bool
- func MustPostFormInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
- func MustPostFormString(c echo.Context, key string, cbs ...CallbackFunc) string
- func MustPostFormUInt64(c echo.Context, key string, cbs ...CallbackFunc) uint64
- func MustProtobufBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustQueryBool(c echo.Context, key string, cbs ...CallbackFunc) bool
- func MustQueryInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
- func MustQueryString(c echo.Context, key string, cbs ...CallbackFunc) string
- func MustQueryUInt64(c echo.Context, key string, cbs ...CallbackFunc) uint64
- func MustValidate(v interface{}, cbs ...CallbackFunc)
- func MustXMLBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func MustYAMLBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
- func New(c echo.Context, v interface{}) *proxy
- func NewDefaultEcho() *echo.Echo
- func NewDefaultEncodeConfig() zapcore.EncoderConfig
- func NewDefaultGORMConfig(isCached bool) *gorm.Config
- func NewDefaultLogger() *zap.SugaredLogger
- func NewRotateLogger(opts ...RotateConfigOption) (*zap.SugaredLogger, error)
- func Panic(format string, args ...interface{})
- func PanicKV(msg string, fields ...zap.Field)
- func ParamBool(c echo.Context, key string) (bool, error)
- func ParamInt64(c echo.Context, key string) (int64, error)
- func ParamString(c echo.Context, key string) (string, error)
- func ParamUint64(c echo.Context, key string) (uint64, error)
- func PostFormBool(c echo.Context, key string) (bool, error)
- func PostFormInt64(c echo.Context, key string) (int64, error)
- func PostFormString(c echo.Context, key string) (string, error)
- func PostFormUint64(c echo.Context, key string) (uint64, error)
- func ProtobufBindBody(c echo.Context, v interface{}) error
- func QueryBool(c echo.Context, key string) (bool, error)
- func QueryInt64(c echo.Context, key string) (int64, error)
- func QueryString(c echo.Context, key string) (string, error)
- func QueryUint64(c echo.Context, key string) (uint64, error)
- func RegisterBinder(flag int, fn func(echo.Context, interface{}) error) bool
- func RegisterCode(code int, msg string, status int) bool
- func ReleaseBuffer(buffer *bytes.Buffer)
- func ReleaseEchotoolError(e *EchotoolError)
- func SetLogger(l *zap.SugaredLogger)
- func SetRequestID(f func(c echo.Context) string) echo.MiddlewareFunc
- func Validate(v interface{}) error
- func Warn(format string, args ...interface{})
- func WarnKV(msg string, fields ...zap.Field)
- func XMLBindBody(c echo.Context, v interface{}) error
- func YAMLBindBody(c echo.Context, v interface{}) error
- type CallbackFunc
- type CommonResponse
- type Context
- func (ec *Context) Abort(code int, err error)
- func (ec *Context) Deadline() (deadline time.Time, ok bool)
- func (ec *Context) Done() <-chan struct{}
- func (ec *Context) Err() error
- func (ec *Context) Finish(code int, data interface{})
- func (ec *Context) GetCode() int
- func (ec *Context) GetCustomValue(key string) (value string, exists bool)
- func (ec *Context) GetCustomValues() map[string]string
- func (ec *Context) GetData() interface{}
- func (ec *Context) GetError() error
- func (ec *Context) GetNamedValue() string
- func (ec *Context) IsOK() bool
- func (ec *Context) SetCustomValue(key, value string)
- func (ec *Context) SetNamedValue(value string)
- func (ec *Context) String() string
- func (ec *Context) Value(key interface{}) interface{}
- type EchotoolError
- type EmptyError
- func NewEmptyError(kind Kind, key string) *EmptyError
- func NewEnvEmptyError(key string) *EmptyError
- func NewFormEmptyError(key string) *EmptyError
- func NewHeaderEmptyError(key string) *EmptyError
- func NewParamEmptyError(key string) *EmptyError
- func NewPostFormEmptyError(key string) *EmptyError
- func NewQueryEmptyError(key string) *EmptyError
- type Engine
- type GORMLogger
- func (l *GORMLogger) Error(ctx context.Context, format string, args ...interface{})
- func (l *GORMLogger) Info(ctx context.Context, format string, args ...interface{})
- func (l *GORMLogger) LogMode(level gl.LogLevel) gl.Interface
- func (l *GORMLogger) Trace(ctx context.Context, begin time.Time, f func() (string, int64), err error)
- func (l *GORMLogger) Warn(ctx context.Context, format string, args ...interface{})
- type HandlerFunc
- type HandlerFuncsChain
- type Kind
- type Option
- type RotateConfig
- type RotateConfigOption
- func WithEncoderConfig(cfg zapcore.EncoderConfig) RotateConfigOption
- func WithLevel(level zapcore.Level) RotateConfigOption
- func WithPaths(paths []string) RotateConfigOption
- func WithRotateTime(t time.Duration) RotateConfigOption
- func WithSuffix(suffix string) RotateConfigOption
- func WithTTL(ttl time.Duration) RotateConfigOption
- type RunFunc
Constants ¶
const ( BValidator = 1 << iota BHeader BParam BFormQuery BFormBody BFormQueryBody BJSONBody BXMLBody BProtobufBody BMsgpackBody BYAMLBody BEnv )
const ( CodeOKZero = 0 CodeOK = 20000 CodeCreated = 20100 CodePartialContent = 20600 CodeMultipleChoices = 30000 CodeMovedPermanently = 30100 CodeFound = 30200 CodeSeeOther = 30300 CodeNotModified = 30400 CodeUseProxy = 30500 CodeTemporaryRedirect = 30700 CodePermanentRedirect = 30800 CodeBadRequest = 40000 CodeForbidden = 40300 CodeNotFound = 40400 CodeTooManyRequests = 42900 CodeValidateErr = 45000 CodeInternalErr = 50000 CodeParseDataErr = 50013 CodeMySQLErr = 50014 CodePostgreSQLErr = 50015 CodeRedisErr = 50016 CodeClickHouseErr = 50017 CodeNSQErr = 50030 CodeKafkaErr = 50031 CodeRocketMQErr = 50032 CodeBindErr = 50040 CodeEncodeErr = 50041 CodeDownstreamErr = 50099 )
const (
KeyRequestID = "x-request-id"
)
const (
UnknownStatus = 999
)
Variables ¶
This section is empty.
Functions ¶
func AcquireBuffer ¶
func AutoIncrID ¶ added in v1.0.7
func AutoIncrID(id *int64)
func BindHeader ¶
BindHeader needs tag "header" in fields of v. The value of tag "header" is automatically converted to the canonical format.
func CtxFatalKV ¶ added in v1.0.3
CtxFatalKV logs a message, then calls os.Exit.
func CtxPanicKV ¶ added in v1.0.3
CtxPanicKV logs a message, then panics.
func EncodeJSON ¶
EncodeJSON needs tag "json" in fields of v. Note: ReleaseBuffer needs to be called after EncodeJSON is called successfully.
func EncodeValues ¶
EncodeValues needs tag "url" in fields of v.
func FasterJSONReflectedEncoder ¶ added in v1.0.3
func FasterJSONReflectedEncoder(w io.Writer) zapcore.ReflectedEncoder
func Fatal ¶ added in v1.0.2
func Fatal(format string, args ...interface{})
Fatal logs a message, then calls os.Exit.
func FinishWithCodeData ¶
func ForceRegisterBinder ¶ added in v1.0.13
func ForceRegisterCode ¶
ForceRegisterCode will force to cover codeMsg map and httpStatus map.
func FormBindBody ¶
FormBindBody needs tag "form" in fields of v.
func FormBindQuery ¶
FormBindQuery needs tag "form" in fields of v.
func FormBindQueryBody ¶
FormBindQueryBody needs tag "form" in fields of v.
func GetHostname ¶ added in v1.0.1
func GetHostname() (host string)
func GetRequestHost ¶
func GetRequestID ¶
func HTTPStatus ¶
func IsEchotoolError ¶
func IsEmptyError ¶
func JSONBindBody ¶
JSONBindBody needs tag "json" in fields of v.
func MsgpackBindBody ¶
MsgpackBindBody needs tag "msgpack" in fields of v.
func MustBindEnv ¶ added in v1.0.8
func MustBindEnv(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustBindHeader ¶
func MustBindHeader(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustBindParam ¶
func MustBindParam(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustDoCallback ¶
func MustDoCallback(run RunFunc, code int, cbs ...CallbackFunc) interface{}
MustDoCallback will call cbs if and only if run has error.
func MustEncodeJSON ¶
func MustEncodeJSON(v interface{}, cbs ...CallbackFunc) *bytes.Buffer
MustEncodeJSON needs tag "json" in fields of v. Note: ReleaseBuffer needs to be called after MustEncodeJSON is called successfully.
func MustEncodeValues ¶
func MustEncodeValues(v interface{}, cbs ...CallbackFunc) url.Values
func MustEnvBool ¶ added in v1.0.8
func MustEnvBool(c echo.Context, key string, cbs ...CallbackFunc) bool
func MustEnvInt64 ¶ added in v1.0.8
func MustEnvInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
func MustEnvString ¶ added in v1.0.8
func MustEnvString(c echo.Context, key string, cbs ...CallbackFunc) string
func MustEnvUint64 ¶ added in v1.0.8
func MustEnvUint64(c echo.Context, key string, cbs ...CallbackFunc) uint64
func MustFormBindBody ¶
func MustFormBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustFormBindQuery ¶
func MustFormBindQuery(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustFormBindQueryBody ¶
func MustFormBindQueryBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustFormBool ¶
func MustFormBool(c echo.Context, key string, cbs ...CallbackFunc) bool
func MustFormInt64 ¶
func MustFormInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
func MustFormString ¶
func MustFormString(c echo.Context, key string, cbs ...CallbackFunc) string
func MustFormUint64 ¶
func MustFormUint64(c echo.Context, key string, cbs ...CallbackFunc) uint64
func MustHeaderBool ¶
func MustHeaderBool(c echo.Context, key string, cbs ...CallbackFunc) bool
func MustHeaderInt64 ¶
func MustHeaderInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
func MustHeaderString ¶
func MustHeaderString(c echo.Context, key string, cbs ...CallbackFunc) string
func MustHeaderUInt64 ¶
func MustHeaderUInt64(c echo.Context, key string, cbs ...CallbackFunc) uint64
func MustJSONBindBody ¶
func MustJSONBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustMsgpackBindBody ¶
func MustMsgpackBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustParamBool ¶
func MustParamBool(c echo.Context, key string, cbs ...CallbackFunc) bool
func MustParamInt64 ¶
func MustParamInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
func MustParamString ¶
func MustParamString(c echo.Context, key string, cbs ...CallbackFunc) string
func MustParamUInt64 ¶
func MustParamUInt64(c echo.Context, key string, cbs ...CallbackFunc) uint64
func MustPostFormBool ¶
func MustPostFormBool(c echo.Context, key string, cbs ...CallbackFunc) bool
func MustPostFormInt64 ¶
func MustPostFormInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
func MustPostFormString ¶
func MustPostFormString(c echo.Context, key string, cbs ...CallbackFunc) string
func MustPostFormUInt64 ¶
func MustPostFormUInt64(c echo.Context, key string, cbs ...CallbackFunc) uint64
func MustProtobufBindBody ¶
func MustProtobufBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustQueryBool ¶
func MustQueryBool(c echo.Context, key string, cbs ...CallbackFunc) bool
func MustQueryInt64 ¶
func MustQueryInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
func MustQueryString ¶
func MustQueryString(c echo.Context, key string, cbs ...CallbackFunc) string
func MustQueryUInt64 ¶
func MustQueryUInt64(c echo.Context, key string, cbs ...CallbackFunc) uint64
func MustValidate ¶
func MustValidate(v interface{}, cbs ...CallbackFunc)
func MustXMLBindBody ¶
func MustXMLBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
func MustYAMLBindBody ¶
func MustYAMLBindBody(c echo.Context, v interface{}, cbs ...CallbackFunc)
func NewDefaultEcho ¶ added in v1.0.3
func NewDefaultEncodeConfig ¶ added in v1.0.4
func NewDefaultEncodeConfig() zapcore.EncoderConfig
func NewDefaultGORMConfig ¶ added in v1.0.7
NewDefaultGORMConfig returns a default config with logger. Note that you should set PrepareStmt to false when using clickhouse.
func NewDefaultLogger ¶ added in v1.0.1
func NewDefaultLogger() *zap.SugaredLogger
func NewRotateLogger ¶ added in v1.0.4
func NewRotateLogger(opts ...RotateConfigOption) (*zap.SugaredLogger, error)
func Panic ¶ added in v1.0.2
func Panic(format string, args ...interface{})
Panic logs a message, then panics.
func ProtobufBindBody ¶
ProtobufBindBody needs tag "protobuf" in fields of v.
func RegisterBinder ¶ added in v1.0.13
func RegisterCode ¶
RegisterCode will not cover code and status which exists.
func ReleaseBuffer ¶
func ReleaseEchotoolError ¶
func ReleaseEchotoolError(e *EchotoolError)
func SetLogger ¶ added in v1.0.1
func SetLogger(l *zap.SugaredLogger)
func SetRequestID ¶
func SetRequestID(f func(c echo.Context) string) echo.MiddlewareFunc
func XMLBindBody ¶
XMLBindBody needs tag "xml" in fields of v.
func YAMLBindBody ¶
YAMLBindBody needs tag "yaml" in fields of v.
Types ¶
type CallbackFunc ¶
type CallbackFunc func(error)
type CommonResponse ¶
type CommonResponse struct { RequestID string `json:"request_id,omitempty"` Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data,omitempty"` }
func RespOK ¶
func RespOK(id string, code int, data interface{}) *CommonResponse
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) GetCustomValue ¶ added in v1.0.1
func (*Context) GetCustomValues ¶ added in v1.0.1
func (*Context) GetNamedValue ¶ added in v1.0.1
func (*Context) SetCustomValue ¶ added in v1.0.1
func (*Context) SetNamedValue ¶ added in v1.0.1
type EchotoolError ¶
type EchotoolError struct {
// contains filtered or unexported fields
}
func AcquireEchotoolError ¶
func AcquireEchotoolError(code int, err error) (e *EchotoolError)
func (EchotoolError) Error ¶
func (e EchotoolError) Error() string
func (EchotoolError) GetCode ¶
func (e EchotoolError) GetCode() int
func (EchotoolError) GetError ¶
func (e EchotoolError) GetError() error
type EmptyError ¶
type EmptyError struct {
// contains filtered or unexported fields
}
func NewEmptyError ¶
func NewEmptyError(kind Kind, key string) *EmptyError
func NewEnvEmptyError ¶ added in v1.0.8
func NewEnvEmptyError(key string) *EmptyError
func NewFormEmptyError ¶
func NewFormEmptyError(key string) *EmptyError
func NewHeaderEmptyError ¶
func NewHeaderEmptyError(key string) *EmptyError
func NewParamEmptyError ¶
func NewParamEmptyError(key string) *EmptyError
func NewPostFormEmptyError ¶
func NewPostFormEmptyError(key string) *EmptyError
func NewQueryEmptyError ¶
func NewQueryEmptyError(key string) *EmptyError
func (EmptyError) Error ¶
func (e EmptyError) Error() string
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func NewDefaultEngine ¶ added in v1.0.3
func (*Engine) EchoHandler ¶
func (e *Engine) EchoHandler(handlers ...HandlerFunc) echo.HandlerFunc
func (*Engine) Use ¶
func (e *Engine) Use(middlewares ...HandlerFunc) *Engine
type GORMLogger ¶ added in v1.0.6
func NewDefaultGORMLogger ¶ added in v1.0.6
func NewDefaultGORMLogger() *GORMLogger
func (*GORMLogger) Error ¶ added in v1.0.6
func (l *GORMLogger) Error(ctx context.Context, format string, args ...interface{})
func (*GORMLogger) Info ¶ added in v1.0.6
func (l *GORMLogger) Info(ctx context.Context, format string, args ...interface{})
func (*GORMLogger) LogMode ¶ added in v1.0.6
func (l *GORMLogger) LogMode(level gl.LogLevel) gl.Interface
type HandlerFunc ¶
func AddNotice ¶ added in v1.0.1
func AddNotice(key, value string) HandlerFunc
AddNotice adds kv pair to log for troubleshooting problems and so on.
func AddTraceID ¶ added in v1.0.1
func AddTraceID(f func(c echo.Context) string) HandlerFunc
AddTraceID adds trace id to log for troubleshooting problems and so on.
func GetCommonAborter ¶
func GetCommonAborter() HandlerFunc
func GetCommonFinisher ¶
func GetCommonFinisher() HandlerFunc
func PrintRequest ¶ added in v1.0.5
func PrintRequest() HandlerFunc
type HandlerFuncsChain ¶
type HandlerFuncsChain []HandlerFunc
type Option ¶
type Option func(*Engine)
func WithAborter ¶
func WithAborter(aborter HandlerFunc) Option
func WithFinisher ¶
func WithFinisher(finisher HandlerFunc) Option
type RotateConfig ¶ added in v1.0.4
type RotateConfig struct { EncoderConfig zapcore.EncoderConfig Paths []string Suffix string Level zapcore.Level RotateTime time.Duration TTL time.Duration }
RotateConfig is the config for rotating logs. The format of suffix refers to https://github.com/lestrrat-go/strftime.
type RotateConfigOption ¶ added in v1.0.4
type RotateConfigOption func(*RotateConfig)
func WithEncoderConfig ¶ added in v1.0.4
func WithEncoderConfig(cfg zapcore.EncoderConfig) RotateConfigOption
func WithLevel ¶ added in v1.0.4
func WithLevel(level zapcore.Level) RotateConfigOption
func WithPaths ¶ added in v1.0.4
func WithPaths(paths []string) RotateConfigOption
func WithRotateTime ¶ added in v1.0.4
func WithRotateTime(t time.Duration) RotateConfigOption
func WithSuffix ¶ added in v1.0.4
func WithSuffix(suffix string) RotateConfigOption
func WithTTL ¶ added in v1.0.4
func WithTTL(ttl time.Duration) RotateConfigOption