Documentation
¶
Index ¶
- func ErrCodeHandler(c *gin.Context)
- func FlagSet(defaultPort int) *pflag.FlagSet
- func RequestID(c *gin.Context) string
- func VersionHandler(info *Info) gin.HandlerFunc
- func ZapRequestID(c *gin.Context) zap.Field
- type Config
- func (c *Config) Addr() string
- func (c *Config) FlagSet(defaultPort int) *pflag.FlagSet
- func (c *Config) GetEndpoint() string
- func (s *Config) WithDebug(v bool) *Config
- func (s *Config) WithEndpoint(v string) *Config
- func (s *Config) WithHost(v string) *Config
- func (s *Config) WithPort(v int) *Config
- func (s *Config) WithPprof(v bool) *Config
- func (s *Config) WithPrefix(v string) *Config
- type Handler
- type Info
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrCodeHandler ¶
func VersionHandler ¶
func VersionHandler(info *Info) gin.HandlerFunc
Types ¶
type Config ¶
type Config struct {
Prefix string `json:"prefix" yaml:"prefix" default:"/"`
Endpoint string `json:"endpoint" yaml:"endpoint"`
Host string `json:"host" yaml:"host" default:"127.0.0.1"`
Port int `json:"port" yaml:"port"`
Debug bool `json:"debug" yaml:"debug"`
Pprof bool `json:"pprof" yaml:"pprof"`
}
func (*Config) GetEndpoint ¶
func (*Config) WithEndpoint ¶
func (*Config) WithPrefix ¶
Click to show internal directories.
Click to hide internal directories.