configrepo

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrApplicationNotFound = fmt.Errorf("application not found")

ErrApplicationNotFound returned if the requested application has not been found on the repo

View Source
var ErrFileNotFound = fmt.Errorf("file not found")

ErrFileNotFound returned if the file has not be found on the repo

Functions

This section is empty.

Types

type ApplicationVersion

type ApplicationVersion struct {
	AppName    string
	AppVersion string
}

ApplicationVersion represent the couple name+version

func NewApplicationVersion

func NewApplicationVersion(name, version string) *ApplicationVersion

NewApplicationVersion create a new ApplicationVersion (name+version) instance

type OnChangeHandler

type OnChangeHandler func(changedApplication ApplicationVersion)

OnChangeHandler function handler executed on every repo changes

type Repo

type Repo interface {
	Init() error
	GetAppsVersions() map[string][]*version.Version
	GetFile(app *ApplicationVersion, path string) (*RepoFile, error)
	Fetch() error
	GetLastFetch() *time.Time
	StartFetchingEvery(period time.Duration) error
	StopFetching()
	AddOnChangeHandler(handler OnChangeHandler)
}

Repo represent a config repository

type RepoFile

type RepoFile struct {
	Version string
	Content []byte
}

RepoFile represent a repository file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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