initialization

package
v1.1.1-beta.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: MIT Imports: 16 Imported by: 0

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

func InitTracing

func InitTracing(name string, ctx context.Context, wg *sync.WaitGroup)

InitTracing initiates distributed tracing if enabled TODO: encapsulate in to ports and adapters

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

Jump to

Keyboard shortcuts

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