syncer

package
v0.0.0-...-74c5af0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrInvalidAPIInstance error indicates that no valid api instance was
	// provided to the syncer constructor.
	ErrInvalidAPIInstance = errors.New("invalid api instance")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	API               *api.API
	HostPackages      bool
	PackagesPath      string
	PackagesURL       string
	FlatcarUpdatesURL string
	CheckFrequency    time.Duration
}

Config represents the configuration used to create a new Syncer instance.

type Syncer

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

Syncer represents a process in charge of checking for updates in the different official Flatcar channels and updating the Flatcar application in Nebraska as needed (creating new packages and updating channels to point to them). When hostPackages is enabled, packages payloads will be downloaded into packagesPath and package url/filename will be rewritten.

func New

func New(conf *Config) (*Syncer, error)

New creates a new Syncer instance.

func Setup

func Setup(conf *config.Config, db *api.API) (*Syncer, error)

Setup creates a new syncer from config and db connection, and returns it.

func (*Syncer) Start

func (s *Syncer) Start()

Start makes the syncer start working. It will check for updates every checkFrequency until it's asked to stop.

func (*Syncer) Stop

func (s *Syncer) Stop()

Stop stops the polling for updates.

Jump to

Keyboard shortcuts

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