provider

package
v0.0.0-...-d7e65e3 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: MPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateProviderConfig

func ValidateProviderConfig(provider config.Provider) error

ValidateProviderConfig calls the provider's validate functions depending upon the providers configured

Types

type DefaultRemoteProvider

type DefaultRemoteProvider struct {
	Provider     string
	PullInterval string
}

DefaultRemoteProvider holds basic providers data

func (*DefaultRemoteProvider) GetParsedPullInterval

func (rp *DefaultRemoteProvider) GetParsedPullInterval() (time.Duration, error)

GetParsedPullInterval returns the parsed duration

func (*DefaultRemoteProvider) GetPullInterval

func (rp *DefaultRemoteProvider) GetPullInterval() string

GetPullInterval returns the pullInterval assigned to remote provider

func (*DefaultRemoteProvider) SetPullInterval

func (rp *DefaultRemoteProvider) SetPullInterval(pullInterval string)

SetPullInterval sets the pullInterval

type GitProvider

type GitProvider struct {
	DefaultRemoteProvider `mapstructure:",squash"`
	Git                   config.Git `mapstructure:",squash"`
	// contains filtered or unexported fields
}

GitProvider holds the git provider config

func (*GitProvider) Fetch

func (gitProvider *GitProvider) Fetch(ctx context.Context) (*fetcher.Response, error)

Fetch downloads the config from the github repo

type RemoteProvider

type RemoteProvider interface {
	fetcher.Fetcher
	GetParsedPullInterval() (time.Duration, error)
	GetPullInterval() string
	SetPullInterval(string)
}

RemoteProvider is the interface to be implmented by the remote config providers

func CreateGitConfigProvider

func CreateGitConfigProvider(git *config.Git) (RemoteProvider, error)

CreateGitConfigProvider creates GitProvider from the git config

Jump to

Keyboard shortcuts

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