Documentation
¶
Index ¶
- func ConnectServices(services ...string) any
- func DefineServiceName(service any) string
- func Env[T any]() T
- func GetService(serviceName string) (svc any, ok bool)
- func GetTypedService[T any]() (svc T, ok bool)
- func InitSlog()
- func InjectEnv(target any)
- func NewSlogLegacyHandler(w io.Writer, level slog.Level, addSource bool) slog.Handler
- func SetSlogHandler(handler slog.Handler)
- func SetSlogWriter(writers ...io.Writer)
- type AppContext
- type AppContextHealth
- type AppContextStats
- type Application
- type ConnectableService
- type Constructable
- type ConstructableContext
- type ConstructableContextE
- type ConstructableE
- type Disposable
- type DisposableE
- type EnvValue
- func (instance *EnvValue) AsBool() bool
- func (instance *EnvValue) AsBoolDefault(def bool) bool
- func (instance *EnvValue) AsDuration() time.Duration
- func (instance *EnvValue) AsDurationDefault(def time.Duration) time.Duration
- func (instance *EnvValue) AsInt() int
- func (instance *EnvValue) AsInt64() int64
- func (instance *EnvValue) AsInt64Array() []int64
- func (instance *EnvValue) AsInt64ArrayDefault() []int64
- func (instance *EnvValue) AsInt64Default(def int64) int64
- func (instance *EnvValue) AsInt64Set() map[int64]bool
- func (instance *EnvValue) AsInt64SetDefault() map[int64]bool
- func (instance *EnvValue) AsIntArray() []int
- func (instance *EnvValue) AsIntArrayDefault() []int
- func (instance *EnvValue) AsIntDefault(def int) int
- func (instance *EnvValue) AsIntSet() map[int]bool
- func (instance *EnvValue) AsIntSetDefault() map[int]bool
- func (instance *EnvValue) AsMap() map[string]*EnvValue
- func (instance *EnvValue) AsMapDefault() map[string]*EnvValue
- func (instance *EnvValue) AsString() string
- func (instance *EnvValue) AsStringArray() []string
- func (instance *EnvValue) AsStringArrayDefault(def []string) []string
- func (instance *EnvValue) AsStringDefault(def string) string
- func (instance *EnvValue) AsStringSet() map[string]bool
- func (instance *EnvValue) AsStringSetDefault(def []string) map[string]bool
- func (instance *EnvValue) IsPresent() bool
- func (instance *EnvValue) Name() string
- func (instance *EnvValue) String() string
- type HealthReporter
- type Initializable
- type InitializableContext
- type InitializableContextE
- type InitializableE
- type Named
- type NamedService
- type ServiceConnector
- type ServiceDescriptor
- type ServicePackage
- type ServiceProvider
- type StartAware
- type StopAware
- type TimerTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConnectServices ¶
func DefineServiceName ¶ added in v0.9.16
func GetService ¶ added in v0.8.1
func GetTypedService ¶ added in v0.9.16
func NewSlogLegacyHandler ¶ added in v0.10.5
func SetSlogHandler ¶ added in v0.10.1
func SetSlogWriter ¶ added in v0.10.5
Types ¶
type AppContext ¶
type AppContext interface {
GetService(serviceName string) (any, bool)
Stats() AppContextStats
Health() AppContextHealth
State() (int, string)
}
type AppContextHealth ¶ added in v0.9.7
type AppContextHealth interface {
Aggregate() health.ServiceHealth
}
type AppContextStats ¶ added in v0.9.7
type AppContextStats interface {
Services() map[string]ServiceDescriptor
}
type Application ¶ added in v0.9.15
type Application interface {
Stop() Application
Join()
}
func CreateAutoContextualizedApplication ¶ added in v0.11.2
func CreateAutoContextualizedApplication() Application
func CreateContextualizedApplication ¶ added in v0.9.16
func CreateContextualizedApplication(servicePackages ...ServicePackage) Application
type ConnectableService ¶
type ConnectableService[In any, Out any] interface { Initializable Disposable Named OnMessage(In) Send(Out) }
type Constructable ¶ added in v0.9.18
type Constructable interface {
Init()
}
type ConstructableContext ¶ added in v0.10.7
type ConstructableContextE ¶ added in v0.11.0
type ConstructableE ¶ added in v0.11.0
type ConstructableE interface {
Init() error
}
type Disposable ¶ added in v0.8.0
type Disposable interface {
Dispose()
}
type DisposableE ¶ added in v0.11.0
type DisposableE interface {
Dispose() error
}
type EnvValue ¶
type EnvValue struct {
// contains filtered or unexported fields
}
func GetEnvCustom ¶ added in v0.9.0
func GetEnvCustomOrDefault ¶ added in v0.9.0
func (*EnvValue) AsBoolDefault ¶
func (*EnvValue) AsDuration ¶ added in v0.9.3
func (*EnvValue) AsDurationDefault ¶ added in v0.9.3
func (*EnvValue) AsInt64Array ¶ added in v0.9.0
func (*EnvValue) AsInt64ArrayDefault ¶ added in v0.9.0
func (*EnvValue) AsInt64Default ¶ added in v0.9.0
func (*EnvValue) AsInt64Set ¶ added in v0.9.11
func (*EnvValue) AsInt64SetDefault ¶ added in v0.9.11
func (*EnvValue) AsIntArray ¶
func (*EnvValue) AsIntArrayDefault ¶
func (*EnvValue) AsIntDefault ¶
func (*EnvValue) AsIntSetDefault ¶ added in v0.9.11
func (*EnvValue) AsMapDefault ¶ added in v0.9.13
func (*EnvValue) AsStringArray ¶
func (*EnvValue) AsStringArrayDefault ¶
func (*EnvValue) AsStringDefault ¶
func (*EnvValue) AsStringSet ¶ added in v0.9.11
func (*EnvValue) AsStringSetDefault ¶ added in v0.9.11
type HealthReporter ¶ added in v0.9.7
type HealthReporter interface {
Health() health.ServiceHealth
}
type Initializable ¶ added in v0.8.0
type Initializable interface {
Init(serviceProvider ServiceProvider)
}
type InitializableContext ¶ added in v0.10.7
type InitializableContext interface {
Init(context context.Context, serviceProvider ServiceProvider)
}
type InitializableContextE ¶ added in v0.11.0
type InitializableContextE interface {
Init(context context.Context, serviceProvider ServiceProvider) error
}
type InitializableE ¶ added in v0.11.0
type InitializableE interface {
Init(serviceProvider ServiceProvider) error
}
type NamedService ¶ added in v0.9.16
type NamedService struct {
// contains filtered or unexported fields
}
func Typed ¶ added in v0.11.2
func Typed[T any]() NamedService
func TypedWithName ¶ added in v0.11.2
func TypedWithName[T any](name string) NamedService
func WithName ¶ added in v0.9.16
func WithName(name string, service any) NamedService
func (*NamedService) Name ¶ added in v0.9.16
func (n *NamedService) Name() string
func (*NamedService) Service ¶ added in v0.9.16
func (n *NamedService) Service() any
type ServiceConnector ¶
func NewServiceConnector ¶
func NewServiceConnector[In any, Out any](service ConnectableService[In, Out]) ServiceConnector[In, Out]
func (*ServiceConnector[In, Out]) AfterStart ¶
func (connector *ServiceConnector[In, Out]) AfterStart()
func (*ServiceConnector[In, Out]) BeforeStop ¶
func (connector *ServiceConnector[In, Out]) BeforeStop()
func (*ServiceConnector[In, Out]) Send ¶
func (connector *ServiceConnector[In, Out]) Send(msg Out)
type ServiceDescriptor ¶ added in v0.9.4
type ServicePackage ¶ added in v0.9.16
type ServicePackage struct {
// contains filtered or unexported fields
}
func PackageOf ¶ added in v0.9.16
func PackageOf(services ...any) ServicePackage
func (*ServicePackage) ForEach ¶ added in v0.9.16
func (p *ServicePackage) ForEach(fn func(service any, name string))
type ServiceProvider ¶ added in v0.8.0
type StartAware ¶ added in v0.9.21
type StartAware interface {
AfterStart()
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.