Documentation
¶
Index ¶
- Constants
- Variables
- func CloseStoragesForContext(ctx context.Context, opts ...ResolveOption) error
- func DSNtoContextDAO(ctx context.Context, dsn []string, daoFunc any) (context.Context, error)
- func MockServicesToContextDAO(ctx context.Context, ns string, dsn map[string]string, ...) (context.Context, error)
- func MustGetConfig(ctx context.Context) config.Store
- func Resolve[T any](ctx context.Context, opts ...ResolveOption) (s T, final error)
- func StorageMigration(opts ...ResolveOption) func(ctx2 context.Context) error
- type Bootstrap
- type InitProvider
- type Manager
- type ResolveAttempt
- type ResolveEdge
- type ResolveExplanation
- type ResolveHandler
- type ResolveOption
- type ResolveOptions
- type ResolveStorage
- type Viper
Constants ¶
const ( CommandStart = "start" CommandStop = "stop" CommandRestart = "restart" )
Variables ¶
var ContextKey = managerKey{}
Functions ¶
func CloseStoragesForContext ¶
func CloseStoragesForContext(ctx context.Context, opts ...ResolveOption) error
func DSNtoContextDAO ¶
func StorageMigration ¶
func StorageMigration(opts ...ResolveOption) func(ctx2 context.Context) error
StorageMigration produces a function for Resolving a storage.Migrator and apply its Migrate function
Types ¶
type Bootstrap ¶
Bootstrap wraps a config.Store and is loaded from yaml templates or additional environment data
func NewBootstrap ¶
func (*Bootstrap) RegisterTemplate ¶
RegisterTemplate adds a new template to the list
type InitProvider ¶
type Manager ¶
type Manager interface {
Context() context.Context
Registry() registry.Registry
SOTWRegistry() registry.Registry
ServeAll(...server.ServeOption) error
StopAll()
SetServeOptions(...server.ServeOption)
WatchServicesConfigs()
WatchBroker(ctx context.Context, br broker.Broker) error
Bootstrap(string) error
// RegisterBootstrapTemplate(typ string, data string) error
RegisterStorage(scheme string, options ...controller.Option[storage.Storage])
RegisterConfig(scheme string, config ...controller.Option[*openurl.Pool[config.Store]])
RegisterQueue(scheme string, opts ...controller.Option[broker.AsyncQueuePool])
RegisterCache(scheme string, opts ...controller.Option[*openurl.Pool[cache.Cache]])
GetRootID() string
GetStorage(ctx context.Context, name string, out any) error
GetQueue(ctx context.Context, name string, resolutionData map[string]interface{}, openerID string, openerFunc broker.OpenWrapper) (broker.AsyncQueue, func() (bool, error), error)
GetQueuePool(name string) (broker.AsyncQueuePool, error)
GetCache(ctx context.Context, name string, resolutionData map[string]interface{}) (cache.Cache, error)
}
type ResolveAttempt ¶ added in v5.0.3
type ResolveEdge ¶ added in v5.0.3
type ResolveExplanation ¶ added in v5.0.3
type ResolveExplanation struct {
ServiceName string
ServiceID string
StorageName string
Handlers []ResolveHandler
Storages []ResolveStorage
Edges []ResolveEdge
Attempts []ResolveAttempt
}
ResolveExplanation describes the registry state used when resolving a DAO. It is intentionally side-effect free: storage connections are not opened and DAO handlers are not called.
func ExplainResolve ¶ added in v5.0.3
func ExplainResolve(ctx context.Context, opts ...ResolveOption) (*ResolveExplanation, error)
ExplainResolve reports why the current service's DAO handlers can or cannot be matched to the storages and edges visible in the registry.
func (*ResolveExplanation) Summary ¶ added in v5.0.3
func (e *ResolveExplanation) Summary() string
Summary returns a compact, safe-to-log explanation. It deliberately omits storage metadata values, which may contain credentials or other secrets.
type ResolveHandler ¶ added in v5.0.3
type ResolveOption ¶
type ResolveOption func(*ResolveOptions)
func WithCleanBeforeClose ¶
func WithCleanBeforeClose() ResolveOption
func WithName ¶
func WithName(name string) ResolveOption