Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetConfig ¶
func GetConfig(configLoader ports.ConfigLoader) *model.ServiceUnitConfig
GetConfig parses service-unit config via given formant
func InitLogging ¶
func InitLogging()
Types ¶
type ServiceUnit ¶
type ServiceUnit struct { Name string Config *model.ServiceUnitConfig // ServerAdapters hold the adapters for server processes from REST, gRPC ServerAdapters map[string]primary.PrimaryPort // ConsumerAdapters hold the adapters for consumer processes from Kafka, RabbitMQ, Pular, etc ConsumerAdapters map[string]primary.PrimaryPort // SecondaryAdapterClients hold the persistent clients for secondary adapters SecondaryAdapterClients map[string]secondary.SecondaryAdapterClient }
func NewServiceUnit ¶
func NewServiceUnit(serviceUnitConfig *model.ServiceUnitConfig) ServiceUnit
NewServiceUnit initializes service unit object
func (*ServiceUnit) Close ¶ added in v1.0.10
func (su *ServiceUnit) Close()
Close closes all secondary adapter client connections
func (*ServiceUnit) Setup ¶
func (su *ServiceUnit) Setup()
Setup prepares primary adapters and maps secondary adapters to them
func (*ServiceUnit) Start ¶
func (su *ServiceUnit) Start(shutdownNotification context.Context, shutdownWaitGroup, readyWaitGroup *sync.WaitGroup, errChan chan primary.PrimaryPortError)
Start primary adapters. it propagates context to primary adapters
Click to show internal directories.
Click to hide internal directories.