serve

package
v0.0.0-...-2208570 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2021 License: BSD-2-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const BatchProcessingDelay = 30 * time.Millisecond

Delay to wait for more fswatch events before requesting a repo publish/commit

View Source
const NonExistentPollingTime = 1 * time.Second

Polling time between checks for non-existent manifests

Variables

This section is empty.

Functions

func ParseFlags

func ParseFlags(args []string) error

func Run

func Run(cfg *build.Config, args []string, addrChan chan string) error

Types

type ManifestBatch

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

type ManifestWatcher

type ManifestWatcher struct {
	PublishEvents chan []string
	// contains filtered or unexported fields
}

func NewManifestWatcher

func NewManifestWatcher(publishList *string, quiet *bool) (*ManifestWatcher, error)

type Metadata

type Metadata struct {
	Version int       `json:"version"`
	Expires time.Time `json:"expires"`
}

type MetadataMonitor

type MetadataMonitor struct {
	Events chan Metadata
	// contains filtered or unexported fields
}

MetadataMonitor monitors the contents of a TUF metadata file at a given path, emitting an event whenever its version changes.

func NewMetadataMonitor

func NewMetadataMonitor(path string, watcher *fswatch.Watcher) *MetadataMonitor

NewMetadataMonitor monitors the given path containing valid TUF metadata and is resilient to the file at that location being deleted or moved, emitting a single event on the returned `Events` channel whenever the version field of the metadata changes, or the file at that path changes from missing/invalid to valid, even if that version was previously observed.

The provided `watcher` object will be configured to watch `path` (and re-configured to watch that path if the file is deleted and re-created), but the user of this type must manually forward all observed events from the watcher for `path` to the `HandleEvent` method.

func (*MetadataMonitor) Close

func (m *MetadataMonitor) Close()

Close stops monitoring the metadata file and waits for any associated goroutines to finish.

func (*MetadataMonitor) HandleEvent

func (m *MetadataMonitor) HandleEvent(event fswatch.Event)

HandleEvent must be called with any events received by the fswatch.Watcher and for the path provided to NewMetadataMonitor.

type MissingManifests

type MissingManifests struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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