Documentation
¶
Index ¶
- func DefaultHealthHandler(c *gin.Context)
- 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) WithMetrics(v bool) *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
- func (s *Service) Build() *Service
- func (s *Service) Close() error
- func (s *Service) Engine() *gin.Engine
- func (s *Service) Routes() []gin.RouteInfo
- func (s *Service) Serve() error
- func (s *Service) Server() *http.Server
- func (s *Service) SetHealthzHandler(h gin.HandlerFunc)
- func (s *Service) SetReadinessHandler(h gin.HandlerFunc)
- func (s *Service) SetVersionHandler(h gin.HandlerFunc)
- func (s *Service) Shutdown(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultHealthHandler ¶ added in v0.1.4
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"`
Metrics bool `json:"metrics" yaml:"metrics"`
}
func (*Config) GetEndpoint ¶
func (*Config) WithEndpoint ¶
func (*Config) WithMetrics ¶ added in v0.1.3
func (*Config) WithPrefix ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) SetHealthzHandler ¶ added in v0.1.4
func (s *Service) SetHealthzHandler(h gin.HandlerFunc)
func (*Service) SetReadinessHandler ¶ added in v0.1.4
func (s *Service) SetReadinessHandler(h gin.HandlerFunc)
func (*Service) SetVersionHandler ¶ added in v0.1.4
func (s *Service) SetVersionHandler(h gin.HandlerFunc)
Click to show internal directories.
Click to hide internal directories.