Documentation
¶
Index ¶
- Variables
- type ArtifactFilter
- type ArtifactManifest
- func (a *ArtifactManifest) ArtifactSets() []*versionspb.ArtifactSet
- func (m *ArtifactManifest) GetArtifact(name string, version string) (*versionspb.Artifact, error)
- func (m *ArtifactManifest) ListArtifacts(name string, limit int64, filters ...ArtifactFilter) ([]*versionspb.Artifact, error)
- func (a *ArtifactManifest) MarshalJSON() ([]byte, error)
- func (a *ArtifactManifest) Merge(updates *ArtifactManifest) *ArtifactManifest
- func (a *ArtifactManifest) UnmarshalJSON(b []byte) error
- func (a *ArtifactManifest) Write(w io.Writer) error
- type CallbackFn
- type Location
- type Poller
Constants ¶
This section is empty.
Variables ¶
var ErrArtifactNotFound = errors.New("no artifact with given version")
ErrArtifactNotFound is returned when the version of an artifact requested is not found within the requested artifact set.
var ErrArtifactSetNotFound = errors.New("no artifact set with given artifact name")
ErrArtifactSetNotFound is returned when an artifact is requested for an artifact set that's not in the manifest.
Functions ¶
This section is empty.
Types ¶
type ArtifactFilter ¶
type ArtifactFilter func(*versionspb.Artifact) bool
ArtifactFilter filters artifacts for a ListArtifacts call. Returning true means the artifact should be kept.
func ArtifactTypeFilter ¶
func ArtifactTypeFilter(at versionspb.ArtifactType) ArtifactFilter
ArtifactTypeFilter filters out any artifacts that don't have the specified ArtifactType available.
func RemovePrereleasesFilter ¶
func RemovePrereleasesFilter() ArtifactFilter
RemovePrereleasesFilter filters out any artifacts that are for prerelease versions.
type ArtifactManifest ¶
type ArtifactManifest struct {
// contains filtered or unexported fields
}
ArtifactManifest represents a manifest file listing artifact sets. Internally, the artifacts are sorted by their versions, with newer versions first.
func NewArtifactManifestFromProto ¶
func NewArtifactManifestFromProto(pb []*versionspb.ArtifactSet) *ArtifactManifest
NewArtifactManifestFromProto returns a new ArtifactManifest from a list of ArtifactSet protobufs.
func ReadArtifactManifest ¶
func ReadArtifactManifest(r io.Reader) (*ArtifactManifest, error)
ReadArtifactManifest reads an ArtifactManifest from a json stream.
func (*ArtifactManifest) ArtifactSets ¶
func (a *ArtifactManifest) ArtifactSets() []*versionspb.ArtifactSet
ArtifactSets returns the list of protobuf artifact sets in this manifest.
func (*ArtifactManifest) GetArtifact ¶
func (m *ArtifactManifest) GetArtifact(name string, version string) (*versionspb.Artifact, error)
GetArtifact returns a an artifact with the given artifact name and version string.
func (*ArtifactManifest) ListArtifacts ¶
func (m *ArtifactManifest) ListArtifacts(name string, limit int64, filters ...ArtifactFilter) ([]*versionspb.Artifact, error)
ListArtifacts returns artifacts with the given name, in version sorted order (newest versions first). It returns up to `limit` artifacts.
func (*ArtifactManifest) MarshalJSON ¶
func (a *ArtifactManifest) MarshalJSON() ([]byte, error)
MarshalJSON marshals a slice of artifact sets into a json array.
func (*ArtifactManifest) Merge ¶
func (a *ArtifactManifest) Merge(updates *ArtifactManifest) *ArtifactManifest
Merge returns a new ArtifactManifest with the artifacts merged. On conflicts, values in `updates` take precedence.
func (*ArtifactManifest) UnmarshalJSON ¶
func (a *ArtifactManifest) UnmarshalJSON(b []byte) error
UnmarshalJSON decodes a json array of artifact sets into an ArtifactManifest.
type CallbackFn ¶
type CallbackFn func(*ArtifactManifest) error
CallbackFn is the type for the callback that will be called whenever the manifest changes.
type Location ¶
type Location interface { Checksum(context.Context) ([]byte, error) ManifestReader(context.Context) (io.ReadCloser, error) }
Location represents a storage location of a manifest, and allows interacting with it.
func NewGCSLocation ¶
NewGCSLocation creates a new manifest.Location for a manifest stored in GCS.
func NewHTTPLocation ¶
NewHTTPLocation returns a new Location for a manifest stored at an arbitrary http endpoint.