Documentation
¶
Index ¶
- type Config
- type File
- type Git
- type GitHub
- func (g *GitHub) CreateFile(repo, path, msg string, usr *User, content []byte) (string, error)
- func (g *GitHub) DeleteDirectory(repo, msg string, dir interface{}, usr *User) error
- func (g *GitHub) DeleteFile(repo, path, sha, msg string, usr *User) (string, error)
- func (g *GitHub) GetArchiveLink(repo, tag string) (*url.URL, error)
- func (g *GitHub) GetContent(repo, path string) (*File, interface{}, error)
- func (g *GitHub) GetDiff(repo, user, sha string) (string, error)
- func (g *GitHub) TagExists(repo, tag string) (bool, error)
- func (g *GitHub) TagRepo(repo, tag string, usr *User) error
- func (g *GitHub) UntagRepo(repo, tag string) error
- func (g *GitHub) UpdateFile(repo, path, sha, msg string, usr *User, content []byte) (string, error)
- type GitLab
- func (g *GitLab) CreateFile(project, path, msg string, usr *User, content []byte) (string, error)
- func (g *GitLab) DeleteDirectory(project, msg string, dir interface{}, usr *User) error
- func (g *GitLab) DeleteFile(project, path, sha, msg string, usr *User) (string, error)
- func (g *GitLab) GetArchiveLink(project, tag string) (*url.URL, error)
- func (g *GitLab) GetContent(project, path string) (*File, interface{}, error)
- func (g *GitLab) GetDiff(project, user, sha string) (string, error)
- func (g *GitLab) TagExists(project, tag string) (bool, error)
- func (g *GitLab) TagRepo(project, tag string, usr *User) error
- func (g *GitLab) UntagRepo(project, tag string) error
- func (g *GitLab) UpdateFile(project, path, sha, msg string, usr *User, content []byte) (string, error)
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Organization string
Type string
ServerURL string
SSLNoVerify bool
Token string
}
Config represents the configuration of a git service
type Git ¶
type Git interface {
// GetContents retrieves file and/or directory contents from git
GetContent(string, string) (*File, interface{}, error)
// CreateFile creates a new repository file
CreateFile(string, string, string, *User, []byte) (string, error)
// UpdateFile updates a repository file
UpdateFile(string, string, string, string, *User, []byte) (string, error)
// DeleteFile deletes a repository file
DeleteFile(string, string, string, string, *User) (string, error)
// DeleteDirectory deletes a repository directory including all content
DeleteDirectory(string, string, interface{}, *User) error
// GetDiff returns the diff and committer details
GetDiff(string, string, string) (string, error)
// GetArchiveLink returns a download link for the repo/tag combo
GetArchiveLink(string, string) (*url.URL, error)
// TagRepo creates a new tag on a project
TagRepo(string, string, *User) error
// TagExists returns true if the tag exists
TagExists(string, string) (bool, error)
// UntagRepo removes a new tag from a project
UntagRepo(string, string) error
}
Git is an interface that must be implemented by any git service that can be used with Chef-Guard
func NewGitClient ¶
NewGitClient returns either a GitHub or GitLab client as Git interface
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
GitHub represents a GitHub client
func (*GitHub) CreateFile ¶
CreateFile implements the Git interface
func (*GitHub) DeleteDirectory ¶
DeleteDirectory implements the Git interface
func (*GitHub) DeleteFile ¶
DeleteFile implements the Git interface
func (*GitHub) GetArchiveLink ¶
GetArchiveLink implements the Git interface
func (*GitHub) GetContent ¶
GetContent implements the Git interface
type GitLab ¶
type GitLab struct {
// contains filtered or unexported fields
}
GitLab represents a GitLab client
func (*GitLab) CreateFile ¶
CreateFile implements the Git interface
func (*GitLab) DeleteDirectory ¶
DeleteDirectory implements the Git interface
func (*GitLab) DeleteFile ¶
DeleteFile implements the Git interface
func (*GitLab) GetArchiveLink ¶
GetArchiveLink implements the Git interface
func (*GitLab) GetContent ¶
GetContent implements the Git interface