provider

package
v0.0.0-...-8ea441c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGithub

func NewGithub(name string, config ast.Node) kagami.Provider

NewGithub creates a new github instance

Types

type Github

type Github struct {
	provider.GitConfig
	// contains filtered or unexported fields
}

Github is the github provider and uses deploy keys as credentials TODO: we could provide just wrap the normal git provider

func (*Github) Name

func (gh *Github) Name() string

Name is the name of the provider

func (*Github) Pull

func (gh *Github) Pull(repo *kagami.Repository, path string) error

Pull pulls a repo from github locally

func (*Github) Push

func (gh *Github) Push(repo *kagami.Repository, path string) error

Push pushes a repo to a remote target

func (*Github) ServeHTTP

func (gh *Github) ServeHTTP(w http.ResponseWriter, req *http.Request)

Handle takes care of github webhooks

func (*Github) Type

func (gh *Github) Type() string

Type is the type of the provider

type GithubPushPayload

type GithubPushPayload struct {
	HeadCommit struct {
		ID string `json:"id"`
	} `json:"head_commit"`
	Repository struct {
		Name     string `json:"name"`
		FullName string `json:"full_name"`
		SSHURL   string `json:"ssh_url"`
	} `json:"repository"`
}

GithubPushPayload represents a push payload from a github webhook, at least the field that we actually care about: https://developer.github.com/v3/activity/events/types/#pushevent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL