go.bigb.es/auxilia
Index
- func ReserveSingleton(assetKey interface{})
- type Asset
- func ConfigurationAsset(value any) (Asset, error)
- func MustConfigurationAsset(value any) Asset
- func MustNewConfigurationAsset(value any) Asset
- func MustNewServiceAsset(value any, opts ...ComponentOption) Asset
- func MustServiceAsset(value any, opts ...ComponentOption) Asset
- func MustSingletonAsset(key any, value any, opts ...ComponentOption) Asset
- func NewConfigurationAsset(value any) (Asset, error)
- func NewServiceAsset(value any, opts ...ComponentOption) (Asset, error)
- func RegisterSingleton(assetKey interface{}, asset Asset) (got Asset, isNew bool)
- func ServiceAsset(value any, opts ...ComponentOption) (Asset, error)
- func SingletonAsset(key any, value any, opts ...ComponentOption) (Asset, error)
- type AssetStatus
- type ComponentOption
- type Destroyer
- type DummySingleton
- type GracefulStopper
- type HealthChecker
- type InitScope
- type Initer
- type Introspector
- type Manager
- func NewChildManager(parent *Manager) *Manager
- func NewManager() *Manager
- func (*Manager) AddComponent(ctx context.Context, components ...Asset)
- func (*Manager) Destroy(ctx context.Context) error
- func (*Manager) Dot(_ context.Context) string
- func (*Manager) GracefulStop(ctx context.Context) error
- func (*Manager) HealthCheck(ctx context.Context) error
- func (*Manager) Init(ctx context.Context) error
- func (*Manager) Inject(ctx context.Context) error
- func (*Manager) Override(ctx context.Context, components ...Asset)
- func (*Manager) Start(ctx context.Context) error
- func (*Manager) Stop(ctx context.Context) error
- func (*Manager) VerifyDestroyed(_ context.Context) error
- type ManagerStatus
- type StartScope
- type Starter
- type Stopper
Functions
func ReserveSingleton(assetKey interface{})
Types
type Asset interface { Name() string // contains filtered or unexported methods }
func ConfigurationAsset(value any) (Asset, error)
func MustConfigurationAsset(value any) Asset
func MustNewConfigurationAsset(value any) Asset
func MustNewServiceAsset(value any, opts ...ComponentOption) Asset
func MustServiceAsset(value any, opts ...ComponentOption) Asset
func MustSingletonAsset(key any, value any, opts ...ComponentOption) Asset
func NewConfigurationAsset(value any) (Asset, error)
func NewServiceAsset(value any, opts ...ComponentOption) (Asset, error)
func RegisterSingleton(assetKey interface{}, asset Asset) (got Asset, isNew bool)
func ServiceAsset(value any, opts ...ComponentOption) (Asset, error)
func SingletonAsset(key any, value any, opts ...ComponentOption) (Asset, error)
type AssetStatus int
type ComponentOption func(asset *serviceAsset)
func IgnoreUnused() ComponentOption
func Root() ComponentOption
func Singleton(singletonKey interface{}) ComponentOption
Singleton marks the asset as a singleton asset. Singleton assets are always root assets and created only once. NB: Singleton assets cant depend on other assets, for now.
type Destroyer interface { Destroy(ctx context.Context) error }
type DummySingleton struct { // contains filtered or unexported fields }
func (d DummySingleton) Name() string
type GracefulStopper interface { GracefulStop(ctx context.Context) error }
type HealthChecker interface { HealthCheck(ctx context.Context) error }
type InitScope interface { AddComponent(ctx context.Context, components ...Asset) // we should put here already initialized components }
func InitScopeFromContext(ctx context.Context) InitScope
type Initer interface { Init(ctx context.Context) error }
type Introspector struct { // contains filtered or unexported fields }
func NewIntrospector(manager *Manager) *Introspector
func (m *Introspector) Dot(ctx context.Context) string
func (m *Introspector) Manager()
type Manager struct { // contains filtered or unexported fields }
func NewChildManager(parent *Manager) *Manager
func NewManager() *Manager
func (m *Manager) AddComponent(ctx context.Context, components ...Asset)
func (m *Manager) Destroy(ctx context.Context) error
func (m *Manager) Dot(_ context.Context) string
func (m *Manager) GracefulStop(ctx context.Context) error
func (m *Manager) HealthCheck(ctx context.Context) error
func (m *Manager) Init(ctx context.Context) error
func (m *Manager) Inject(ctx context.Context) error
func (m *Manager) Override(ctx context.Context, components ...Asset)
func (m *Manager) Start(ctx context.Context) error
func (m *Manager) Stop(ctx context.Context) error
func (m *Manager) VerifyDestroyed(_ context.Context) error
type ManagerStatus int
type StartScope interface { CreateChildManager(ctx context.Context) *Manager }
func StartScopeFromContext(ctx context.Context) StartScope
func WithStartScope(ctx context.Context, manager *Manager) (context.Context, StartScope)
type Starter interface { Start(ctx context.Context) error }
type Stopper interface { Stop(ctx context.Context) error }
Root marks the asset as a root asset. Root assets are always started/stopped.