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, hl Manager, grpcHl GrpcManager, ...) error
- type GrpcGenCallback
- type GrpcManager
- type Manager
- type RestGenCallback
- 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 { 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() validator.Validator // HandleError allows custom HTTP errors to be added to `sys-go` errors HandleError(ctx context.Context, w http.ResponseWriter, kind common.Kind, message string, cause error) // 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 TLSLogFilter ¶
type TLSLogFilter struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.