Documentation ¶
Index ¶
Constants ¶
const BatchProcessingDelay = 30 * time.Millisecond
Delay to wait for more fswatch events before requesting a repo publish/commit
const NonExistentPollingTime = 1 * time.Second
Polling time between checks for non-existent manifests
Variables ¶
This section is empty.
Functions ¶
func ParseFlags ¶
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 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.