water

package module
v0.0.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 5 Imported by: 6

README

water

上善若水,水善利万物而不争

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.0.10

type Config struct {
	Level      string `yaml:"level"`
	Encoding   string `yaml:"encoding"`
	CallFull   bool   `yaml:"call_full"`
	MaxSize    int    `yaml:"max_size"`
	MaxAge     int    `yaml:"max_age"`
	MaxBackups int    `yaml:"max_backups"`
	LocalTime  bool   `yaml:"local_time"`
	Compress   bool   `yaml:"compress"`
	Color      bool   `yaml:"color"`
	AddCaller  bool   `yaml:"add_caller"`
}

func (*Config) NewLogger added in v0.0.10

func (conf *Config) NewLogger() *zap.Logger

type Endpoint

type Endpoint func(ctx *gin.Context, req interface{}) (interface{}, error)

type ErrorHandler

type ErrorHandler interface {
	Handle(ctx *gin.Context, err error)
}

type ErrorHandlerFunc

type ErrorHandlerFunc func(ctx *gin.Context, err error)

func (ErrorHandlerFunc) Handle

func (f ErrorHandlerFunc) Handle(ctx *gin.Context, err error)

type Handler

type Handler interface {
	ServeGin(ctx *gin.Context, req interface{}) (interface{}, error)
}

type LogErrorHandler

type LogErrorHandler struct {
	// contains filtered or unexported fields
}

func NewLogErrorHandler

func NewLogErrorHandler(l *zap.Logger) *LogErrorHandler

func (*LogErrorHandler) Handle

func (h *LogErrorHandler) Handle(ctx *gin.Context, err error)

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(svc Service, options ...ServerOption) *Server

func NewServer

func NewServer(e Endpoint, options ...ServerOption) *Server

func (Server) ServeGin added in v0.0.4

func (s Server) ServeGin(ctx *gin.Context, req interface{}) (resp interface{}, err error)

type ServerFinalizerFunc

type ServerFinalizerFunc func(ctx *gin.Context, err error)

type ServerOption

type ServerOption func(*Server)

func ServerConfig added in v0.0.10

func ServerConfig(c *Config) ServerOption

func ServerErrorHandler added in v0.0.5

func ServerErrorHandler(errorHandler ErrorHandler) ServerOption

func ServerFinalizer added in v0.0.5

func ServerFinalizer(f ...ServerFinalizerFunc) ServerOption

type Service

type Service interface {
	Endpoint() Endpoint
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL