watcher

package
v0.0.0-...-bee9f94 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	WaitForBuild bool // When true, the watcher will keep observing the run until it's done
}

type StartMessage

type StartMessage struct {
	SpecURL      string   `json:"spec"`
	Attestation  string   `json:"attestation"`
	Snapshots    string   `json:"snapshots"`
	ArtifactList string   `json:"artifacts_list"`
	Artifacts    []string `json:"artifacts"`
}

type Watcher

type Watcher struct {
	DraftAttestation *attestation.Attestation
	Builder          builder.Builder
	ArtifactStores   []store.Store
	Snapshots        []map[string]*snapshot.Snapshot
	Options          Options
}

func New

func New(uri string) (w *Watcher, err error)

func (*Watcher) AddArtifactSource

func (w *Watcher) AddArtifactSource(specURL string) error

AddArtifactSource adds a new source to look for artifacts

func (*Watcher) AttestRun

func (w *Watcher) AttestRun(r *run.Run) (att *attestation.Attestation, err error)

AttestRun generates an attestation from a run tejolote can watch

func (*Watcher) CollectArtifacts

func (w *Watcher) CollectArtifacts(r *run.Run) error

CollectArtifacts queries the storage drivers attached to the run and collects any artifacts found after the build is done

func (*Watcher) GetRun

func (w *Watcher) GetRun(specURL string) (*run.Run, error)

GetRun returns a run from the build system

func (*Watcher) LoadAttestation

func (w *Watcher) LoadAttestation(path string) error

LoadAttestation loads a partial attestation to complete when a run finished running

func (*Watcher) LoadSnapshots

func (w *Watcher) LoadSnapshots(path string) error

LoadSnapshots loads saved snapshot state from a file to continue

func (*Watcher) PublishToTopic

func (w *Watcher) PublishToTopic(topicString string, message interface{}) (err error)

PublishToTopic sends the data of a partial attestation to a Pub/Sub topic.

func (*Watcher) SaveSnapshots

func (w *Watcher) SaveSnapshots(path string) error

SaveSnapshots stores the current state of the storage locations to a file which can be reused when continuing an attestation

func (*Watcher) Snap

func (w *Watcher) Snap() error

Snap adds a new snapshot set to the watcher by querying each of the storage drivers

func (*Watcher) Watch

func (w *Watcher) Watch(r *run.Run) error

Watch watches a run, updating the run data as it runs

Jump to

Keyboard shortcuts

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