Documentation ¶
Index ¶
- Variables
- func AssertNotRunning(what string)
- func EnvIs(purpose schema.Environment_Purpose) bool
- func InitializationDone()
- func MustUnwrapProto(b64 string, m proto.Message) proto.Message
- func ProvideServerInfo(ctx context.Context, _ *types.ServerInfoArgs) (*types.ServerInfo, error)
- func RegisterDebugEndpoints(mux *mux.Router)
- func StatusHandler(registered []string) http.Handler
- func WithResources(ctx context.Context, res *ServerResources) context.Context
- type Check
- type Checker
- type CheckerFunc
- type CtxCloseable
- type DebugHandler
- type Dependencies
- type DependencyGraph
- type Initializer
- type InstantiationPath
- type Package
- type Provider
- type Reference
- type ServerResources
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func AssertNotRunning ¶
func AssertNotRunning(what string)
func EnvIs ¶
func EnvIs(purpose schema.Environment_Purpose) bool
func InitializationDone ¶
func InitializationDone()
func MustUnwrapProto ¶
MustUnwrapProto unserializes a proto from a base64 string. This is used to pack pre-computed protos into a binary, and is never expected to fail.
func ProvideServerInfo ¶
func ProvideServerInfo(ctx context.Context, _ *types.ServerInfoArgs) (*types.ServerInfo, error)
func RegisterDebugEndpoints ¶
func StatusHandler ¶
func WithResources ¶
func WithResources(ctx context.Context, res *ServerResources) context.Context
Types ¶
type Check ¶
type Check struct {
// contains filtered or unexported fields
}
func ProvideLivenessCheck ¶
func ProvideReadinessCheck ¶
func (Check) Register ¶
By default, a Readiness checker never returns a failure after it becomes valid once. This is by design, we don't want our server to stop receiving traffic in the event of intermittent issues (e.g. we don't want to track whether our dependencies are reachable). To manually control the behavior pass in a `ManualChecker` instead.
func (Check) RegisterFunc ¶
func (c Check) RegisterFunc(name string, check CheckerFunc)
type Checker ¶
func ManualChecker ¶
func ManualChecker(check CheckerFunc) Checker
type CheckerFunc ¶
type CtxCloseable ¶
type DebugHandler ¶
type DebugHandler struct {
// contains filtered or unexported fields
}
func ProvideDebugHandler ¶
func ProvideDebugHandler(ctx context.Context, _ *types.DebugHandlerArgs) (DebugHandler, error)
func (DebugHandler) Handle ¶
func (h DebugHandler) Handle(handler http.Handler)
type Dependencies ¶
type DependencyGraph ¶
type DependencyGraph struct {
// contains filtered or unexported fields
}
func NewDependencyGraph ¶
func NewDependencyGraph() *DependencyGraph
func (*DependencyGraph) AddInitializers ¶
func (di *DependencyGraph) AddInitializers(init ...*Initializer)
func (*DependencyGraph) Init ¶
func (di *DependencyGraph) Init(ctx context.Context) error
Init is deprecated; use RunInitializers.
func (*DependencyGraph) Instantiate ¶
func (*DependencyGraph) RunInitializers ¶
func (di *DependencyGraph) RunInitializers(ctx context.Context) error
type Initializer ¶
type InstantiationPath ¶
type InstantiationPath struct {
// contains filtered or unexported fields
}
func InstantiationPathFromContext ¶
func InstantiationPathFromContext(ctx context.Context) *InstantiationPath
InstantiationPathFromContext returns the InstantiationPath associated with the ctx. If no logger is associated, nil is returned
func (*InstantiationPath) Append ¶
func (ip *InstantiationPath) Append(pkg schema.PackageName) *InstantiationPath
func (*InstantiationPath) Last ¶
func (ip *InstantiationPath) Last() schema.PackageName
func (*InstantiationPath) String ¶
func (ip *InstantiationPath) String() string
func (*InstantiationPath) WithContext ¶
func (ip *InstantiationPath) WithContext(ctx context.Context) context.Context
WithContext returns a copy of ctx with ip associated. If an instance of InstantiationPath is already in the context, the value is overwritten.
type Reference ¶
type Reference struct { Package schema.PackageName Typename string }
type ServerResources ¶
type ServerResources struct {
// contains filtered or unexported fields
}
func PrepareEnv ¶
func PrepareEnv(specifiedServerName string) *ServerResources
func ServerResourcesFrom ¶
func ServerResourcesFrom(ctx context.Context) *ServerResources
func (*ServerResources) Add ¶
func (sr *ServerResources) Add(closeable CtxCloseable)