Documentation ¶
Index ¶
- Variables
- func BuildDownstreamHTTPClient(serviceName string, cfg *config.CommonDownstreamData) (*http.Client, error)
- func Recoverer(logger *logrus.Logger) func(http.Handler) http.Handler
- func SelectBasePath(fromSpec, dynamic string) string
- func Server(ctx context.Context, name string, libraryConfig *config.LibraryConfig, ...) error
- type GenCallback
- type GrpcGenCallback
- type GrpcManager
- type RestGenCallback
- type RestManager
- 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
func Server ¶
func Server(ctx context.Context, name string, libraryConfig *config.LibraryConfig, hl RestManager, grpcHl GrpcManager, logger *logrus.Logger, promRegistry *prometheus.Registry) error
Types ¶
type GenCallback ¶ added in v0.15.0
type GenCallback interface { // Config returns a structure representing the server config // This is returned from the status endpoint Config() validator.Validator // 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) }
The generic callback
type GrpcGenCallback ¶ added in v0.4.0
type GrpcGenCallback interface { GenCallback }
GrpcGenCallback extends the generic callback GenCallback
type GrpcManager ¶
type GrpcManager interface { EnabledGrpcHandlers() []handlerinitialiser.GrpcHandlerInitialiser GrpcPublicServerConfig() *config.CommonServerConfig }
type RestGenCallback ¶ added in v0.4.0
type RestGenCallback interface { GenCallback // 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 // 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 }
RestGenCallback extends GenCallback and is used by `sysl-go` to call hand-crafted code
type RestManager ¶ added in v0.15.0
type RestManager interface { EnabledHandlers() []handlerinitialiser.RestHandlerInitialiser PublicServerConfig() *config.CommonHTTPServerConfig }
type TLSLogFilter ¶
type TLSLogFilter struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.