resource

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPMClient

func NewPMClient(ctx context.Context) (api.API, error)

Create a new PM client, auto-starting the PM daemon if necessary.

Do not use this function directly, with the PM addon registered, this will be registered as a resource context value provider, fetch the existing client from the resource context.

Types

type PM

type PM struct {
	Name          string
	Config        func(context.Context) (*api.Child, error)
	LimitRestarts bool
	WaitOnStart   bool
}

func PMDynamic

func PMDynamic(name string, config func(context.Context) (*api.Child, error)) *PM

func PMStatic

func PMStatic(config api.Child) *PM

func PMStaticInfra

func PMStaticInfra(config api.Child) *PM

func (*PM) ID

func (p *PM) ID() string

ID implements Resource.

func (*PM) Ready

func (p *PM) Ready(ctx context.Context) (bool, error)

Ready implements Resource

func (*PM) Start

func (p *PM) Start(ctx context.Context) error

Start implements Resource.

func (*PM) Stop

func (p *PM) Stop(ctx context.Context) error

Stop implements Resource.

func (*PM) WithWaitOnStart

func (p *PM) WithWaitOnStart() *PM

Jump to

Keyboard shortcuts

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