lifecycle

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceLifecycleFinisher

type ServiceLifecycleFinisher interface {
	// OnFinish is the method called before the service is finished by the framework.
	OnFinish(ctx context.Context)
}

ServiceLifecycleFinisher is an optional behavior that a service can have to receive notifications when the service is finishing.

type ServiceLifecycleStarter

type ServiceLifecycleStarter interface {
	// OnStart is a method called right before the service enters its infinite
	// execution mode, when Service.Start API is called, before database migrations
	// and service structure fields validation.
	//
	// It is also the right place for the service to initialize something that
	// requires accessing the framework.Service API or initialize specific fields
	// in its main structure.
	OnStart(ctx context.Context) error
}

ServiceLifecycleStarter is an optional behavior that a service can have to receive notifications when the service is initializing.

Jump to

Keyboard shortcuts

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