app

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conf

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

Configuration

func NewConf

func NewConf() Conf

Create a new configuration from env variables

func (Conf) AddHooks

func (conf Conf) AddHooks()

Add default hooks

func (Conf) AddUserHooks

func (conf Conf) AddUserHooks(name string, env string)

Add a new hook to the configuration

func (Conf) Log

func (conf Conf) Log()

Log the configuration

func (Conf) Oneshot

func (conf Conf) Oneshot() bool

Return true if Oneshot is set

func (Conf) RunExitHook

func (conf Conf) RunExitHook(ctx context.Context, name string)

Run an exit hook

func (Conf) RunExitHooks

func (conf Conf) RunExitHooks(ctx context.Context)

Run exit hooks

func (Conf) RunInitHook

func (conf Conf) RunInitHook(ctx context.Context, name string)

Run an init hook

func (Conf) RunInitHooks

func (conf Conf) RunInitHooks(ctx context.Context)

Run init hooks

type Hook

type Hook interface {
	String() []string
	RunInit(context.Context) error
	RunExit(context.Context) error
}

init & exit hooks iface

type HookMulti

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

init & exit hooks

func NewIPRouteHooks

func NewIPRouteHooks(nameInit string, envInit string, nameExit string, envExit string) HookMulti

Create init & exit hooks

func NewUserHooks

func NewUserHooks(nameInit string, envInit string, nameExit string, envExit string) HookMulti

Create init & exit hooks

func (HookMulti) RunExit

func (hooks HookMulti) RunExit(ctx context.Context) error

Runs exit hook

func (HookMulti) RunInit

func (hooks HookMulti) RunInit(ctx context.Context) error

Runs init hook

func (HookMulti) String

func (hooks HookMulti) String() []string

Returns hooks info

type HookSingle

type HookSingle interface {
	String() []string
	Run(context.Context) error
}

init or exit hook iface

type IPRouteHook

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

IP Route Hook

func NewIPRouteHook

func NewIPRouteHook(name string, env string) IPRouteHook

Create an IP Route Hook

func (IPRouteHook) Run

func (hook IPRouteHook) Run(ctx context.Context) error

Run the hook if it is set

func (IPRouteHook) String

func (hook IPRouteHook) String() []string

Returns hook information in an human format

type Nat4Hook

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

IPv4 NAT Hook

func NewNat4Hooks

func NewNat4Hooks() Nat4Hook

Creates a new IPv4 NAT Hook

func (Nat4Hook) RunExit

func (hook Nat4Hook) RunExit(ctx context.Context) error

Runs IPv4 NAT exit hook

func (Nat4Hook) RunInit

func (hook Nat4Hook) RunInit(ctx context.Context) error

Runs IPv4 NAT init hook

func (Nat4Hook) String

func (hook Nat4Hook) String() []string

Returns IPv4 NAT hook infos

type UserHook

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

Hook

func NewUserHook

func NewUserHook(name string, env string) UserHook

Creates a new Hook from environment variables

func (UserHook) Run

func (hook UserHook) Run(ctx context.Context) error

Run the hook if it is set

func (UserHook) String

func (hook UserHook) String() []string

Returns hook information in an human format

Jump to

Keyboard shortcuts

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