watcher

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GitWatcher

type GitWatcher struct {
	// contains filtered or unexported fields
}

GitWatcher implements a Watcher for monitoring Git repositories and executing tasks associated with those Git repositories when they receive commits.

func NewGitWatcher

func NewGitWatcher(
	directory string,
	bus chan task.ExecutionTask,
	checkInterval time.Duration,
	secrets secret.Store,
) *GitWatcher

NewGitWatcher creates a new watcher with all necessary parameters

func (*GitWatcher) GetState

func (w *GitWatcher) GetState() config.State

GetState implements Watcher

func (*GitWatcher) SetState

func (w *GitWatcher) SetState(state config.State) error

SetState implements Watcher Upon state being updated, the watcher dispatches an event to its own channel to instruct the daemon loop to reconfigure. The reason for this is that loop keeps the whole system in sync, so reconfigurations don't happen mid way through a target event.

func (*GitWatcher) Start

func (w *GitWatcher) Start() error

Start runs the watcher loop and blocks until a fatal error occurs

type MockWatcher

type MockWatcher struct {
	// contains filtered or unexported fields
}

func (*MockWatcher) GetState

func (m *MockWatcher) GetState() config.State

func (*MockWatcher) SetState

func (m *MockWatcher) SetState(s config.State) error

type Watcher

type Watcher interface {
	SetState(config.State) error
	GetState() config.State
}

Watcher describes a type that receives a configuration and sets up the necessary providers to execute targets. It also provides a way to acquire its current state so systems such as the Reconfigurer can inspect it and decide if it needs updating.

Jump to

Keyboard shortcuts

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