Documentation
¶
Index ¶
Constants ¶
View Source
const ( // Healthcheck is healthcheck service Healthcheck = "healthcheck-service" // Version is healthcheck service Version = "version-service" // JWT is jwt issuer service JWT = "jwt-service" // Keys is keys interface service Keys = "keys-service" )
Variables ¶
View Source
var (
// ServiceCtxKey is the context.Context key to store the services context
ServiceCtxKey = &contextKey{"ServiceContext"}
)
Functions ¶
func NewContext ¶
NewContext returns a new service InitContext
Types ¶
type GRPCConfig ¶
GRPCConfig holds grpc init info
type GRPCRegisterer ¶
GRPCRegisterer interface to register grpc services
type InitContext ¶
type InitContext struct {
KeysRepo *keys.Repository
ContEnc jose.ContentEncryption
Logger *zap.Logger
G *group.Group
CancelInterrupt chan struct{}
GrpcRegisterers []GRPCRegisterer
ServiceInfos []*ServiceInfo
Services map[string]interface{}
GRPCConfig
Metrics
*sync.RWMutex
}
InitContext is used for service initialization
func FromContext ¶
func FromContext(ctx context.Context) (*InitContext, error)
FromContext returns service *InitContext from context
type ServiceInfo ¶
type ServiceInfo struct {
// Type of the plugin
Type Type
// ID of the plugin
ID string
// Config specific to the plugin
Config interface{}
// Requires is a list of plugins that the registered plugin requires to be available
Requires []Type
// InitFn is called when initializing a plugin. The registration and
// context are passed in. The init function may modify the registration to
// add exports, capabilities and platform support declarations.
InitFn func(context.Context) (interface{}, error)
// Disable the plugin from loading
Disable bool
}
ServiceInfo contains information for registering service
Click to show internal directories.
Click to hide internal directories.