tasks

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2025 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const UserAgent = "go-github-nextmn-srv6"

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerRegistryTask added in v0.0.12

type ControllerRegistryTask struct {
	WithName
	WithState
	ControllerRegistry *ctrl.ControllerRegistry
	SetupRegistry      app_api.Registry
	// contains filtered or unexported fields
}

ControllerRegistry registers and unregisters into controller

func NewControllerRegistryTask added in v0.0.12

func NewControllerRegistryTask(name string, remoteControlURI jsonapi.ControlURI, backbone n4tosrv6.BackboneIP, locator n4tosrv6.Locator, localControlURI jsonapi.ControlURI, setup_registry app_api.Registry) *ControllerRegistryTask

Create a new ControllerRegistry

func (*ControllerRegistryTask) RunExit added in v0.0.12

func (t *ControllerRegistryTask) RunExit() error

Exit

func (*ControllerRegistryTask) RunInit added in v0.0.12

func (t *ControllerRegistryTask) RunInit(ctx context.Context) error

Init

type DBTask added in v0.0.12

type DBTask struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

DBTask initializes the database

func NewDBTask added in v0.0.12

func NewDBTask(name string, registry app_api.Registry) *DBTask

Create a new DBTask

func (*DBTask) RunExit added in v0.0.12

func (db *DBTask) RunExit() error

Exit

func (*DBTask) RunInit added in v0.0.12

func (db *DBTask) RunInit(ctx context.Context) error

Init

type FakeTask

type FakeTask struct {
	WithName
	WithState
}

FakeTask is a dummy task that do nothing

func NewFakeTask

func NewFakeTask(name string) *FakeTask

Create a new FakeTask

func (*FakeTask) RunExit

func (t *FakeTask) RunExit() error

Exit

func (*FakeTask) RunInit

func (t *FakeTask) RunInit(ctx context.Context) error

Init

type HookMulti

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

HookMulti is a Task that runs 2 SingleHook

func NewMultiHook

func NewMultiHook(init_name string, init *string, exit_name string, exit *string) *HookMulti

Creates a new MultiHook

func (*HookMulti) NameBase added in v0.0.12

func (h *HookMulti) NameBase() string

func (*HookMulti) NameExit added in v0.0.12

func (h *HookMulti) NameExit() string

func (*HookMulti) NameInit added in v0.0.12

func (h *HookMulti) NameInit() string

func (*HookMulti) RunExit

func (h *HookMulti) RunExit() error

Exit function

func (*HookMulti) RunInit

func (h *HookMulti) RunInit(ctx context.Context) error

Init function

type HttpServerTask added in v0.0.11

type HttpServerTask struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

HttpServerTask starts an http server

func NewHttpServerTask added in v0.0.11

func NewHttpServerTask(name string, httpAddr netip.AddrPort, setupRegistry app_api.Registry) *HttpServerTask

Create a new HttpServerTask

func (*HttpServerTask) RunExit added in v0.0.11

func (t *HttpServerTask) RunExit() error

Exit

func (*HttpServerTask) RunInit added in v0.0.11

func (t *HttpServerTask) RunInit(ctx context.Context) error

Init

type Registry added in v0.0.12

type Registry struct {
	Tasks []tasks_api.Task
	// contains filtered or unexported fields
}

func NewRegistry added in v0.0.12

func NewRegistry() *Registry

func (*Registry) Register added in v0.0.12

func (r *Registry) Register(task tasks_api.Task)

Register a new task

func (*Registry) Run added in v0.0.13

func (r *Registry) Run(ctx context.Context) error

func (*Registry) RunExit added in v0.0.12

func (r *Registry) RunExit()

Run exit tasks

func (*Registry) RunInit added in v0.0.12

func (r *Registry) RunInit(ctx context.Context) error

Run init tasks

type SingleHook

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

HookSingle

func NewSingleHook

func NewSingleHook(name string, cmd *string) SingleHook

Creates a new SingleHook

func (SingleHook) Name added in v0.0.12

func (h SingleHook) Name() string

func (SingleHook) Run

func (h SingleHook) Run() error

Runs the command of the SingleHook

type TaskBlackhole

type TaskBlackhole struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskBlackhole

func NewTaskBlackhole

func NewTaskBlackhole(name string, table_name string) *TaskBlackhole

Create a new TaskBlackhole

func (*TaskBlackhole) RunExit

func (t *TaskBlackhole) RunExit() error

Delete blackhole

func (*TaskBlackhole) RunInit

func (t *TaskBlackhole) RunInit(ctx context.Context) error

Create blackhole

type TaskDummyIface

type TaskDummyIface struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskDummyIface

func NewTaskDummyIface

func NewTaskDummyIface(name string, iface_name string) *TaskDummyIface

Create a new Task for DummyIface

func (*TaskDummyIface) RunExit

func (t *TaskDummyIface) RunExit() error

Delete the Iface

func (*TaskDummyIface) RunInit

func (t *TaskDummyIface) RunInit(ctx context.Context) error

Create and set up the Iface

type TaskIPRule

type TaskIPRule struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskIPRule

func NewTaskIP4Rule

func NewTaskIP4Rule(name string, prefix netip.Prefix, table_name string) *TaskIPRule

Create a new Task for IPRule

func NewTaskIP6Rule

func NewTaskIP6Rule(name string, prefix netip.Prefix, table_name string) *TaskIPRule

Create a new Task for IPRule

func (*TaskIPRule) RunExit

func (t *TaskIPRule) RunExit() error

Delete ip rules

func (*TaskIPRule) RunInit

func (t *TaskIPRule) RunInit(ctx context.Context) error

Setup ip rules

type TaskLinuxEndpoint

type TaskLinuxEndpoint struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskLinuxEndpoint creates a new linux endpoint

func NewTaskLinuxEndpoint

func NewTaskLinuxEndpoint(name string, endpoint *config.Endpoint, table_name string, iface_name string) *TaskLinuxEndpoint

Create a new TaskLinuxEndpoint

func (*TaskLinuxEndpoint) RunExit

func (t *TaskLinuxEndpoint) RunExit() error

Exit

func (*TaskLinuxEndpoint) RunInit

func (t *TaskLinuxEndpoint) RunInit(ctx context.Context) error

Init

type TaskLinuxHeadend

type TaskLinuxHeadend struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskLinuxHeadend creates a new linux headend

func NewTaskLinuxHeadend

func NewTaskLinuxHeadend(name string, headend *config.Headend, table_name string, iface_name string) *TaskLinuxHeadend

Create a new TaskLinuxHeadend

func (*TaskLinuxHeadend) RunExit

func (t *TaskLinuxHeadend) RunExit() error

Exit

func (*TaskLinuxHeadend) RunInit

func (t *TaskLinuxHeadend) RunInit(ctx context.Context) error

Init

type TaskLinuxHeadendSetSourceAddress

type TaskLinuxHeadendSetSourceAddress struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskLinuxHeadendSetSourceAddress

func NewTaskLinuxHeadendSetSourceAddress

func NewTaskLinuxHeadendSetSourceAddress(name string, address netip.Addr) *TaskLinuxHeadendSetSourceAddress

Create a new TaskLinuxHeadendSetSourceAddress

func (*TaskLinuxHeadendSetSourceAddress) RunExit

Exit

func (*TaskLinuxHeadendSetSourceAddress) RunInit

Init

type TaskNextMNEndpoint

type TaskNextMNEndpoint struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskNextMNEndpoint creates a new endpoint

func NewTaskNextMNEndpoint

func NewTaskNextMNEndpoint(name string, endpoint *config.Endpoint, table_name string, iface_name string, registry app_api.Registry) *TaskNextMNEndpoint

Create a new TaskNextMNEndpoint

func (*TaskNextMNEndpoint) RunExit

func (t *TaskNextMNEndpoint) RunExit() error

Exit

func (*TaskNextMNEndpoint) RunInit

func (t *TaskNextMNEndpoint) RunInit(ctx context.Context) error

Init

type TaskNextMNHeadend

type TaskNextMNHeadend struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskNextMNHeadend creates a new headend

func NewTaskNextMNHeadend

func NewTaskNextMNHeadend(name string, headend *config.Headend, table_name string, iface_name string, registry app_api.Registry) *TaskNextMNHeadend

Create a new TaskNextMNHeadend

func (*TaskNextMNHeadend) RunExit

func (t *TaskNextMNHeadend) RunExit() error

Exit

func (*TaskNextMNHeadend) RunInit

func (t *TaskNextMNHeadend) RunInit(ctx context.Context) error

Init

type TaskNextMNHeadendWithCtrl added in v0.0.12

type TaskNextMNHeadendWithCtrl struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskNextMNHeadend creates a new headend

func NewTaskNextMNHeadendWithCtrl added in v0.0.12

func NewTaskNextMNHeadendWithCtrl(name string, headend *config.Headend, table_name string, iface_name string, registry app_api.Registry) *TaskNextMNHeadendWithCtrl

Create a new TaskNextMNHeadend

func (*TaskNextMNHeadendWithCtrl) RunExit added in v0.0.12

func (t *TaskNextMNHeadendWithCtrl) RunExit() error

Exit

func (*TaskNextMNHeadendWithCtrl) RunInit added in v0.0.12

Init

type TaskTunIface

type TaskTunIface struct {
	WithName
	WithState
	// contains filtered or unexported fields
}

TaskTunIface

func NewTaskTunIface

func NewTaskTunIface(name string, iface_name string, registry app_api.Registry) *TaskTunIface

Create a new Task for TunIface

func (*TaskTunIface) RunExit

func (t *TaskTunIface) RunExit() error

Delete the Iface

func (*TaskTunIface) RunInit

func (t *TaskTunIface) RunInit(ctx context.Context) error

Create and set up the Iface

type WithName added in v0.0.12

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

func NewName added in v0.0.12

func NewName(name string) WithName

func (*WithName) NameBase added in v0.0.12

func (wn *WithName) NameBase() string

func (*WithName) NameExit added in v0.0.12

func (wn *WithName) NameExit() string

func (*WithName) NameInit added in v0.0.12

func (wn *WithName) NameInit() string

type WithState

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

func NewState

func NewState() WithState

func (*WithState) State

func (ws *WithState) State() bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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