Documentation
¶
Index ¶
- Variables
- func CloseService(ctx context.Context, ser any) error
- func MergeDatasources(ctx context.Context, datasources []Datasource, ipv4, ipv6, fastfail bool) ([]netip.Addr, error)
- func MergeDualStackDatasourceIP(ctx context.Context, s DatasourceDualStack) ([]netip.Addr, error)
- func Register[T managedType, O any](R Registry[T], typ string, constructor GenericObjectConstructor[T, O])
- func StartService(ctx context.Context, ser any) error
- type AbstractManagedType
- type Datasource
- type DatasourceDualStack
- type DatasourceError
- type DatasourceManager
- type DefaultManager
- type GenericObjectConstructor
- type Manager
- type PostCloser
- type PostStarter
- type PreCloser
- type PreStarter
- type Provider
- type ProviderManager
- type Registry
- type Service
- type ServiceLifeCycleError
Constants ¶
This section is empty.
Variables ¶
View Source
var DatasourceRegister = NewRegister[Datasource]()
View Source
var ProviderRegister = NewRegister[Provider]()
Functions ¶
func MergeDatasources ¶
Types ¶
type AbstractManagedType ¶
type AbstractManagedType struct {
// contains filtered or unexported fields
}
func NewManagedType ¶
func NewManagedType(typ, name string) AbstractManagedType
func (AbstractManagedType) Name ¶
func (a AbstractManagedType) Name() string
func (AbstractManagedType) Type ¶
func (a AbstractManagedType) Type() string
type Datasource ¶
type DatasourceDualStack ¶
type DatasourceError ¶
func (*DatasourceError) Error ¶
func (e *DatasourceError) Error() string
func (*DatasourceError) Unwrap ¶
func (e *DatasourceError) Unwrap() error
type DatasourceManager ¶
type DatasourceManager = Manager[Datasource]
type DefaultManager ¶
type DefaultManager[T managedType] struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager[T managedType](R Registry[T]) *DefaultManager[T]
func (*DefaultManager[T]) Lookup ¶
func (M *DefaultManager[T]) Lookup(name string) (T, bool)
type PostCloser ¶
type PostStarter ¶
type PreStarter ¶
type ProviderManager ¶
type Registry ¶
type Registry[T managedType] interface {
Create(ctx context.Context, typ string, option any) (T, error)
CreateOption(typ string) (any, error)
Types() []string
// contains filtered or unexported methods
}
func NewRegister ¶
func NewRegister[T managedType]() Registry[T]
type ServiceLifeCycleError ¶
func (*ServiceLifeCycleError) Error ¶
func (E *ServiceLifeCycleError) Error() string
func (*ServiceLifeCycleError) Unwrap ¶
func (E *ServiceLifeCycleError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.