stack

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddInfrastructure

func AddInfrastructure(svc service.Service)

func AddPreStartHook

func AddPreStartHook(fn func() PreStartHook)

func AddPreStartHookType

func AddPreStartHookType[T any, P interface {
	*T
	PreStartHook
}]()

func AddService

func AddService(svc service.Service)

func AllInfrastructure

func AllInfrastructure() []service.Service

func AllServices

func AllServices() []service.Service

func ServiceByName

func ServiceByName(name string) service.Service

ServiceByName returns the service with the given name, if it exists.

If the service does not exist, it returns nil.

func Start

func Start(ctx context.Context, opts ...any) error

Start starts the stack with the given options.

Options must be of type service.ContextOption or resource.ContextOption, and will be passed to service.NewContext and resource.NewContext respectively.

func StartServices

func StartServices(ctx context.Context, kind string, svcs ...service.Service) error

func Stop

func Stop(
	ctx context.Context,
	includeInfrastructure bool,
	exclude []string,
) error

TODO: make progress printing pluggable

func StopServices

func StopServices(ctx context.Context, svcs ...service.Service) error

Types

type PreStartHook

type PreStartHook interface {
	Name() string
	BeforeServices(ctx context.Context, infra, svcs []service.Service) error
	Service(context.Context, service.Service) error
	AfterServices(ctx context.Context, infra, svcs []service.Service) error
}

func PreStartHookFuncs

func PreStartHookFuncs(
	name string,
	beforeServices func(ctx context.Context, infra, svcs []service.Service) error,
	service func(ctx context.Context, svc service.Service) error,
	afterServices func(ctx context.Context, infra, svcs []service.Service) error,
) PreStartHook

Jump to

Keyboard shortcuts

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