Documentation ¶
Index ¶
- type HTTPClient
- type HTTPClientOption
- type Logger
- type LoggerOption
- type LoggerOptions
- type Option
- type Server
- func (s *Server) AddService(service Service)
- func (s *Server) AddServices(services ...Service)
- func (s *Server) Config() *viper.Viper
- func (s *Server) Context() context.Context
- func (s *Server) GetService(name string) Service
- func (s *Server) Logger() *zap.Logger
- func (s *Server) Meter() metric.Meter
- func (s *Server) Start()
- func (s *Server) Tracer() trace.Tracer
- type Service
- type ServiceHTTP
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPClient ¶
func NewHTTPClient ¶
func NewHTTPClient(opts ...HTTPClientOption) *HTTPClient
type HTTPClientOption ¶
type HTTPClientOption func(c *HTTPClient)
func HTTPClientWithBaseURL ¶
func HTTPClientWithBaseURL(v string) HTTPClientOption
func HTTPClientWithCookieJar ¶
func HTTPClientWithCookieJar(v *cookiejar.Jar) HTTPClientOption
type LoggerOption ¶ added in v0.6.2
type LoggerOption func(*LoggerOptions)
func LoggerWithLevel ¶ added in v0.6.2
func LoggerWithLevel(o zapcore.LevelEnabler) LoggerOption
LoggerWithLevel adds zap.Option's to a test Logger built by NewLogger.
func LoggerWithZapOptions ¶ added in v0.6.2
func LoggerWithZapOptions(o ...zap.Option) LoggerOption
LoggerWithZapOptions adds zap.Option's to a test Logger built by NewLogger.
type LoggerOptions ¶ added in v0.6.2
type LoggerOptions struct { Level zapcore.LevelEnabler // contains filtered or unexported fields }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AddService ¶
AddService add a single service
func (*Server) AddServices ¶
AddServices adds multiple service
func (*Server) GetService ¶
type Service ¶
type Service interface { URL() string Name() string Start(ctx context.Context) error Close(ctx context.Context) error }
Service interface
type ServiceHTTP ¶
type ServiceHTTP struct {
// contains filtered or unexported fields
}
ServiceHTTP struct
func NewServiceHTTP ¶
func NewServiceHTTP(l *zap.Logger, name string, handler http.Handler, middlewares ...middleware.Middleware) *ServiceHTTP
func (*ServiceHTTP) Logger ¶
func (s *ServiceHTTP) Logger() *zap.Logger
func (*ServiceHTTP) Name ¶
func (s *ServiceHTTP) Name() string
func (*ServiceHTTP) URL ¶
func (s *ServiceHTTP) URL() string
Click to show internal directories.
Click to hide internal directories.