Documentation ¶
Index ¶
- Constants
- type Client
- func (githubClient Client) CreateHook(owner, repo string) (hookID *int, err error)
- func (githubClient Client) CreateStatus(owner, repo, ref, context, description, state string) error
- func (githubClient Client) DeleteHook(owner, repo string, hookID int) error
- func (githubClient Client) DownloadProjectContent(owner, repo, ref string) (string, error)
- func (githubClient Client) GetFileContent(owner, repo, path, ref string) ([]byte, error)
- func (githubClient Client) GetFileSHA(owner, repo, path, ref string) (string, error)
- func (githubClient Client) GetOrganizations() (organizations []github.Organization, err error)
- func (githubClient Client) GetRepositories() (repositories []github.Repository, err error)
- func (githubClient Client) GetUser() (user *github.User, err error)
- type Config
- type Event
- type EventPull
- type EventPush
- type ExtendedWebHookPayload
- type FixRepository
- type Manager
Constants ¶
const ( // EventTypePull is a contant for Pull Request event type EventTypePull string = "pull" // EventTypePush is a contant for Push event type EventTypePush string = "push" // EventTypeTag is a contant for Tag event type EventTypeTag string = "tag" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client type.
func (Client) CreateHook ¶
CreateHook to create a hook on a repository.
func (Client) CreateStatus ¶
CreateStatus creates a new status for a repository at the specified reference. The reference can be a SHA, a branch name, or a tag name.
func (Client) DeleteHook ¶
DeleteHook to remove a hook on a repository.
func (Client) DownloadProjectContent ¶
DownloadProjectContent to download a whole repository with a specific reference (SHA).
func (Client) GetFileContent ¶
GetFileContent to download a file from a user's repository.
func (Client) GetFileSHA ¶
GetFileSHA to get the file SHA.
func (Client) GetOrganizations ¶
func (githubClient Client) GetOrganizations() (organizations []github.Organization, err error)
GetOrganizations to retrieve the user's organizations.
func (Client) GetRepositories ¶
func (githubClient Client) GetRepositories() (repositories []github.Repository, err error)
GetRepositories to retrieve the user's repositories.
type Event ¶
type Event struct { Type string Branch string Organization string Repository string CloneURL string SSHURL string SHA string Push *EventPush Pull *EventPull }
Event type.
func ParseEvent ¶
ParseEvent to parse a GitHub event.
func ParsePullEvent ¶
ParsePullEvent to parse a pull request event.
type ExtendedWebHookPayload ¶
type ExtendedWebHookPayload struct { BaseRef *string `json:"base_ref,omitempty"` Repo *FixRepository `json:"repository,omitempty"` github.WebHookPayload }
ExtendedWebHookPayload type.
type FixRepository ¶
type FixRepository struct { Owner *github.User `json:"owner,omitempty"` Name *string `json:"name,omitempty"` CloneURL *string `json:"clone_url,omitempty"` SSHURL *string `json:"ssh_url,omitempty"` }
FixRepository type.
See issue: https://github.com/google/go-github/issues/131
type Manager ¶
type Manager struct {
Config *Config
}
Manager type. Manager to use GitHub API.
func NewManager ¶
NewManager is the constructor for a GitHug Manager.