Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(i Implementation)
Register adds a type to the list of supported Git implementations.
Types ¶
type Credentials ¶
type Credentials struct {
Token string
}
Credentials holds the authentication information for the API. Most of the times this is just a token.
type Implementation ¶
type Implementation interface {
// IsType returns true, if the given URL is handleable by the given implementation (Github,Gitlab, etc.)
IsType(URL *url.URL) (bool, error)
// New returns a clean new Repo implementation with the given URL
New(options RepoOptions) (Repo, error)
}
Implementation is a set of functions needed to get the right git implementation for the given URL.
type Repo ¶
type Repo interface {
// Type returns the type of the repo
Type() string
// FullURL returns the full url to the repository for ssh pulling
FullURL() *url.URL
Create() error
// Update will enforce the defined keys to be deployed to the repository, it will return true if an actual change
// happened
Update() (bool, error)
// Read will read the repository and populate it with the deployed keys. It will throw an
// error if the repo is not found on the server.
Read() error
Delete() error
Connect() error
// CommitTemplateFiles uploads given files to the repository
CommitTemplateFiles() error
}
Repo represents a repository that lives on some git server
func NewRepo ¶
func NewRepo(opts RepoOptions) (Repo, error)
NewRepo returns a Repo object that can handle the specific URL
type RepoOptions ¶
type RepoOptions struct {
Credentials Credentials
DeployKeys map[string]synv1alpha1.DeployKey
Logger logr.Logger
URL *url.URL
Path string
RepoName string
DisplayName string
TemplateFiles map[string]string
}
RepoOptions hold the options for creating a repository. The credentials are required to work. The deploykeys are optional but desired.
Click to show internal directories.
Click to hide internal directories.