Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDirEmpty ¶
IsDirEmpty validates the existance of a directory and checks if it has any contents
func TagHistory ¶
Types ¶
type Change ¶
Change is a data structure that cpatures a git repository and commit ID for any observed pushed commits
type GitOptions ¶
type GitOptions struct { CloneOptions *gogit.CloneOptions Branch string }
GitOptions encapsulates the parameters describing a clone repositories branch etc
type GitWatcher ¶
type GitWatcher struct { Dir string Repos map[string]monitored Remove bool Ctx context.Context Cancel context.CancelFunc Stopped chan struct{} sync.Mutex }
GitWatcher encapsulates the state and control structures around a single clone repository that is being watched and processed
func NewGitWatcher ¶
func NewGitWatcher(ctx context.Context, baseDir string, loggerC chan<- *LoggerSink) (watcher *GitWatcher, err kv.Error)
NewGitWatcher will initiate a git repositry watching go routine and struct that will process git activity in a goroutine. New repositories can be added to the watcher using the returned watcher structure and channels.
func (*GitWatcher) Add ¶
func (gw *GitWatcher) Add(url string, branch string, token string, triggerC chan *Change) (err kv.Error)
Add is used to register a repository to watch for changes. Changes detected on the users specified branch will be notified using a channel that is returned by this method.
type LoggerSink ¶
type LoggerSink struct { Msg string Args []interface{} }
LoggerSink encapsulates information and context for a message sent to a logging listener within a server