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 BindCookie(c echo.Context, v interface{}) 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 CookieBool(c echo.Context, key string) (bool, error)
- func CookieInt64(c echo.Context, key string) (int64, error)
- func CookieString(c echo.Context, key string) (string, error)
- func CookieUint64(c echo.Context, key string) (uint64, error)
- 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 CtxPrint(ec *Context, level zapcore.Level, format string, args ...interface{})
- func CtxPrintKV(ec *Context, level zapcore.Level, 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 DefaultCORS() echo.MiddlewareFunc
- func EncodeJSON(v interface{}) (*bytes.Buffer, error)
- func EncodeValues(v interface{}) (url.Values, error)
- func Env() (env string)
- 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 FormBindMultipart(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 GetConfDir() string
- func GetHandlerName(f HandlerFunc) string
- func GetHostname() (host string)
- func GetRequestHost(req *http.Request) (host string)
- func GetRequestID(c echo.Context) string
- func GetShortUUID(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 IsProduct() bool
- func IsTest() 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 MustBindCookie(c echo.Context, v interface{}, 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 MustCookieBool(c echo.Context, key string, cbs ...CallbackFunc) bool
- func MustCookieInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
- func MustCookieString(c echo.Context, key string, cbs ...CallbackFunc) string
- func MustCookieUint64(c echo.Context, key string, cbs ...CallbackFunc) uint64
- 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 MustFormBindMultipart(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 ParseByEnv(suffix string) string
- func ParseByReg(suffix string) string
- func ParseByTag(suffix string) string
- 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 Print(level zapcore.Level, format string, args ...interface{})
- func PrintKV(level zapcore.Level, msg string, fields ...zap.Field)
- 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 Reg() string
- 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 SetLoggerWithFinalizer(l *zap.SugaredLogger)
- func SetRequestID(f func(c echo.Context) string) echo.MiddlewareFunc
- func Tag() string
- func UnsafeCORS() 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) Clone() *Context
- 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) GetHandlerName() string
- func (ec *Context) GetNamedValue() string
- func (ec *Context) GetStartTime() time.Time
- func (ec *Context) IsOK() bool
- func (ec *Context) Redirect(code int, url string)
- 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 NewCookieEmptyError(key string) *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 FileInfo
- 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 RedisLogger
- 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 BFormMultipart BJSONBody BXMLBody BProtobufBody BMsgpackBody BYAMLBody BEnv BCookie )
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 CodeMongoDBErr = 50018 CodeElasticsearchErr = 50019 CodeNSQErr = 50030 CodeKafkaErr = 50031 CodeRocketMQErr = 50032 CodeBindErr = 50040 CodeEncodeErr = 50041 CodeDownstreamErr = 50099 )
const ( EnvDev = "dev" EnvTest = "test" EnvProduct = "prod" )
const (
KeyRequestID = "x-request-id"
)
const (
UnknownStatus = 999
)
Variables ¶
This section is empty.
Functions ¶
func AbortWithCodeErr ¶
func AcquireBuffer ¶
func AutoIncrID ¶ added in v1.0.7
func AutoIncrID(id *int64)
func BindCookie ¶ added in v1.0.42
func BindCookie(c echo.Context, v interface{}) error
BindCookie needs tag "cookie" in fields of v.
func BindEnv ¶ added in v1.0.8
func BindEnv(c echo.Context, v interface{}) error
BindEnv needs tag "env" in fields of v.
func BindHeader ¶
func BindHeader(c echo.Context, v interface{}) error
BindHeader needs tag "header" in fields of v. The value of tag "header" is automatically converted to the canonical format.
func BindParam ¶
func BindParam(c echo.Context, v interface{}) error
BindParam needs tag "param" in fields of v.
func CookieBool ¶ added in v1.0.42
func CookieInt64 ¶ added in v1.0.42
func CookieString ¶ added in v1.0.42
func CookieUint64 ¶ added in v1.0.42
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 CtxPrintKV ¶ added in v1.0.38
func DefaultCORS ¶ added in v1.0.32
func DefaultCORS() echo.MiddlewareFunc
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 FinishWithCodeData(c echo.Context, code int, data interface{})
func ForceRegisterBinder ¶ added in v1.0.13
func ForceRegisterCode ¶
ForceRegisterCode will force to cover codeMsg map and httpStatus map.
func FormBindBody ¶
func FormBindBody(c echo.Context, v interface{}) error
FormBindBody needs tag "form" in fields of v.
func FormBindMultipart ¶ added in v1.0.26
func FormBindMultipart(c echo.Context, v interface{}) error
FormBindMultipart needs tag "form" in fields of v.
func FormBindQuery ¶
func FormBindQuery(c echo.Context, v interface{}) error
FormBindQuery needs tag "form" in fields of v.
func FormBindQueryBody ¶
func FormBindQueryBody(c echo.Context, v interface{}) error
FormBindQueryBody needs tag "form" in fields of v.
func FormString ¶
func FormUint64 ¶
func GetConfDir ¶ added in v1.0.36
func GetConfDir() string
func GetHandlerName ¶ added in v1.0.17
func GetHandlerName(f HandlerFunc) string
func GetHostname ¶ added in v1.0.1
func GetHostname() (host string)
func GetRequestHost ¶
func GetRequestID ¶
func GetRequestID(c echo.Context) string
func GetShortUUID ¶ added in v1.0.43
func GetShortUUID(c echo.Context) string
func HTTPStatus ¶
func HeaderBool ¶
func HeaderInt64 ¶
func HeaderString ¶
func HeaderUint64 ¶
func IsEchotoolError ¶
func IsEmptyError ¶
func JSONBindBody ¶
func JSONBindBody(c echo.Context, v interface{}) error
JSONBindBody needs tag "json" in fields of v.
func MsgpackBindBody ¶
func MsgpackBindBody(c echo.Context, v interface{}) error
MsgpackBindBody needs tag "msgpack" in fields of v.
func MustBind ¶
func MustBind(c echo.Context, v interface{}, flag int, cbs ...CallbackFunc)
func MustBindCookie ¶ added in v1.0.42
func MustBindCookie(c echo.Context, v interface{}, cbs ...CallbackFunc)
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 MustCookieBool ¶ added in v1.0.42
func MustCookieBool(c echo.Context, key string, cbs ...CallbackFunc) bool
func MustCookieInt64 ¶ added in v1.0.42
func MustCookieInt64(c echo.Context, key string, cbs ...CallbackFunc) int64
func MustCookieString ¶ added in v1.0.42
func MustCookieString(c echo.Context, key string, cbs ...CallbackFunc) string
func MustCookieUint64 ¶ added in v1.0.42
func MustCookieUint64(c echo.Context, key string, cbs ...CallbackFunc) uint64
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 MustFormBindMultipart ¶ added in v1.0.26
func MustFormBindMultipart(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 NewDefaultEcho() *echo.Echo
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 ParamInt64 ¶
func ParamString ¶
func ParamUint64 ¶
func ParseByEnv ¶ added in v1.0.36
func ParseByReg ¶ added in v1.0.36
func ParseByTag ¶ added in v1.0.36
func PostFormBool ¶
func PostFormInt64 ¶
func PostFormString ¶
func PostFormUint64 ¶
func ProtobufBindBody ¶
func ProtobufBindBody(c echo.Context, v interface{}) error
ProtobufBindBody needs tag "protobuf" in fields of v.
func QueryInt64 ¶
func QueryString ¶
func QueryUint64 ¶
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 SetLoggerWithFinalizer ¶ added in v1.0.40
func SetLoggerWithFinalizer(l *zap.SugaredLogger)
func SetRequestID ¶
func SetRequestID(f func(c echo.Context) string) echo.MiddlewareFunc
func UnsafeCORS ¶ added in v1.0.32
func UnsafeCORS() echo.MiddlewareFunc
func XMLBindBody ¶
func XMLBindBody(c echo.Context, v interface{}) error
XMLBindBody needs tag "xml" in fields of v.
func YAMLBindBody ¶
func YAMLBindBody(c echo.Context, v interface{}) error
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) GetHandlerName ¶ added in v1.0.17
func (*Context) GetNamedValue ¶ added in v1.0.1
func (*Context) GetStartTime ¶ added in v1.0.20
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 NewCookieEmptyError ¶ added in v1.0.42
func NewCookieEmptyError(key string) *EmptyError
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 FileInfo ¶ added in v1.0.28
func MustFormFile ¶ added in v1.0.23
func MustFormFile(c echo.Context, key string, cbs ...CallbackFunc) *FileInfo
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 ¶
type HandlerFunc func(echo.Context, *Context)
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 RedisLogger ¶ added in v1.0.38
func NewRedisLogger ¶ added in v1.0.38
func NewRedisLogger(level string) *RedisLogger
func (*RedisLogger) DialHook ¶ added in v1.0.38
func (l *RedisLogger) DialHook(next redis.DialHook) redis.DialHook
func (*RedisLogger) ProcessHook ¶ added in v1.0.38
func (l *RedisLogger) ProcessHook(next redis.ProcessHook) redis.ProcessHook
func (*RedisLogger) ProcessPipelineHook ¶ added in v1.0.38
func (l *RedisLogger) ProcessPipelineHook(next redis.ProcessPipelineHook) redis.ProcessPipelineHook
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