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"`
}
type DownloadFailedError ¶
type DownloadFailedError struct {
Repository string
Inner error
}
DownloadFailedError represents a failure to download a repository.
type GitAuthConfig ¶
type GitAuthConfig struct {
BasicAuth *BasicAuth `river:"basic_auth,block,optional"`
SSHKey *SSHKey `river:"ssh_key,block,optional"`
}
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 ¶
func NewGitRepo(ctx context.Context, storagePath string, opts GitRepoOptions) (*GitRepo, error)
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 fetch.
After GitRepo is initialized, it checks out to the Revision specified in GitRepoOptions.
func (*GitRepo) CurrentRevision ¶
func (repo *GitRepo) CurrentRevision() (string, error)
CurrentRevision returns the current revision of the repository (by SHA).
type GitRepoOptions ¶
type GitRepoOptions struct {
Repository string
Revision string
Auth GitAuthConfig
}
type InvalidRevisionError ¶
type InvalidRevisionError struct {
Revision string
}
InvalidRevisionError represents an 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 ¶
type UpdateFailedError struct {
Repository string
Inner error
}
UpdateFailedError represents a failure to update a repository.