Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCoreDialOptionsFromEnv ¶
func BuildCoreDialOptionsFromEnv(ctx context.Context, role models.ServiceRole, log logger.Logger) ([]grpc.DialOption, func(), error)
BuildCoreDialOptionsFromEnv constructs gRPC dial options for reaching the core service using the SPIFFE or mTLS settings provided via environment variables. It returns a closer function that callers should invoke to release any underlying security provider.
func CoreSecurityProviderFromEnv ¶
func CoreSecurityProviderFromEnv(ctx context.Context, role models.ServiceRole, log logger.Logger) (coregrpc.SecurityProvider, error)
CoreSecurityProviderFromEnv returns a security provider initialized from CORE_* env vars.
Types ¶
type Result ¶
type Result struct {
// contains filtered or unexported fields
}
Result contains helpers returned from Service.
func Service ¶
func Service(ctx context.Context, desc config.ServiceDescriptor, cfg interface{}, opts ServiceOptions) (*Result, error)
Service loads configuration for a managed service (file + optional pinned overlay).
func ServiceWithTemplateRegistration ¶
func ServiceWithTemplateRegistration( ctx context.Context, desc config.ServiceDescriptor, cfg interface{}, templateData []byte, opts ServiceOptions, ) (*Result, error)
ServiceWithTemplateRegistration is a convenience function that combines Service() with template registration to core for tooling that needs default config templates.
func (*Result) SetInstanceID ¶
SetInstanceID overrides the identifier associated with watcher telemetry (unused now).
type ServiceOptions ¶
type ServiceOptions struct {
Role models.ServiceRole
ConfigPath string
Logger logger.Logger
OnReload func()
DisableWatch bool
InstanceID string
KeyContext config.KeyContext
KeyContextFn func(cfg interface{}) config.KeyContext
}
ServiceOptions controls how a service configuration is loaded.