Documentation ¶
Index ¶
- Variables
- func BuildDownstreamHTTPClient(serviceName string, cfg *config.CommonDownstreamData) (*http.Client, error)
- func Recoverer(ctx context.Context) func(http.Handler) http.Handler
- func SelectBasePath(fromSpec, dynamic string) string
- func Server(ctx context.Context, name string, hl Manager, grpcHl GrpcManager, ...) errordeprecated
- type GrpcGenCallback
- type GrpcManager
- type Manager
- type RestGenCallback
- type ServerOption
- func WithGrpcManager(manager GrpcManager) ServerOption
- func WithLogrusLogger(logger *logrus.Logger) ServerOptiondeprecated
- func WithPkgLogger(configs ...log.Config) ServerOption
- func WithPrometheusRegistry(prometheusRegistry *prometheus.Registry) ServerOption
- func WithRestManager(manager Manager) ServerOption
- type ServerParams
- type TLSLogFilter
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Name is set at the build time Name = "" // Version is set at the build time Version = "" // BuildID is set at the build time BuildID = "" // CommitSha is set at the build time CommitSha = "" // BranchName is set at the build time BranchName = "" // TagName is set at the build time TagName = "" )
Functions ¶
func SelectBasePath ¶
SelectBasePath chooses between a specified base path and a dynmaically chosen one
Types ¶
type GrpcGenCallback ¶ added in v0.4.0
type GrpcGenCallback interface {
DownstreamTimeoutContext(ctx context.Context) (context.Context, context.CancelFunc)
}
GrpcGenCallback is currently a subset of RestGenCallback so is defined separately for convenience
type GrpcManager ¶
type GrpcManager interface { Interceptors() []grpc.UnaryServerInterceptor EnabledGrpcHandlers() []handlerinitialiser.GrpcHandlerInitialiser GrpcAdminServerConfig() *config.CommonServerConfig GrpcPublicServerConfig() *config.CommonServerConfig }
type Manager ¶
type Manager interface { EnabledHandlers() []handlerinitialiser.HandlerInitialiser LibraryConfig() *config.LibraryConfig AdminServerConfig() *config.CommonHTTPServerConfig PublicServerConfig() *config.CommonHTTPServerConfig }
type RestGenCallback ¶ added in v0.4.0
type RestGenCallback interface { // AddMiddleware allows hand-crafted code to add middleware to the router AddMiddleware(ctx context.Context, r chi.Router) // BasePath allows hand-crafted code to set the base path for the Router BasePath() string // Config returns a structure representing the server config // This is returned from the status endpoint Config() interface{} // MapError maps an error to an HTTPError in instances where custom error mapping is required. Return nil to perform default error mapping; defined as: // 1. CustomError.HTTPError if the original error is a CustomError, otherwise // 2. common.MapError MapError(ctx context.Context, err error) *common.HTTPError // DownstreamTimeoutContext add the desired timeout duration to the context for downstreams // A separate service timeout (usually greater than the downstream) should also be in // place to automatically respond to callers DownstreamTimeoutContext(ctx context.Context) (context.Context, context.CancelFunc) }
RestGenCallback is used by `sysl-go` to call hand-crafted code
type ServerOption ¶ added in v0.24.0
type ServerOption interface {
// contains filtered or unexported methods
}
func WithGrpcManager ¶ added in v0.24.0
func WithGrpcManager(manager GrpcManager) ServerOption
func WithLogrusLogger
deprecated
added in
v0.24.0
func WithLogrusLogger(logger *logrus.Logger) ServerOption
Deprecated: Use WithPkgLogger instead
func WithPkgLogger ¶ added in v0.32.0
func WithPkgLogger(configs ...log.Config) ServerOption
func WithPrometheusRegistry ¶ added in v0.24.0
func WithPrometheusRegistry(prometheusRegistry *prometheus.Registry) ServerOption
func WithRestManager ¶ added in v0.24.0
func WithRestManager(manager Manager) ServerOption
type ServerParams ¶ added in v0.24.0
type ServerParams struct { Ctx context.Context Name string // contains filtered or unexported fields }
func NewServerParams ¶ added in v0.24.0
func NewServerParams(ctx context.Context, name string, opts ...ServerOption) *ServerParams
func (*ServerParams) Start ¶ added in v0.24.0
func (params *ServerParams) Start() error
type TLSLogFilter ¶
type TLSLogFilter struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.