ctx

package
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2023 License: Apache-2.0 Imports: 12 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectServices

func ConnectServices(services ...string) any

func GetService added in v0.8.1

func GetService(serviceName string) any

func IsDebugLogEnabled

func IsDebugLogEnabled() bool

IsDebugLogEnabled Deprecated: use logger.Configure

func LogDebug

func LogDebug(tag string, data ...any)

LogDebug Deprecated: use logger.Debug

func LogError

func LogError(tag string, data ...any)

LogError Deprecated: use logger.Error

func LogFatal

func LogFatal(tag string, data ...any)

LogFatal Deprecated: use logger.Fatal

func LogInfo

func LogInfo(tag string, data ...any)

LogInfo Deprecated: use logger.Info

func Run added in v0.8.1

func Run(fn func())

func RunFinally added in v0.8.1

func RunFinally(fn func(), finallyFn func())

func ServiceArray

func ServiceArray(srvs ...any) []any

func StartContextualizedApplication

func StartContextualizedApplication(packageServices ...[]any)

Types

type AppContext

type AppContext interface {
	GetService(serviceName string) any
}

type ConnectableService

type ConnectableService[In any, Out any] interface {
	Service
	OnMessage(In)
	Send(Out)
}

type Disposable added in v0.8.0

type Disposable interface {
	Dispose()
}

type EnvValue

type EnvValue struct {
	// contains filtered or unexported fields
}

func GetEnv

func GetEnv(name string) *EnvValue

func GetEnvCustom added in v0.9.0

func GetEnvCustom(custom string, name string) *EnvValue

func GetEnvCustomOrDefault added in v0.9.0

func GetEnvCustomOrDefault(custom string, name string) *EnvValue

func (*EnvValue) AsBool

func (instance *EnvValue) AsBool() bool

func (*EnvValue) AsBoolDefault

func (instance *EnvValue) AsBoolDefault(def bool) bool

func (*EnvValue) AsInt

func (instance *EnvValue) AsInt() int

func (*EnvValue) AsInt64 added in v0.9.0

func (instance *EnvValue) AsInt64() int64

func (*EnvValue) AsInt64Array added in v0.9.0

func (instance *EnvValue) AsInt64Array() []int64

func (*EnvValue) AsInt64ArrayDefault added in v0.9.0

func (instance *EnvValue) AsInt64ArrayDefault() []int64

func (*EnvValue) AsInt64Default added in v0.9.0

func (instance *EnvValue) AsInt64Default(def int64) int64

func (*EnvValue) AsIntArray

func (instance *EnvValue) AsIntArray() []int

func (*EnvValue) AsIntArrayDefault

func (instance *EnvValue) AsIntArrayDefault() []int

func (*EnvValue) AsIntDefault

func (instance *EnvValue) AsIntDefault(def int) int

func (*EnvValue) AsMap

func (instance *EnvValue) AsMap() map[string]*EnvValue

func (*EnvValue) AsString

func (instance *EnvValue) AsString() string

func (*EnvValue) AsStringArray

func (instance *EnvValue) AsStringArray() []string

func (*EnvValue) AsStringArrayDefault

func (instance *EnvValue) AsStringArrayDefault(def []string) []string

func (*EnvValue) AsStringDefault

func (instance *EnvValue) AsStringDefault(def string) string

func (*EnvValue) IsPresent

func (instance *EnvValue) IsPresent() bool

func (*EnvValue) Name added in v0.8.0

func (instance *EnvValue) Name() string

func (*EnvValue) String added in v0.9.0

func (instance *EnvValue) String() string

type Initializable added in v0.8.0

type Initializable interface {
	Init(serviceProvider ServiceProvider)
}

type LifecycleAware

type LifecycleAware interface {
	AfterStart()
	BeforeStop()
}

type Named added in v0.8.0

type Named interface {
	Name() string
}

type Service

type Service interface {
	Initializable
	Named
	Disposable
}

type ServiceConnector

type ServiceConnector[In any, Out any] struct {
	// contains filtered or unexported fields
}

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 ServiceProvider added in v0.8.0

type ServiceProvider interface {
	ByName(name string) any
	ByType(sType any) any
	// contains filtered or unexported methods
}

type TimerTask

type TimerTask struct {
	// contains filtered or unexported fields
}

func (*TimerTask) StartTimer

func (instance *TimerTask) StartTimer(interval time.Duration, actionOnTimer func())

func (*TimerTask) StopTimer

func (instance *TimerTask) StopTimer()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL