module

package
v0.0.0-...-dc60fe5 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustConfigure

func MustConfigure(mod Module)

Types

type Base

type Base struct {
	Name            string
	IncludesInit    bool
	IncludesCleanup bool
	IncludesMain    bool
}

func (Base) Cleanup

func (m Base) Cleanup(_ context.Context)

func (*Base) Configure

func (m *Base) Configure() error

func (Base) GetName

func (m Base) GetName() string

func (Base) HasCleanup

func (m Base) HasCleanup() bool

func (Base) HasInit

func (m Base) HasInit() bool

func (Base) HasMain

func (m Base) HasMain() bool

func (Base) Init

func (m Base) Init(_ context.Context) error

func (Base) Main

func (m Base) Main(_ context.Context) error

type Configurable

type Configurable interface {
	Configure() error
}

type Module

type Module interface {
	GetName() string

	HasInit() bool
	HasCleanup() bool
	HasMain() bool

	Configure() error
	Init(ctx context.Context) error
	Main(ctx context.Context) error
	Cleanup(ctx context.Context)
}

type Task

type Task struct {
	Base
	// contains filtered or unexported fields
}

func NewTask

func NewTask(name string, task TaskFunc, interval time.Duration) *Task

func (*Task) Main

func (p *Task) Main(ctx context.Context) error

type TaskConfig

type TaskConfig struct {
	Name     string
	Task     TaskFunc
	Interval time.Duration
}

type TaskFunc

type TaskFunc = func()

type WithPeriodicTasks

type WithPeriodicTasks interface {
	PeriodicTasks() []*TaskConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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