manager

package
v0.1.0-beta.202310111440 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	RootMod *modconfig.Mod

	RaftNodeID    string `json:"raft_node_id,omitempty"`
	RaftBootstrap bool   `json:"raft_bootstrap"`
	RaftAddress   string `json:"raft_address,omitempty"`

	HTTPSAddress string `json:"https_address,omitempty"`

	Status    string     `json:"status"`
	StartedAt *time.Time `json:"started_at,omitempty"`
	StoppedAt *time.Time `json:"stopped_at,omitempty"`
	// contains filtered or unexported fields
}

Manager manages and represents the status of the service.

func NewManager

func NewManager(ctx context.Context, opts ...ManagerOption) (*Manager, error)

NewManager creates a new Manager.

func (*Manager) CalculateTriggerUrl

func (m *Manager) CalculateTriggerUrl(trigger *modconfig.Trigger) (string, error)

func (*Manager) Initialize

func (m *Manager) Initialize() error

TODO: is there any point to have a separate "Initialize" and "Start"?

func (*Manager) InterruptHandler

func (m *Manager) InterruptHandler()

func (*Manager) ReloadPipelinesAndTriggers

func (m *Manager) ReloadPipelinesAndTriggers(pipelines map[string]*modconfig.Pipeline, triggers map[string]*modconfig.Trigger) error

func (*Manager) Start

func (m *Manager) Start() error

Start starts services managed by the Manager.

func (*Manager) Stop

func (m *Manager) Stop() error

Stop stops services managed by the Manager.

type ManagerOption

type ManagerOption func(*Manager) error

ManagerOption defines a type of function to configures the Manager.

func WithHTTPAddress

func WithHTTPAddress(addr string) ManagerOption

func WithRaftAddress

func WithRaftAddress(addr string) ManagerOption

func WithRaftBootstrap

func WithRaftBootstrap(bootstrap bool) ManagerOption

func WithRaftNodeID

func WithRaftNodeID(nodeID string) ManagerOption

Jump to

Keyboard shortcuts

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