Files
mesh-contracts/go/seats/containerimageregistry/contract.go
T

206 lines
5.4 KiB
Go

// Code generated by seatgen from the seat definitions; DO NOT EDIT.
// Package containerimageregistry is the contract of the seat "container-image-registry", defined whole (seats/container-image-registry/seat.json): The mesh's container images, in the one artifact store: the OCI distribution protocol's read side, an image's tags and mirroring an outside image.
package containerimageregistry
import (
"git.novox.be/novox/mesh-contracts/go/parts/registry"
)
// Seat is the seat's name.
const Seat = "container-image-registry"
const (
VerbPublish = "publish"
VerbPublishPart = "publish-part"
VerbVersions = "versions"
VerbRemove = "remove"
VerbMirror = "mirror"
VerbTags = "tags"
VerbHold = "hold"
VerbRelease = "release"
)
const (
EventPublished = "published"
EventRefused = "refused"
EventRemoved = "removed"
EventHeld = "held"
EventReleased = "released"
)
// Verbs is every verb the seat serves, in its definition's order: a new copy each call.
func Verbs() []string {
return []string{VerbPublish, VerbPublishPart, VerbVersions, VerbRemove, VerbMirror, VerbTags, VerbHold, VerbRelease}
}
// Events is every event published on the seat's subject: a new copy each call.
func Events() []string {
return []string{EventPublished, EventRefused, EventRemoved, EventHeld, EventReleased}
}
// Family is where the seat's events are kept.
const (
Family = "container-image-registry.events"
FamilyMaxAgeDays = 7
)
// SubjectPublished is where published is published.
const SubjectPublished = "mesh.seat.container-image-registry.event.published"
// SubjectRefused is where refused is published.
const SubjectRefused = "mesh.seat.container-image-registry.event.refused"
// SubjectRemoved is where removed is published.
const SubjectRemoved = "mesh.seat.container-image-registry.event.removed"
// SubjectHeld is where held is published.
const SubjectHeld = "mesh.seat.container-image-registry.event.held"
// SubjectReleased is where released is published.
const SubjectReleased = "mesh.seat.container-image-registry.event.released"
// Artifact is the part registry's.
type Artifact = registry.Artifact
// Outcome is the part registry's.
type Outcome = registry.Outcome
// Part is the part registry's.
type Part = registry.Part
// PublishAnswer is the part registry's.
type PublishAnswer = registry.PublishAnswer
// PublishInput is the part registry's.
type PublishInput = registry.PublishInput
// PublishPartAnswer is the part registry's.
type PublishPartAnswer = registry.PublishPartAnswer
// PublishPartInput is the part registry's.
type PublishPartInput = registry.PublishPartInput
// PublishedEvent is the part registry's.
type PublishedEvent = registry.PublishedEvent
// RefusedEvent is the part registry's.
type RefusedEvent = registry.RefusedEvent
// RemoveAnswer is the part registry's.
type RemoveAnswer = registry.RemoveAnswer
// RemoveInput is the part registry's.
type RemoveInput = registry.RemoveInput
// RemovedEvent is the part registry's.
type RemovedEvent = registry.RemovedEvent
// VersionsAnswer is the part registry's.
type VersionsAnswer = registry.VersionsAnswer
// VersionsInput is the part registry's.
type VersionsInput = registry.VersionsInput
// Hold is the body of held and released.
type Hold struct {
// when, RFC 3339
At string `json:"at,omitempty"`
// the caller the holder proved
By string `json:"by,omitempty"`
// the digest
Digest string `json:"digest"`
// the module holding the seat
Holder string `json:"holder"`
// the name
Name string `json:"name"`
// why
Reason string `json:"reason,omitempty"`
}
// MirrorInput is what mirror takes.
type MirrorInput struct {
// its pinned digest, sha256:<hex>
Digest string `json:"digest"`
// the name it is kept under
Name string `json:"name"`
// the outside image's reference
Source string `json:"source"`
}
// MirrorAnswer is what mirror answers.
type MirrorAnswer struct {
// the digest stored
Digest string `json:"digest"`
// the reference the seat answers
Reference string `json:"reference"`
}
// TagsInput is what tags takes.
type TagsInput struct {
// the image
Name string `json:"name"`
}
// TagsAnswerTagsItem is a type of the contract.
type TagsAnswerTagsItem struct {
// its digest
Digest string `json:"digest"`
// the tag
Tag string `json:"tag"`
}
// TagsAnswer is what tags answers.
type TagsAnswer struct {
// the image
Name string `json:"name"`
// every tag
Tags []TagsAnswerTagsItem `json:"tags"`
}
// HoldInput is what hold takes.
type HoldInput struct {
// the digest
Digest string `json:"digest"`
// the name
Name string `json:"name"`
// which of the sweep's rules keeps it
Reason string `json:"reason"`
}
// HoldAnswer is what hold answers.
type HoldAnswer struct {
// it is held
Held bool `json:"held"`
// when the hold began, RFC 3339
Since string `json:"since,omitempty"`
}
// ReleaseInput is what release takes.
type ReleaseInput struct {
// the digest
Digest string `json:"digest"`
// the name
Name string `json:"name"`
// why it is let go
Reason string `json:"reason"`
}
// ReleaseAnswer is what release answers.
type ReleaseAnswer struct {
// the hold is gone
Released bool `json:"released"`
}
// HeldEvent is the body of the event held.
type HeldEvent = Hold
// ReleasedEvent is the body of the event released.
type ReleasedEvent = Hold
// ArtifactStoreForm is the form of the provision artifact-store.
type ArtifactStoreForm struct {
// the store's address
URL string `json:"url"`
}