Documentation ¶
Index ¶
- func ConnectServices(services ...string) any
- func DefineServiceName(service any) string
- func GetService(serviceName string) any
- func GetTypedService[T any]() T
- func InjectEnv(target any)
- func Run(fn func())
- func RunFinally(fn func(), finallyFn func())
- func RunWithRecover(fn func())
- func ServiceArray(srvs ...any) []any
- func StartContextualizedApplication(servicePackages ...[]any)deprecated
- type AppContext
- type AppContextHealth
- type AppContextStats
- type Application
- type ConnectableService
- type Constructable
- type Disposable
- 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 LifecycleAwaredeprecated
- type Named
- type NamedService
- type Service
- 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 GetTypedService[T any]() T
func RunFinally ¶ added in v0.8.1
func RunFinally(fn func(), finallyFn func())
func RunWithRecover ¶ added in v0.9.3
func RunWithRecover(fn func())
func ServiceArray ¶
func StartContextualizedApplication
deprecated
func StartContextualizedApplication(servicePackages ...[]any)
Deprecated: use ctx.CreateContextualizedApplication with .Join() call
Types ¶
type AppContext ¶
type AppContext interface { GetService(serviceName string) any 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 CreateContextualizedApplication ¶ added in v0.9.16
func CreateContextualizedApplication(servicePackages ...ServicePackage) Application
func StartApplication
deprecated
added in
v0.9.15
func StartApplication(servicePackages ...[]any) Application
Deprecated: use CreateContextualizedApplication instead
type ConnectableService ¶
type Constructable ¶ added in v0.9.18
type Constructable interface {
Init()
}
type Disposable ¶ added in v0.8.0
type Disposable interface {
Dispose()
}
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 LifecycleAware
deprecated
type LifecycleAware interface { StartAware StopAware }
Deprecated: use ctx.StartAware and ctx.StopAware
type NamedService ¶ added in v0.9.16
type NamedService struct {
// contains filtered or unexported fields
}
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 Service ¶
type Service interface { Initializable Named Disposable }
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.