watch

package
v0.0.0-...-02502d4 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2019 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BitbucketPayload

type BitbucketPayload struct {
	Push struct {
		Changes []struct {
			New struct {
				Name string `json:"name"`
			} `json:"new"`
		} `json:"changes"`
	} `json:"push"`
}

BitbucketPayload is the response Bitbucket

type GitLabPayload

type GitLabPayload struct {
	Ref string `json:"ref"`
}

GitLabPayload is the response from GitLab

type GithubPayload

type GithubPayload struct {
	Ref string `json:"ref"`
}

GithubPayload is the response from GitHub

type StashPayload

type StashPayload struct {
	RefChanges []struct {
		RefID string `json:"refId"`
	} `json:"refChanges"`
}

StashPayload is the response from Stash

type Watcher

type Watcher struct {
	sync.Mutex

	Repositories []repository.Repo

	RepoChangeCh chan repository.Repo
	ErrCh        chan error
	RcvDoneCh    chan struct{}
	SndDoneCh    chan struct{}
	// contains filtered or unexported fields
}

Watcher is used to keep track of changes of the repositories

func New

func New(repos []repository.Repo, hookSvr *config.HookSvrConfig, once bool) *Watcher

New create a new watcher, passing in the repositories, webhook listener config, and optional once flag

func (*Watcher) ListenAndServe

func (w *Watcher) ListenAndServe(errCh chan<- error)

ListenAndServe starts the listener server for hooks

func (*Watcher) Stop

func (w *Watcher) Stop()

Stop watching for changes. It will stop interval and webhook polling

func (*Watcher) Watch

func (w *Watcher) Watch()

Watch repositories available to the watcher

Jump to

Keyboard shortcuts

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