git

package
v0.0.0-...-fd92c9c Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDirEmpty

func IsDirEmpty(name string) (empty bool, errGo error)

IsDirEmpty validates the existance of a directory and checks if it has any contents

func TagHistory

func TagHistory() (history *tagHistory, err kv.Error)

Types

type Change

type Change struct {
	URL    string
	Dir    string
	Commit string
}

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.

func (*GitWatcher) Stop

func (gw *GitWatcher) Stop(ctx context.Context) (orderly bool)

Stop will stop the listening go routine that was initialized by the NewGitWatcher function.

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

type TagDetails

type TagDetails struct {
	Tag *semver.Version
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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