Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicAuth ¶
type BasicAuth struct { Username string `river:"username,attr"` Password rivertypes.Secret `river:"password,attr"` }
func (*BasicAuth) Convert ¶
func (b *BasicAuth) Convert() (t transport.AuthMethod)
Convert converts our type to the native prometheus type
type DownloadFailedError ¶
DownloadFailedError represents a failure to download a repository.
func (DownloadFailedError) Error ¶
func (err DownloadFailedError) Error() string
Error returns the error string, denoting the failed repository.
func (DownloadFailedError) Unwrap ¶
func (err DownloadFailedError) Unwrap() error
Unwrap returns the inner error. It returns nil if there is no inner error.
type GitAuthConfig ¶
type GitAuthConfig struct { BasicAuth *BasicAuth `river:"basic_auth,block,optional"` SSHKey *SSHKey `river:"ssh_key,block,optional"` }
func (*GitAuthConfig) Convert ¶
func (h *GitAuthConfig) Convert() transport.AuthMethod
Convert converts HTTPClientConfig to the native Prometheus type. If h is nil, the default client config is returned.
type GitRepo ¶
type GitRepo struct {
// contains filtered or unexported fields
}
GitRepo manages a Git repository for the purposes of retrieving a file from it.
func NewGitRepo ¶
NewGitRepo creates a new instance of a GitRepo, where the Git repository is managed at storagePath.
If storagePath is empty on disk, NewGitRepo initializes GitRepo by cloning the repository. Otherwise, NewGitRepo will do a pull.
After GitRepo is initialized, it checks out to the Revision specified in GitRepoOptions.
func (*GitRepo) CurrentRevision ¶
CurrentRevision returns the current revision of the repository (by SHA).
func (*GitRepo) ReadDir ¶ added in v0.41.0
ReadDir returns info about the content of the directory in the repository.
type GitRepoOptions ¶
type GitRepoOptions struct { Repository string Revision string Auth GitAuthConfig }
type InvalidRevisionError ¶
type InvalidRevisionError struct {
Revision string
}
InvalidRevisionError represents an invalid revision.
func (InvalidRevisionError) Error ¶
func (err InvalidRevisionError) Error() string
Error returns the error string, denoting the invalid revision.
type SSHKey ¶
type SSHKey struct { Username string `river:"username,attr"` Key rivertypes.Secret `river:"key,attr,optional"` Keyfile string `river:"key_file,attr,optional"` Passphrase rivertypes.Secret `river:"passphrase,attr,optional"` }
type UpdateFailedError ¶
UpdateFailedError represents a failure to update a repository.
func (UpdateFailedError) Error ¶
func (err UpdateFailedError) Error() string
Error returns the error string, denoting the failed repository.
func (UpdateFailedError) Unwrap ¶
func (err UpdateFailedError) Unwrap() error
Unwrap returns the inner error. It returns nil if there is no inner error.