Documentation ¶
Index ¶
- func SetName(name string)
- type App
- func (a *App) Close()
- func (a *App) Info() *Info
- func (a *App) Logger() *zap.Logger
- func (a *App) Router() chi.Router
- func (a *App) Run(impl ...transport.Service) error
- func (a *App) TraceLogger() tracelog.Logger
- func (a *App) Tracer() *tracing.Tracer
- func (a *App) WithRunOptions(opts ...app.RunOption) *App
- type Info
- type Option
- func AddLogCaller() Option
- func AddLogStacktrace(level string) Option
- func WithAdminHTTP(port uint16) Option
- func WithCORSAllowedAuthentication(allow bool) Option
- func WithCORSAllowedHeaders(headers []string) Option
- func WithCORSAllowedOrigins(origins []string) Option
- func WithExitSignals(sig ...os.Signal) Option
- func WithLogField(key string, value interface{}) Option
- func WithPublicGRPc(port uint16) Option
- func WithPublicHTTP(port uint16) Option
- type RunOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
func (*App) TraceLogger ¶
type Option ¶
func AddLogCaller ¶
func AddLogCaller() Option
AddLogCaller configures the Logger to annotate each message with the filename and line number of zap's caller. See also WithCaller.
func AddLogStacktrace ¶
AddLogStacktrace configures the Logger to record a stack trace for all messages at or above a given level.
func WithAdminHTTP ¶
func WithCORSAllowedAuthentication ¶ added in v0.2.1
WithCORSAllowedAuthentication sets if HTTP client allows authentication like cookies, SSL certs and HTTP basic auth.
func WithCORSAllowedHeaders ¶ added in v0.2.1
WithCORSAllowedHeaders sets a list of non simple headers the HTTP client is allowed to use with cross-domain requests. If the special "*" value is present in the list, all headers will be allowed. Default value is [] but "Origin" is always appended to the list.
func WithCORSAllowedOrigins ¶ added in v0.2.1
WithCORSAllowedOrigins sets allowed origin domains for cross-domain requests. If the special "*" value is present in the list, all origins will be allowed. An origin may contain a wildcard (*) to replace 0 or more characters (i.e.: http://*.domain.com). Usage of wildcards implies a small performance penality. Only one wildcard can be used per origin. Default option enable CORS for requests on admin port.
func WithExitSignals ¶
func WithLogField ¶
WithLogField adds field to the Logger.
func WithPublicGRPc ¶
func WithPublicHTTP ¶
type RunOption ¶
func WithTLSConfig ¶
func WithTLSKeyPair ¶
func WithUnaryInterceptor ¶
func WithUnaryInterceptor(interceptor grpc.UnaryServerInterceptor) RunOption