lifecycle

package
v0.35.2 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DetectLifecycle

func DetectLifecycle(srcDir string) bool

Types

type FunctionHook

type FunctionHook struct {
	// contains filtered or unexported fields
}

func (*FunctionHook) OnShutdown

func (f *FunctionHook) OnShutdown() error

func (*FunctionHook) OnStartup

func (f *FunctionHook) OnStartup() error

type Lifecycle

type Lifecycle struct {
	// contains filtered or unexported fields
}

func NewLifecycle

func NewLifecycle() *Lifecycle

func (*Lifecycle) ExecuteShutdown

func (l *Lifecycle) ExecuteShutdown() error

func (*Lifecycle) ExecuteStartup

func (l *Lifecycle) ExecuteStartup() error

func (*Lifecycle) Register

func (l *Lifecycle) Register(hook LifecycleHook) *Lifecycle

func (*Lifecycle) SetShutdownTimeout

func (l *Lifecycle) SetShutdownTimeout(d time.Duration) *Lifecycle

func (*Lifecycle) SetStartupTimeout

func (l *Lifecycle) SetStartupTimeout(d time.Duration) *Lifecycle

type LifecycleHook

type LifecycleHook interface {
	OnStartup() error
	OnShutdown() error
}

func LoadFromDir

func LoadFromDir(srcDir string) (LifecycleHook, error)

func LoadFromPlugin

func LoadFromPlugin(pluginPath string) (LifecycleHook, error)

Jump to

Keyboard shortcuts

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