controler

package
v0.1.44 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Control

type Control struct {
	Drain     *Drain    `validate:"omitempty,dive" json:"drain,omitempty"`
	Upgrade   *Upgrade  `validate:"omitempty,dive" json:"upgrade,omitempty"`
	Start     *Start    `validate:"omitempty,dive" json:"start,omitempty"`
	Timestamp time.Time `json:"timestamp,omitempty"`
}

func New

func New() *Control

func (*Control) Apply

func (c *Control) Apply(ctx context.Context, client *clientv3.Client) error

func (*Control) GetDrain

func (c *Control) GetDrain() *Drain

func (*Control) GetStart

func (c *Control) GetStart() *Start

func (*Control) GetUpgrade

func (c *Control) GetUpgrade() *Upgrade

func (*Control) SetDrain

func (c *Control) SetDrain(drain *Drain)

func (*Control) SetStart

func (c *Control) SetStart(start *Start)

func (*Control) SetUpgrade

func (c *Control) SetUpgrade(upgrade *Upgrade)

func (*Control) Time

func (c *Control) Time()

func (*Control) ToJSON

func (c *Control) ToJSON() ([]byte, error)

func (*Control) Validate

func (c *Control) Validate() (bool, error)

type Drain

type Drain struct {
	NodeID uint64 `validate:"required" json:"node_id"`
}

func NewDrain

func NewDrain(nodeID uint64) *Drain

type Start

type Start struct {
	NodeAPI string `validate:"required" json:"node_api"`
	Overlay string `validate:"required" json:"overlay"`
	Backend string `validate:"required" json:"backend"`
}

func NewStart

func NewStart(nodeAPI string, overlay string, backend string) *Start

type Upgrade

type Upgrade struct {
	Image string `validate:"required" json:"image"`
	Tag   string `validate:"required" json:"tag"`
}

func NewUpgrade

func NewUpgrade(image string, tag string) *Upgrade

Jump to

Keyboard shortcuts

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