Documentation
¶
Index ¶
- func HooksMatches(hook api.Hook, githubHook github.Hook) bool
- func NewGithubHook(hook api.Hook) *github.Hook
- type HooksManager
- func (gh *HooksManager) DeleteHook(hook api.Hook) (bool, error)
- func (gh *HooksManager) ListHooksForOrganization(org string) ([]api.Hook, error)
- func (gh *HooksManager) ListHooksForRepository(repository api.GithubRepository) ([]api.Hook, error)
- func (gh *HooksManager) RegisterHook(hook api.Hook) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HooksMatches ¶
HooksMatches checks if the given GitHub hook is the same as the current OpenShift hook
func NewGithubHook ¶
NewGithubHook returns a GitHub representation of a hook GitHub hook refenrence: https://developer.github.com/v3/repos/hooks/#parameters
Types ¶
type HooksManager ¶
type HooksManager struct {
// contains filtered or unexported fields
}
HooksManager provides an easy way to manage GitHub hooks
func NewHooksManager ¶
func NewHooksManager(baseURL, token string, insecureSkipVerify bool) (*HooksManager, error)
NewHooksManager instantiates a HooksManager using the given GitHub base URL and access token (you can leave the baseURL empty to use the default api.github.com endpoint)
func (*HooksManager) DeleteHook ¶
func (gh *HooksManager) DeleteHook(hook api.Hook) (bool, error)
DeleteHook deletes the given hook returns true if the hook has been deleted
func (*HooksManager) ListHooksForOrganization ¶
func (gh *HooksManager) ListHooksForOrganization(org string) ([]api.Hook, error)
ListHooksForOrganization returns all the hooks for all the repositories in given github organization
func (*HooksManager) ListHooksForRepository ¶
func (gh *HooksManager) ListHooksForRepository(repository api.GithubRepository) ([]api.Hook, error)
ListHooksForRepository returns all the hooks for the given github repository
func (*HooksManager) RegisterHook ¶
func (gh *HooksManager) RegisterHook(hook api.Hook) (bool, error)
RegisterHook registers the given hook (only if the hook does not already exists) returns true if the hook has been created