lifecycler

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CaddyfileInfo

type CaddyfileInfo struct {
	ModuleID           string // module.id.path. with dot at end if required
	Raw                *[]json.RawMessage
	SubModuleSpecifier string
	ParseVerbLine      caddyfile.Unmarshaler
}

type LifeCyclable

type LifeCyclable[T any] interface {
	caddy.Module
	Start(T) error
}

type LifeCycler

type LifeCycler[T any] struct {
	V       T
	Modules []LifeCyclable[T]
	Started []LifeCyclable[T]
}

func (*LifeCycler[T]) Cleanup added in v0.0.3

func (l *LifeCycler[T]) Cleanup() (err error)

func (*LifeCycler[T]) MarshalJSON

func (*LifeCycler[T]) MarshalJSON() ([]byte, error)

func (*LifeCycler[T]) Provision

func (l *LifeCycler[T]) Provision(ctx caddy.Context, info *ProvisionInfo) error

func (*LifeCycler[T]) SetValue

func (l *LifeCycler[T]) SetValue(v T)

func (*LifeCycler[T]) Start

func (l *LifeCycler[T]) Start() error

func (*LifeCycler[T]) UnmarshalCaddyfile

func (l *LifeCycler[T]) UnmarshalCaddyfile(d *caddyfile.Dispenser, info *CaddyfileInfo) error

UnmarshalCaddyfile unmarshals a module from a caddyfile.

{
  <verb> [rest of line] {
    <submodule name> <submodule config>
  }
}

func (*LifeCycler[T]) UnmarshalJSON

func (*LifeCycler[T]) UnmarshalJSON([]byte) error

type ProvisionInfo

type ProvisionInfo struct {
	StructPointer any
	FieldName     string
	Raw           *[]json.RawMessage
}

Jump to

Keyboard shortcuts

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