ctx

package
v0.7.13 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 11 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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.Debug

func LogFatal

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

LogFatal Deprecated: use logger.Debug

func LogInfo

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

LogInfo Deprecated: use logger.Debug

func StartContextualizedApplication

func StartContextualizedApplication(packageServices ...[]Service)

Types

type AppContext

type AppContext interface {
	Register(serviceInstance Service) AppContext
	Start()
	Stop()
	GetService(serviceName string) Service
}

func ApplicationContext

func ApplicationContext() AppContext

type ConnectableService

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

type EnvValue

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

func GetEnv

func GetEnv(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) 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

type LifecycleAware

type LifecycleAware interface {
	Service
	AfterStart()
	BeforeStop()
}

type Service

type Service interface {
	Init(serviceProvider func(serviceName string) Service)
	Name() string
	Dispose()
}

func ConnectServices

func ConnectServices(services ...string) Service

func ServiceArray

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

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 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