gitconfigrepo

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: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGitConfigRepo

func NewGitConfigRepo(localPath string, cloneOpts *git.CloneOptions) (configrepo.Repo, error)

NewGitConfigRepo instantiate a new GIT configuration repository

Types

type ErrorHandlerFn

type ErrorHandlerFn func(err error)

ErrorHandlerFn represent an error handler function

type GitConfigRepo

type GitConfigRepo struct {
	Apps map[string]*app
	// contains filtered or unexported fields
}

GitConfigRepo represent a git configuration repository

func (*GitConfigRepo) AddErrorListener

func (cr *GitConfigRepo) AddErrorListener(fn ErrorHandlerFn)

AddErrorListener add an error handler to the git repo

func (*GitConfigRepo) AddOnChangeHandler

func (cr *GitConfigRepo) AddOnChangeHandler(handler configrepo.OnChangeHandler)

AddOnChangeHandler add a new change handler to the git repo

func (*GitConfigRepo) Fetch

func (cr *GitConfigRepo) Fetch() error

Fetch fetch from the remote git repo

func (*GitConfigRepo) GetAppsVersions

func (cr *GitConfigRepo) GetAppsVersions() map[string][]*version.Version

GetAppsVersions returns a appName-> list of version

func (*GitConfigRepo) GetFile

func (cr *GitConfigRepo) GetFile(targetApp *configrepo.ApplicationVersion, path string) (*configrepo.RepoFile, error)

GetFile retrieve a file from the git repo

func (*GitConfigRepo) GetLastFetch

func (cr *GitConfigRepo) GetLastFetch() *time.Time

GetLastFetch return the last fetch date

func (*GitConfigRepo) GetNearestBranch

func (cr *GitConfigRepo) GetNearestBranch(targetApp *configrepo.ApplicationVersion) (*plumbing.Reference, error)

GetNearestBranch retrieve the nearest (<=) application version available on the git repo

func (*GitConfigRepo) Init

func (cr *GitConfigRepo) Init() (err error)

Init initialize the git repository

func (*GitConfigRepo) StartFetchingEvery

func (cr *GitConfigRepo) StartFetchingEvery(period time.Duration) error

StartFetchingEvery start auto fetch

func (*GitConfigRepo) StopFetching

func (cr *GitConfigRepo) StopFetching()

StopFetching stop auto fetch

Jump to

Keyboard shortcuts

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