updater

package
v0.0.0-...-1eec387 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoReleases = errors.New("no neco packages are released")
	ErrNoMembers  = errors.New("no boot servers are joined")
)

Retriable errors in neco-updater

Functions

This section is empty.

Types

type Action

type Action int

Action is the type for NextAction.

const (
	ActionError Action = iota
	ActionWaitInfo
	ActionReconfigure
	ActionNewVersion
	ActionWaitWorkers
	ActionStop
	ActionWaitClear
)

Actions.

func NextAction

func NextAction(ss *storage.Snapshot, timeout time.Duration) (Action, error)

NextAction decides the next action to do for neco-updater.

func (Action) String

func (a Action) String() string

type ReleaseChecker

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

ReleaseChecker checks newer GitHub releases by polling

func NewReleaseChecker

func NewReleaseChecker(st storage.Storage, leaderKey string, ghc *http.Client) ReleaseChecker

NewReleaseChecker returns a new ReleaseChecker

func (*ReleaseChecker) Run

func (c *ReleaseChecker) Run(ctx context.Context) error

Run periodically checks the new release of neco package at GitHub.

type ReleaseClient

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

ReleaseClient gets GitHub Releases

func NewReleaseClient

func NewReleaseClient(owner, repo string, http *http.Client) *ReleaseClient

NewReleaseClient returns ReleaseClient

func (ReleaseClient) GetLatestPublishedTag

func (c ReleaseClient) GetLatestPublishedTag(ctx context.Context) (string, error)

GetLatestPublishedTag returns latest published release/pre-release tag in GitHub Releases of neco repository

func (ReleaseClient) GetLatestReleaseTag

func (c ReleaseClient) GetLatestReleaseTag(ctx context.Context) (string, error)

GetLatestReleaseTag returns latest published release tag in GitHub Releases of neco repository

type Server

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

Server represents neco-updater server

func NewServer

func NewServer(session *concurrency.Session, storage storage.Storage, notifier ext.Notifier) Server

NewServer returns a Server

func (Server) Run

func (s Server) Run(ctx context.Context) error

Run runs neco-updater

Jump to

Keyboard shortcuts

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