Documentation
¶
Index ¶
- type HttpServer
- type MuxServer
- func (ms *MuxServer) Handle(pattern string, handler http.Handler)
- func (ms *MuxServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
- func (ms *MuxServer) RegisterLogControl(handler http.Handler)
- func (ms *MuxServer) RegisterMetrics(g prometheus.Gatherer)
- func (ms *MuxServer) RegisterProber(p *prober.HTTPProbe)
- func (ms *MuxServer) RegisterProfiler()
- func (ms *MuxServer) RunGroup(g *run.Group)
- type Option
- type OptionFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHttpServer ¶
func NewHttpServer(handler http.Handler, logger *log.Logger, opts ...OptionFunc) *HttpServer
func (*HttpServer) Shutdown ¶
func (hs *HttpServer) Shutdown(err error)
func (*HttpServer) Start ¶
func (hs *HttpServer) Start() error
type MuxServer ¶
type MuxServer struct {
*HttpServer
// contains filtered or unexported fields
}
MuxServer 简单的 http mux server 一般用来挂载 prometheus 和 pprof.
func NewMuxServer ¶
func NewMuxServer(logger *log.Logger, opts ...OptionFunc) *MuxServer
func (*MuxServer) HandleFunc ¶
func (*MuxServer) RegisterLogControl ¶
func (*MuxServer) RegisterMetrics ¶
func (ms *MuxServer) RegisterMetrics(g prometheus.Gatherer)
func (*MuxServer) RegisterProber ¶
func (*MuxServer) RegisterProfiler ¶
func (ms *MuxServer) RegisterProfiler()
type OptionFunc ¶
type OptionFunc func(option *Option)
func WithGracePeriod ¶
func WithGracePeriod(gracePeriod time.Duration) OptionFunc
func WithListen ¶
func WithListen(listen string) OptionFunc
func WithServiceName ¶
func WithServiceName(name string) OptionFunc
Click to show internal directories.
Click to hide internal directories.