Documentation ¶
Index ¶
- type Option
- func WithHandler(handler http.Handler) Option
- func WithHost(host string) Option
- func WithHttpServer(httpServer http.Server) Option
- func WithLogger(logger glog.ILogger) Option
- func WithMaxHeaderBytes(maxHeaderBytes int) Option
- func WithPort(port int) Option
- func WithProtocol(protocol string) Option
- func WithReadTimeout(readTimeout time.Duration) Option
- func WithServiceName(serviceName string) Option
- func WithVersion(version string) Option
- func WithWriterTimeout(writerTimeout time.Duration) Option
- type Server
- func (s *Server) AddDiscovery(client discovery.Discovery) *Server
- func (s *Server) AddHandler(handler http.Handler) *Server
- func (s *Server) AddTrace(tracer *tracer.Server) *Server
- func (s *Server) HostInfo() *host.InfoStat
- func (s *Server) IsDevelopment() bool
- func (s *Server) IsProduction() bool
- func (s *Server) IsTest() bool
- func (s *Server) PrintHostInfo()
- func (s *Server) Run()
- func (s *Server) SetRunMode(mode string)
- func (s *Server) Shutdown()
- func (s *Server) StopNotify(sig os.Signal)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(*Server)
Option for queue system
func WithHttpServer ¶
WithHttpServer set httpServer function
func WithMaxHeaderBytes ¶
WithMaxHeaderBytes set maxHeaderBytes function
func WithReadTimeout ¶
WithReadTimeout set readTimeout function
func WithServiceName ¶
WithServiceName set serviceName function
func WithWriterTimeout ¶
WithWriterTimeout set writerTimeout function
type Server ¶
type Server struct { Ctx context.Context Tracer *tracer.Server Logger glog.ILoggerEntry ServiceName string Host string Port int Version string // contains filtered or unexported fields }
func (*Server) IsDevelopment ¶
func (*Server) IsProduction ¶
func (*Server) PrintHostInfo ¶ added in v0.4.6
func (s *Server) PrintHostInfo()
func (*Server) SetRunMode ¶
func (*Server) StopNotify ¶
Click to show internal directories.
Click to hide internal directories.