Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Commit ¶
type Commit struct {
ID string `json:"id"`
Added []string `json:"added"`
Modified []string `json:"modified"`
}
Commit is a commit received from Github webhook
type FileService ¶
type FileService struct {
GitHub GitHubClient
Logger logrus.FieldLogger
// contains filtered or unexported fields
}
FileService is for working with repositories
func (*FileService) DecodeURL ¶
func (f *FileService) DecodeURL(url string) (org, repo, path, branch string)
DecodeURL takes a url and returns the org, repo, path and branch
func (*FileService) Download ¶
func (f *FileService) Download(org, repo, path, branch string) (string, error)
Download a file from github note that "path" is the full path relative to the repo root eg: src/foo/bar/filename
func (*FileService) EncodeURL ¶
func (f *FileService) EncodeURL(org, repo, path, branch string) string
EncodeURL returns the git url for a given org, repo, path and branch
type GitHub ¶
func (*GitHub) CreateStatus ¶
func (*GitHub) DownloadContents ¶
func (*GitHub) GetEndpoint ¶
type GitHubClient ¶
type Push ¶
type Push struct {
Commits []Commit `json:"commits"`
Repository Repository `json:"repository"`
Ref string `json:"ref"`
GitHub GitHub
DeckBaseURL string
Logger logrus.FieldLogger
}
Push is the payload received from a GitHub webhook.
func (*Push) ContainsFile ¶
ContainsFile checks to see if a given file is in the push.
func (*Push) SetCommitStatus ¶
SetCommitStatus sets the commit status TODO: this function needs to return an error but it's currently attached to an interface that does not and changes will affect other types
type Repository ¶
type Repository struct {
Name string `json:"name"`
Organization string `json:"organization"`
Owner RepositoryOwner `json:"owner"`
}
Repository is a repo received from Github webhook
type RepositoryOwner ¶
type RepositoryOwner struct {
Login string `json:"login"`
}