watcher

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DockerFilterContainer = filters.Arg("type", string(docker_events.ContainerEventType))
	DockerFilterStart     = filters.Arg("event", string(docker_events.ActionStart))
	DockerFilterStop      = filters.Arg("event", string(docker_events.ActionStop))
	DockerFilterDie       = filters.Arg("event", string(docker_events.ActionDie))
	DockerFilterDestroy   = filters.Arg("event", string(docker_events.ActionDestroy))
	DockerFilterKill      = filters.Arg("event", string(docker_events.ActionKill))
	DockerFilterPause     = filters.Arg("event", string(docker_events.ActionPause))
	DockerFilterUnpause   = filters.Arg("event", string(docker_events.ActionUnPause))

	NewDockerFilter = filters.NewArgs
)

https://docs.docker.com/reference/api/engine/version/v1.47/#tag/System/operation/SystemPingHead

Functions

func DockerFilterContainerNameID

func DockerFilterContainerNameID(nameOrID string) filters.KeyValuePair

Types

type DirWatcher

type DirWatcher struct {
	zerolog.Logger
	// contains filtered or unexported fields
}

func NewDirectoryWatcher

func NewDirectoryWatcher(parent task.Parent, dirPath string) *DirWatcher

NewDirectoryWatcher returns a DirWatcher instance.

The DirWatcher watches the given directory for file system events. Currently, only events on files directly in the given directory are watched, not recursively.

Note that the returned DirWatcher is not ready to use until the goroutine started by NewDirectoryWatcher has finished.

func (*DirWatcher) Add

func (h *DirWatcher) Add(relPath string) Watcher

func (*DirWatcher) Events

func (h *DirWatcher) Events(_ context.Context) (<-chan Event, <-chan gperr.Error)

type DockerListOptions

type DockerListOptions = docker_events.ListOptions

type DockerWatcher

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

func NewDockerWatcher

func NewDockerWatcher(host string) *DockerWatcher

func (*DockerWatcher) Events

func (w *DockerWatcher) Events(ctx context.Context) (<-chan Event, <-chan gperr.Error)

func (*DockerWatcher) EventsWithOptions

func (w *DockerWatcher) EventsWithOptions(ctx context.Context, options DockerListOptions) (<-chan Event, <-chan gperr.Error)

type Event

type Event = events.Event

type Watcher

type Watcher interface {
	Events(ctx context.Context) (<-chan Event, <-chan gperr.Error)
}

func NewConfigFileWatcher

func NewConfigFileWatcher(filename string) Watcher

create a new file watcher for file under ConfigBasePath.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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