Documentation
¶
Index ¶
- Constants
- Variables
- func Init() error
- func Logger() *log.Logger
- func SetLogger(l *log.Logger)
- func SetOS(os gitos.OS)
- func Setup(c *setup.Controller) (middleware.Middleware, error)
- func Start(repo *Repo)
- type BitbucketHook
- type GenericHook
- type Git
- type GithubHook
- type GitlabHook
- type Repo
- type Then
- type WebHook
Constants ¶
View Source
const ( // DefaultInterval is the minimum interval to delay before // requesting another git pull DefaultInterval time.Duration = time.Hour * 1 )
Variables ¶
View Source
var ( // Services holds all git pulling services and provides the function to // stop them. Services = &services{} )
Functions ¶
func Init ¶
func Init() error
Init validates git installation, locates the git executable binary in PATH and check for available shell to use.
func SetOS ¶
SetOS sets the OS to be used. Intended to be used for tests to abstract OS level git actions.
func Setup ¶
func Setup(c *setup.Controller) (middleware.Middleware, error)
Git configures a new Git service routine.
Types ¶
type BitbucketHook ¶
type BitbucketHook struct{}
func (BitbucketHook) DoesHandle ¶
func (b BitbucketHook) DoesHandle(h http.Header) bool
func (BitbucketHook) Handle ¶
func (b BitbucketHook) Handle(w http.ResponseWriter, r *http.Request, repo *Repo) (int, error)
type GenericHook ¶
type GenericHook struct{}
func (GenericHook) DoesHandle ¶
func (g GenericHook) DoesHandle(h http.Header) bool
func (GenericHook) Handle ¶
func (g GenericHook) Handle(w http.ResponseWriter, r *http.Request, repo *Repo) (int, error)
type GithubHook ¶
type GithubHook struct{}
func (GithubHook) DoesHandle ¶
func (g GithubHook) DoesHandle(h http.Header) bool
func (GithubHook) Handle ¶
func (g GithubHook) Handle(w http.ResponseWriter, r *http.Request, repo *Repo) (int, error)
type GitlabHook ¶
type GitlabHook struct{}
func (GitlabHook) DoesHandle ¶
func (g GitlabHook) DoesHandle(h http.Header) bool
func (GitlabHook) Handle ¶
func (g GitlabHook) Handle(w http.ResponseWriter, r *http.Request, repo *Repo) (int, error)
type Repo ¶
type Repo struct { URL string // Repository URL Path string // Directory to pull to Host string // Git domain host e.g. github.com Branch string // Git branch KeyPath string // Path to private ssh key Interval time.Duration // Interval between pulls Then []Then // Commands to execute after successful git pull sync.Mutex HookUrl string // url to listen on for webhooks HookSecret string // secret to validate hooks // contains filtered or unexported fields }
Repo is the structure that holds required information of a git repository.
type Then ¶
Then is the command executed after successful pull.
func NewLongThen ¶
NewLongThen creates a new long running Then comand.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.