httpapi

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Overview

Package httpapi provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.6.0 DO NOT EDIT.

Index

Constants

View Source
const (
	BearerAuthScopes = "bearerAuth.Scopes"
)

Variables

View Source
var OpenAPIJSON = string(openAPIJSON)

Functions

func Handler added in v0.4.0

func Handler(si ServerInterface) http.Handler

Handler creates http.Handler with routing matching OpenAPI spec.

func HandlerForSQLite

func HandlerForSQLite(ctx context.Context, dsn string, offer []domain.OfferSnapshot, options ...Option) (http.Handler, func() error, error)

HandlerForSQLite builds a fully-wired handler over a SQLite event log with the fake adapter serving the given offers. Used for evaluation and tests.

func HandlerFromMux added in v0.4.0

func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL added in v0.4.0

func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler

func HandlerWithOptions added in v0.4.0

func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

func New

func New(deps Deps, options ...Option) http.Handler

Types

type AcceleratorDriver added in v0.6.0

type AcceleratorDriver struct {
	Capability string `json:"capability,omitempty"`
	Vendor     string `json:"vendor,omitempty"`
	Version    string `json:"version,omitempty"`
}

AcceleratorDriver The accelerator driver a host runs and the highest accelerator capability it supports, in the vendor's own versioning. It is the host half of the compatibility contract: the image carries the workload's own accelerator stack, and these two decide whether it can run here at all.

type AcceleratorInventory added in v0.4.0

type AcceleratorInventory struct {
	CanonicalModel string `json:"canonical_model,omitempty"`
	Count          int    `json:"count"`
	MemoryBytes    int64  `json:"memory_bytes"`
	Model          string `json:"model"`
	Vendor         string `json:"vendor"`
}

AcceleratorInventory defines model for AcceleratorInventory.

type AcceleratorRequirement added in v0.4.0

type AcceleratorRequirement struct {
	Count          int      `json:"count"`
	MemoryMinBytes int64    `json:"memory_min_bytes"`
	ModelAnyOf     []string `json:"model_any_of,omitempty"`
	Vendor         string   `json:"vendor"`
}

AcceleratorRequirement defines model for AcceleratorRequirement.

type AdapterListResponse added in v0.4.0

type AdapterListResponse struct {
	Adapters []AdapterManifest `json:"adapters"`
}

AdapterListResponse defines model for AdapterListResponse.

type AdapterManifest added in v0.4.0

type AdapterManifest = adapter.Manifest

AdapterManifest An adapter's self-description for onboarding surfaces. Lives next to the adapter's code; carries no per-connection state and never any secret material.

type Admission added in v0.6.0

type Admission = domain.AdmissionDeferral

Admission defines model for Admission.

type ArtifactEvidence added in v0.6.0

type ArtifactEvidence struct {
	ArtifactId string `json:"artifact_id"`

	// FetchBytes What this host still has to read out of the object store for this version.
	FetchBytes int64 `json:"fetch_bytes,omitempty"`

	// Locality Hot is a checked copy of exactly this version on this host. Cold is no such copy, which includes a copy nobody verified. Unknown is a host that could not enumerate its copies at all, which is uncertainty to price and never infeasibility.
	Locality ArtifactEvidenceLocality `json:"locality"`
}

ArtifactEvidence What one candidate was found holding of one Artifact the Run reads, and what it would still have to read out of the object store. Only the control plane can state it: the host says which copy it has and what that copy was checked against, the catalog says what the version is, and the answer is whether those two agree. There is no partial, because an Artifact version is one immutable object.

type ArtifactEvidenceLocality added in v0.6.0

type ArtifactEvidenceLocality string

ArtifactEvidenceLocality Hot is a checked copy of exactly this version on this host. Cold is no such copy, which includes a copy nobody verified. Unknown is a host that could not enumerate its copies at all, which is uncertainty to price and never infeasibility.

const (
	ArtifactEvidenceLocalityCold    ArtifactEvidenceLocality = "cold"
	ArtifactEvidenceLocalityHot     ArtifactEvidenceLocality = "hot"
	ArtifactEvidenceLocalityUnknown ArtifactEvidenceLocality = "unknown"
)

Defines values for ArtifactEvidenceLocality.

func (ArtifactEvidenceLocality) Valid added in v0.6.0

func (e ArtifactEvidenceLocality) Valid() bool

Valid indicates whether the value is a known member of the ArtifactEvidenceLocality enum.

type ArtifactInventory added in v0.6.0

type ArtifactInventory struct {
	// Known Whether the holder enumerated its Artifact replicas at all.
	Known      bool              `json:"known"`
	ObservedAt time.Time         `json:"observed_at,omitempty"`
	Replicas   []ArtifactReplica `json:"replicas,omitempty"`
}

ArtifactInventory The Artifact content this host says it holds. Like the image inventory it answers what is here, and separately whether anyone enumerated at all: capacity Mercator runs nothing of its own on reports none of it, and that silence is not absence.

type ArtifactReplica added in v0.6.0

type ArtifactReplica struct {
	ArtifactId string `json:"artifact_id"`

	// ContentDigest What this copy claims its bytes hash to.
	ContentDigest string `json:"content_digest"`
	SizeBytes     int64  `json:"size_bytes"`

	// State Verified means these bytes were hashed and matched the catalog entry. Unverified means a copy is present and nobody checked it, which is not evidence that the right bytes are here.
	State ArtifactReplicaState `json:"state"`

	// VerifiedAt When this copy was last checked against the catalog entry's content digest.
	VerifiedAt time.Time `json:"verified_at,omitempty"`
}

ArtifactReplica One host's local copy of an Artifact version. It is an optimisation over the object store and never the authority: a copy is worth what its verification against the catalog entry's content digest says it is worth.

type ArtifactReplicaState added in v0.6.0

type ArtifactReplicaState string

ArtifactReplicaState Verified means these bytes were hashed and matched the catalog entry. Unverified means a copy is present and nobody checked it, which is not evidence that the right bytes are here.

const (
	Unverified ArtifactReplicaState = "unverified"
	Verified   ArtifactReplicaState = "verified"
)

Defines values for ArtifactReplicaState.

func (ArtifactReplicaState) Valid added in v0.6.0

func (e ArtifactReplicaState) Valid() bool

Valid indicates whether the value is a known member of the ArtifactReplicaState enum.

type ArtifactRequirements added in v0.6.0

type ArtifactRequirements struct {
	// Consumes Artifact version identities this workload reads. The Run is accepted at once and is not placed until every one of them is durable in the object store, so it waits for a publication and never for a particular machine. A Mercator with no object store configured cannot establish that any of them exists, and refuses the request with ARTIFACT_CATALOG_UNAVAILABLE rather than accepting a Run it could never place.
	Consumes []string `json:"consumes,omitempty"`

	// Produces Artifact version identities this workload publishes. A version is immutable, so a workload may not also consume one it produces.
	Produces []string `json:"produces,omitempty"`
}

ArtifactRequirements The immutable Artifact versions this workload reads and publishes. A declared input is a dependency on durable content in the object store rather than on any host holding a copy, so a Run waits for a publication and never for a particular machine.

type AuthorizeConnection200JSONResponse added in v0.4.0

type AuthorizeConnection200JSONResponse ConnectionResponse

func (AuthorizeConnection200JSONResponse) VisitAuthorizeConnectionResponse added in v0.4.0

func (response AuthorizeConnection200JSONResponse) VisitAuthorizeConnectionResponse(w http.ResponseWriter) error

type AuthorizeConnection400JSONResponse added in v0.4.0

type AuthorizeConnection400JSONResponse ErrorResponse

func (AuthorizeConnection400JSONResponse) VisitAuthorizeConnectionResponse added in v0.4.0

func (response AuthorizeConnection400JSONResponse) VisitAuthorizeConnectionResponse(w http.ResponseWriter) error

type AuthorizeConnection401JSONResponse added in v0.4.0

type AuthorizeConnection401JSONResponse ErrorResponse

func (AuthorizeConnection401JSONResponse) VisitAuthorizeConnectionResponse added in v0.4.0

func (response AuthorizeConnection401JSONResponse) VisitAuthorizeConnectionResponse(w http.ResponseWriter) error

type AuthorizeConnection403JSONResponse added in v0.4.0

type AuthorizeConnection403JSONResponse ErrorResponse

func (AuthorizeConnection403JSONResponse) VisitAuthorizeConnectionResponse added in v0.4.0

func (response AuthorizeConnection403JSONResponse) VisitAuthorizeConnectionResponse(w http.ResponseWriter) error

type AuthorizeConnection500JSONResponse added in v0.4.0

type AuthorizeConnection500JSONResponse ErrorResponse

func (AuthorizeConnection500JSONResponse) VisitAuthorizeConnectionResponse added in v0.4.0

func (response AuthorizeConnection500JSONResponse) VisitAuthorizeConnectionResponse(w http.ResponseWriter) error

type AuthorizeConnection501JSONResponse added in v0.4.0

type AuthorizeConnection501JSONResponse ErrorResponse

func (AuthorizeConnection501JSONResponse) VisitAuthorizeConnectionResponse added in v0.4.0

func (response AuthorizeConnection501JSONResponse) VisitAuthorizeConnectionResponse(w http.ResponseWriter) error

type AuthorizeConnection502JSONResponse added in v0.4.0

type AuthorizeConnection502JSONResponse ErrorResponse

func (AuthorizeConnection502JSONResponse) VisitAuthorizeConnectionResponse added in v0.4.0

func (response AuthorizeConnection502JSONResponse) VisitAuthorizeConnectionResponse(w http.ResponseWriter) error

type AuthorizeConnectionRequestObject added in v0.4.0

type AuthorizeConnectionRequestObject struct {
	ConnectionId string `json:"connection_id"`
}

type AuthorizeConnectionResponseObject added in v0.4.0

type AuthorizeConnectionResponseObject interface {
	VisitAuthorizeConnectionResponse(w http.ResponseWriter) error
}

type Booking added in v0.5.0

type Booking = domain.Booking

Booking defines model for Booking.

type BookingDecision added in v0.5.0

type BookingDecision = domain.BookingDecision

BookingDecision defines model for BookingDecision.

type BookingDecisionResponse added in v0.5.0

type BookingDecisionResponse struct {
	// Decision Temporary v0.6 rollout bridge: the latest entry in decisions for workspace-client-v1 callers.
	// Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set
	Decision  BookingDecision   `json:"decision,omitempty"`
	Decisions []BookingDecision `json:"decisions"`
}

BookingDecisionResponse Every decision recorded about one Run, oldest first. A decision is appended and never rewritten, so the newest entry is the answer that stands, it names the entry it supersedes and why, and the ones before it are the answers a reader needs to see the Run's history.

type CPURequirement added in v0.4.0

type CPURequirement struct {
	MinMillis int64 `json:"min_millis"`
}

CPURequirement defines model for CPURequirement.

type CacheEvidence added in v0.6.0

type CacheEvidence struct {
	// HeldCompatibilityKey The generation this host actually holds under the name, when it holds one. It separates the two ways a cache is cold: a machine that has never done this work, and one holding the generation before the one now asked for.
	HeldCompatibilityKey string `json:"held_compatibility_key,omitempty"`

	// Locality Hot is this deployment's cache of this name holding the generation the Run asked for. Cold is anything else, including a neighbour's cache of the same name and the generation the application has since replaced. Unknown is a host that could not enumerate its caches at all.
	Locality CacheEvidenceLocality `json:"locality"`
	Name     string                `json:"name"`
}

CacheEvidence What one candidate was found holding of one cache the Run declared. It is recorded and never priced: what a warm cache saves is work inside the application, which nothing here has measured, so turning it into seconds would be an exchange rate nobody established.

type CacheEvidenceLocality added in v0.6.0

type CacheEvidenceLocality string

CacheEvidenceLocality Hot is this deployment's cache of this name holding the generation the Run asked for. Cold is anything else, including a neighbour's cache of the same name and the generation the application has since replaced. Unknown is a host that could not enumerate its caches at all.

const (
	CacheEvidenceLocalityCold    CacheEvidenceLocality = "cold"
	CacheEvidenceLocalityHot     CacheEvidenceLocality = "hot"
	CacheEvidenceLocalityUnknown CacheEvidenceLocality = "unknown"
)

Defines values for CacheEvidenceLocality.

func (CacheEvidenceLocality) Valid added in v0.6.0

func (e CacheEvidenceLocality) Valid() bool

Valid indicates whether the value is a known member of the CacheEvidenceLocality enum.

type CacheInventory added in v0.6.0

type CacheInventory struct {
	// Known Whether the holder enumerated its caches at all.
	Known      bool         `json:"known"`
	Mounts     []CacheMount `json:"mounts,omitempty"`
	ObservedAt time.Time    `json:"observed_at,omitempty"`
}

CacheInventory The mutable caches this host says it holds. Like the image and Artifact inventories it answers what is here, and separately whether anyone enumerated at all: capacity Mercator runs nothing of its own on reports none of it, and that silence is not absence.

type CacheMount added in v0.6.0

type CacheMount struct {
	// CompatibilityKey The generation of content under this name, as the application stated it when the cache was written.
	CompatibilityKey string `json:"compatibility_key,omitempty"`

	// CreatedAt When this generation of the cache started existing here. It is the freshness a container runtime can state: a holder that makes new storage per compatibility key can say when this one began, and cannot say when anything last read it.
	CreatedAt time.Time `json:"created_at,omitempty"`
	Name      string    `json:"name"`
}

CacheMount One mutable cache on one host, as the holder reports it. It carries no digest and no verification state, because there is nothing to check it against: the contents are whatever the application last wrote. It carries no size either, because nothing on a real node measures one without walking every volume on the machine.

type CacheMountRequirement added in v0.6.0

type CacheMountRequirement struct {
	// CompatibilityKey The application's own statement of which generation of content it can use. Mercator compares it and never interprets it: content declared under another generation is worth what no content is worth, and gets storage of its own. It is recorded beside the storage it names on whatever host holds the cache, so it must be a printable label.
	CompatibilityKey string `json:"compatibility_key,omitempty"`

	// Name This cache's identity within its deployment. It also names durable storage on whatever host holds the cache, so it must be a lowercase label.
	Name string `json:"name"`

	// SizeBytes How much room the application expects this cache to take. It is a declaration rather than a measurement.
	SizeBytes int64 `json:"size_bytes,omitempty"`
}

CacheMountRequirement One mutable, application-owned cache a workload wants mounted across Runs. Its identity is its deployment-global name and compatibility key. It is best-effort, so a cache that is not on the chosen host costs the application the work of rebuilding what was in it and never keeps the Run from running.

type CancelRun200JSONResponse added in v0.4.0

type CancelRun200JSONResponse RunResponse

func (CancelRun200JSONResponse) VisitCancelRunResponse added in v0.4.0

func (response CancelRun200JSONResponse) VisitCancelRunResponse(w http.ResponseWriter) error

type CancelRun400JSONResponse added in v0.4.0

type CancelRun400JSONResponse ErrorResponse

func (CancelRun400JSONResponse) VisitCancelRunResponse added in v0.4.0

func (response CancelRun400JSONResponse) VisitCancelRunResponse(w http.ResponseWriter) error

type CancelRun401JSONResponse added in v0.4.0

type CancelRun401JSONResponse ErrorResponse

func (CancelRun401JSONResponse) VisitCancelRunResponse added in v0.4.0

func (response CancelRun401JSONResponse) VisitCancelRunResponse(w http.ResponseWriter) error

type CancelRun403JSONResponse added in v0.4.0

type CancelRun403JSONResponse ErrorResponse

func (CancelRun403JSONResponse) VisitCancelRunResponse added in v0.4.0

func (response CancelRun403JSONResponse) VisitCancelRunResponse(w http.ResponseWriter) error

type CancelRun502JSONResponse added in v0.4.0

type CancelRun502JSONResponse ErrorResponse

func (CancelRun502JSONResponse) VisitCancelRunResponse added in v0.4.0

func (response CancelRun502JSONResponse) VisitCancelRunResponse(w http.ResponseWriter) error

type CancelRunRequestObject added in v0.4.0

type CancelRunRequestObject struct {
	RunId string `json:"run_id"`
}

type CancelRunResponseObject added in v0.4.0

type CancelRunResponseObject interface {
	VisitCancelRunResponse(w http.ResponseWriter) error
}

type CandidateDecision added in v0.4.0

type CandidateDecision struct {
	AdapterType string `json:"adapter_type,omitempty"`

	// ArtifactEvidence What this candidate was found holding of the immutable content the Run reads, one entry per declared input. It stands beside image_locality rather than folded into it: an image is what the runtime fetches to start a container, an Artifact is what the workload reads once it is running, and one host is routinely warm for one and cold for the other.
	ArtifactEvidence []ArtifactEvidence `json:"artifact_evidence,omitempty"`

	// CacheEvidence What this candidate was found holding of the mutable caches the Run declared, one entry per name. It is recorded rather than scored, and it distinguishes a machine that has never done this work from one holding the named cache.
	CacheEvidence []CacheEvidence `json:"cache_evidence,omitempty"`

	// Candidate What Mercator took a candidate to be, as opposed to what the listing was called. A prediction claiming evidence about this exact candidate has to say which candidate it meant, and every field here is a fact a backend published rather than an identifier Mercator minted. A candidate that publishes nothing outliving its listing states only a provider and a lane, which is how the record says no history about it can ever be read again.
	Candidate CandidateIdentity `json:"candidate,omitempty"`

	// Confidences What each answer this candidate was scored on is worth, one entry per source that stated one. It is the whole input to the score's uncertainty term, recorded so score_usd can be re-derived from this record: a scoring term whose input is not here is a term no reader can check. An answer nobody stated a confidence for is absent rather than zero, because stating no opinion is not the same as stating that an answer is worthless.
	Confidences  []Confidence `json:"confidences,omitempty"`
	ConnectionId string       `json:"connection_id,omitempty"`

	// Disk What one Run asked of one candidate's disk: the room the machine said it had left, the room the Run reserved for its own working state, and the content that still had to land there. It is one question over every kind of content at once because the disk is one resource, and a candidate short of room is refused rather than priced: nothing this Run could give up frees a byte it does not need straight back, and the only content that would make room belongs to somebody else.
	Disk        DiskDemand                   `json:"disk,omitempty"`
	Disposition CandidateDecisionDisposition `json:"disposition"`
	Estimates   CandidateEstimates           `json:"estimates"`
	Feasible    bool                         `json:"feasible"`

	// ImageLocality How much of the Run's image this candidate was found to have. It is the qualitative half of the pull estimate, and only the control plane can state it: the host says what it holds, the manifest says what the image is, and the answer is the subtraction. Unknown means nobody could look, which is uncertainty to price and never infeasibility.
	ImageLocality   CandidateDecisionImageLocality `json:"image_locality,omitempty"`
	NativeRef       string                         `json:"native_ref,omitempty"`
	OfferSnapshotId string                         `json:"offer_snapshot_id"`
	Rejections      []Violation                    `json:"rejections,omitempty"`

	// Reliability The risk history a machine's publisher states about it. Each rate stands on its own measurement, because a publisher measures what it measures, and an unmeasured rate is absent rather than zero. The whole history is absent when a publisher has measured nothing, which is every provider in this tree today, so a reader must treat no history and a history of zeroes as different answers.
	Reliability ReliabilityEvidence `json:"reliability,omitempty"`

	// RentalSchedule One Rental Schedule as a placement decision read it: the version that answered, the Booking holding the Rental, the Bookings already waiting in front of this Run, and the wait that projects from them. A schedule moves, so the wait a Run was priced was read from one version of it at one moment, and a decision that recorded only the seconds leaves nobody able to retrace them.
	RentalSchedule ScheduleEvidence `json:"rental_schedule,omitempty"`

	// ScoreUsd What this candidate is worth to this Run in dollars, lowest first: the cost it would be billed, plus the dollars its service class says it would rather pay than wait, plus the dollars it would rather pay than act on a doubtful answer. Every quantity it multiplies is recorded beside it, at the weights the decision states, so it can be re-derived rather than trusted. An infeasible candidate scores nothing, because it has no price.
	ScoreUsd float64 `json:"score_usd,omitempty"`

	// TransferRates The throughput each transfer stage of this launch was priced at and where that number came from, one entry per stage that had bytes to move. A stage with nothing to move records none, because there was no transfer to price, and nothing else suppresses one: every transfer this fleet prices is bytes over a rate, so a transfer is not a stage the estimator answers out of measured launches. The seconds a candidate is charged are bytes over a rate, the bytes are explained by the locality evidence, and this is the other half: a machine priced at a throughput nothing on it ever reported and a machine priced at Mercator's own assumption produce the same seconds and are different claims.
	TransferRates []TransferRate `json:"transfer_rates,omitempty"`
}

CandidateDecision defines model for CandidateDecision.

type CandidateDecisionDisposition added in v0.5.0

type CandidateDecisionDisposition string

CandidateDecisionDisposition defines model for CandidateDecision.Disposition.

const (
	LaunchEphemeral      CandidateDecisionDisposition = "launch_ephemeral"
	ProvisionFreshRental CandidateDecisionDisposition = "provision_fresh_rental"
	QueueExistingRental  CandidateDecisionDisposition = "queue_existing_rental"
	RunNowExistingRental CandidateDecisionDisposition = "run_now_existing_rental"
)

Defines values for CandidateDecisionDisposition.

func (CandidateDecisionDisposition) Valid added in v0.5.0

Valid indicates whether the value is a known member of the CandidateDecisionDisposition enum.

type CandidateDecisionImageLocality added in v0.6.0

type CandidateDecisionImageLocality string

CandidateDecisionImageLocality How much of the Run's image this candidate was found to have. It is the qualitative half of the pull estimate, and only the control plane can state it: the host says what it holds, the manifest says what the image is, and the answer is the subtraction. Unknown means nobody could look, which is uncertainty to price and never infeasibility.

const (
	Cold    CandidateDecisionImageLocality = "cold"
	Hot     CandidateDecisionImageLocality = "hot"
	Partial CandidateDecisionImageLocality = "partial"
	Unknown CandidateDecisionImageLocality = "unknown"
)

Defines values for CandidateDecisionImageLocality.

func (CandidateDecisionImageLocality) Valid added in v0.6.0

Valid indicates whether the value is a known member of the CandidateDecisionImageLocality enum.

type CandidateEstimates added in v0.4.0

type CandidateEstimates struct {
	// CommittedInterval One machine's already-owed rent as one placement met it: when the interval ends, when this Run would start spending it, and how many of its seconds this Run would take. Capacity nothing is owed on carries none of it.
	CommittedInterval CommittedInterval `json:"committed_interval,omitempty"`

	// CostTerms What those dollars are made of, one entry per part of the price this candidate was charged for. A machine nobody quoted carries none. The total alone cannot be argued with: a machine charged the shadow price of one Run's seconds and a machine charged the whole hour it is committed to are the same claim to a reader who sees only dollars, and the difference is which term they are in.
	CostTerms               []CostTerm `json:"cost_terms,omitempty"`
	CostUsd                 Estimate   `json:"cost_usd"`
	EstablishedStartSeconds Estimate   `json:"established_start_seconds"`
	QueueSeconds            Estimate   `json:"queue_seconds"`

	// Stages What this candidate is predicted to spend on each stage of a launch. There are eight of them, and they are eight rather than four because each is answered by a different authority, fails for a different reason, and has an actual of its own.
	Stages       LaunchStageEstimates `json:"stages"`
	StartSeconds Estimate             `json:"start_seconds"`
}

CandidateEstimates defines model for CandidateEstimates.

type CandidateIdentity added in v0.6.0

type CandidateIdentity struct {
	// Accelerator How many cards of each accelerator product this capacity holds, canonicalized and counted per product so an inventory grouped two ways is one answer.
	Accelerator string `json:"accelerator,omitempty"`

	// ImageDigest The content this candidate was asked to run. Stages whose duration is a property of the content are filed with it; stages that are a property of the machine are not.
	ImageDigest string `json:"image_digest,omitempty"`

	// InstanceType The product name the provider sells this capacity under. Absent for a provider that sells asks against individual machines instead of named products.
	InstanceType string `json:"instance_type,omitempty"`

	// Lane What this capacity is for: a machine Mercator controls through an enrolled runtime and can hand successive workloads to, or a provider-native one-shot execution that holds nothing once its workload exits. It is part of the identity because the two have different stages to predict and different disks afterwards, so one key over both would report each lane's history as the other's.
	Lane CandidateIdentityLane `json:"lane,omitempty"`

	// Machine The machine this capacity is, where its backend can name one. It is never the lease and never the route Mercator took to reach the machine.
	Machine string `json:"machine,omitempty"`

	// Provider The backend the capacity comes from, which is the coarsest thing worth learning about and the only field every candidate has.
	Provider string `json:"provider,omitempty"`

	// Region Where the machine is, in the provider's own vocabulary. Absent for a provider that publishes no geography at all.
	Region string `json:"region,omitempty"`
}

CandidateIdentity What Mercator took a candidate to be, as opposed to what the listing was called. A prediction claiming evidence about this exact candidate has to say which candidate it meant, and every field here is a fact a backend published rather than an identifier Mercator minted. A candidate that publishes nothing outliving its listing states only a provider and a lane, which is how the record says no history about it can ever be read again.

type CandidateIdentityLane added in v0.6.0

type CandidateIdentityLane string

CandidateIdentityLane What this capacity is for: a machine Mercator controls through an enrolled runtime and can hand successive workloads to, or a provider-native one-shot execution that holds nothing once its workload exits. It is part of the identity because the two have different stages to predict and different disks afterwards, so one key over both would report each lane's history as the other's.

const (
	Ephemeral CandidateIdentityLane = "ephemeral"
	Reusable  CandidateIdentityLane = "reusable"
)

Defines values for CandidateIdentityLane.

func (CandidateIdentityLane) Valid added in v0.6.0

func (e CandidateIdentityLane) Valid() bool

Valid indicates whether the value is a known member of the CandidateIdentityLane enum.

type CapabilityProfile added in v0.4.0

type CapabilityProfile struct {
	Container     ContainerCapabilities         `json:"container"`
	Lifecycle     LifecycleCapabilities         `json:"lifecycle"`
	Network       NetworkCapabilities           `json:"network"`
	Observability ObservabilityCapabilities     `json:"observability"`
	OfferKinds    []CapabilityProfileOfferKinds `json:"offer_kinds,omitempty"`
	Pricing       PricingCapabilities           `json:"pricing"`
	Resources     ResourceCapabilities          `json:"resources"`
}

CapabilityProfile defines model for CapabilityProfile.

type CapabilityProfileOfferKinds added in v0.4.0

type CapabilityProfileOfferKinds string

CapabilityProfileOfferKinds defines model for CapabilityProfile.OfferKinds.

const (
	Provisionable CapabilityProfileOfferKinds = "provisionable"
	Standing      CapabilityProfileOfferKinds = "standing"
)

Defines values for CapabilityProfileOfferKinds.

func (CapabilityProfileOfferKinds) Valid added in v0.4.0

Valid indicates whether the value is a known member of the CapabilityProfileOfferKinds enum.

type CapacityEvidence added in v0.4.0

type CapacityEvidence struct {
	Available  bool    `json:"available"`
	Confidence float64 `json:"confidence"`
}

CapacityEvidence defines model for CapacityEvidence.

type CapacityTerms added in v0.6.0

type CapacityTerms = domain.CapacityTerms

CapacityTerms What a machine was sold on beyond its rate: the interval Mercator already owes rent for, the kinds of work it may be used for, and the moment it stops being available. Capacity nobody has allocated states none of it, because nothing is owed on a machine that does not exist yet, it is reserved for nobody, and it is available for as long as its listing is.

type CleanupError added in v0.4.5

type CleanupError struct {
	Code        string                  `json:"code"`
	Disposition CleanupErrorDisposition `json:"disposition"`
	LaunchKey   string                  `json:"launch_key"`
	Message     string                  `json:"message"`
	Retryable   bool                    `json:"retryable"`
}

CleanupError defines model for CleanupError.

type CleanupErrorDisposition added in v0.4.5

type CleanupErrorDisposition string

CleanupErrorDisposition defines model for CleanupError.Disposition.

const (
	Release   CleanupErrorDisposition = "release"
	Terminate CleanupErrorDisposition = "terminate"
)

Defines values for CleanupErrorDisposition.

func (CleanupErrorDisposition) Valid added in v0.4.5

func (e CleanupErrorDisposition) Valid() bool

Valid indicates whether the value is a known member of the CleanupErrorDisposition enum.

type CloudEvent added in v0.4.0

type CloudEvent = eventlog.CloudEvent

CloudEvent defines model for CloudEvent.

type CollectionReport added in v0.4.0

type CollectionReport struct {
	ConnectionsFromCache []string `json:"connections_from_cache,omitempty"`
	ConnectionsQueried   []string `json:"connections_queried,omitempty"`
	ExcludedConnections  []string `json:"excluded_connections,omitempty"`
}

CollectionReport defines model for CollectionReport.

type CommittedInterval added in v0.6.0

type CommittedInterval = domain.CommittedInterval

CommittedInterval One machine's already-owed rent as one placement met it: when the interval ends, when this Run would start spending it, and how many of its seconds this Run would take. Capacity nothing is owed on carries none of it.

type Confidence added in v0.6.0

type Confidence struct {
	// Answer What was being answered, in the vocabulary of whatever answered: the capacity claim, the reliability history, the image transfer, the Artifact read.
	Answer string  `json:"answer"`
	Value  float64 `json:"value"`
}

Confidence One answer a placement rested on and what its source said it was worth.

type ConnectionFailure added in v0.4.0

type ConnectionFailure struct {
	AdapterType  string `json:"adapter_type"`
	ConnectionId string `json:"connection_id"`
	Message      string `json:"message"`
}

ConnectionFailure defines model for ConnectionFailure.

type ConnectionListResponse added in v0.4.0

type ConnectionListResponse struct {
	Connections []ConnectionRecord `json:"connections"`
}

ConnectionListResponse defines model for ConnectionListResponse.

type ConnectionRecord added in v0.4.0

type ConnectionRecord = connection.Record

ConnectionRecord defines model for ConnectionRecord.

type ConnectionResponse added in v0.4.0

type ConnectionResponse struct {
	Connection ConnectionRecord `json:"connection"`
}

ConnectionResponse defines model for ConnectionResponse.

type ContainerCapabilities added in v0.4.0

type ContainerCapabilities struct {
	MaxContainers              int  `json:"max_containers"`
	MaxEnvironmentBytes        int  `json:"max_environment_bytes"`
	SupportsDigestRefs         bool `json:"supports_digest_refs"`
	SupportsEntrypointOverride bool `json:"supports_entrypoint_override"`
}

ContainerCapabilities defines model for ContainerCapabilities.

type ContainerSpec added in v0.4.0

type ContainerSpec struct {
	Args       []string              `json:"args,omitempty"`
	Entrypoint []string              `json:"entrypoint,omitempty"`
	Env        map[string]EnvBinding `json:"env,omitempty"`
	Image      string                `json:"image"`
	Name       string                `json:"name"`
	Platform   Platform              `json:"platform"`
	Ports      []PortSpec            `json:"ports,omitempty"`
}

ContainerSpec defines model for ContainerSpec.

type CostTerm added in v0.6.0

type CostTerm = domain.CostTerm

CostTerm One part of what a placement costs and what that part is worth. A price recorded as one number cannot be argued with: rent for seconds Mercator has already bought, rent the placement itself commits it to, and the tail of a billing increment nothing will use are three different claims about one machine.

type CreateConnection201JSONResponse added in v0.4.0

type CreateConnection201JSONResponse ConnectionResponse

func (CreateConnection201JSONResponse) VisitCreateConnectionResponse added in v0.4.0

func (response CreateConnection201JSONResponse) VisitCreateConnectionResponse(w http.ResponseWriter) error

type CreateConnection400JSONResponse added in v0.4.0

type CreateConnection400JSONResponse ErrorResponse

func (CreateConnection400JSONResponse) VisitCreateConnectionResponse added in v0.4.0

func (response CreateConnection400JSONResponse) VisitCreateConnectionResponse(w http.ResponseWriter) error

type CreateConnection401JSONResponse added in v0.4.0

type CreateConnection401JSONResponse ErrorResponse

func (CreateConnection401JSONResponse) VisitCreateConnectionResponse added in v0.4.0

func (response CreateConnection401JSONResponse) VisitCreateConnectionResponse(w http.ResponseWriter) error

type CreateConnection403JSONResponse added in v0.4.0

type CreateConnection403JSONResponse ErrorResponse

func (CreateConnection403JSONResponse) VisitCreateConnectionResponse added in v0.4.0

func (response CreateConnection403JSONResponse) VisitCreateConnectionResponse(w http.ResponseWriter) error

type CreateConnection409JSONResponse added in v0.4.0

type CreateConnection409JSONResponse ErrorResponse

func (CreateConnection409JSONResponse) VisitCreateConnectionResponse added in v0.4.0

func (response CreateConnection409JSONResponse) VisitCreateConnectionResponse(w http.ResponseWriter) error

type CreateConnection413JSONResponse added in v0.4.0

type CreateConnection413JSONResponse ErrorResponse

func (CreateConnection413JSONResponse) VisitCreateConnectionResponse added in v0.4.0

func (response CreateConnection413JSONResponse) VisitCreateConnectionResponse(w http.ResponseWriter) error

type CreateConnection500JSONResponse added in v0.4.0

type CreateConnection500JSONResponse ErrorResponse

func (CreateConnection500JSONResponse) VisitCreateConnectionResponse added in v0.4.0

func (response CreateConnection500JSONResponse) VisitCreateConnectionResponse(w http.ResponseWriter) error

type CreateConnection501JSONResponse added in v0.4.0

type CreateConnection501JSONResponse ErrorResponse

func (CreateConnection501JSONResponse) VisitCreateConnectionResponse added in v0.4.0

func (response CreateConnection501JSONResponse) VisitCreateConnectionResponse(w http.ResponseWriter) error

type CreateConnectionJSONRequestBody added in v0.4.0

type CreateConnectionJSONRequestBody = CreateConnectionRequest

CreateConnectionJSONRequestBody defines body for CreateConnection for application/json ContentType.

type CreateConnectionParams added in v0.4.0

type CreateConnectionParams struct {
	IdempotencyKey string `json:"Idempotency-Key"`
}

CreateConnectionParams defines parameters for CreateConnection.

type CreateConnectionRequest added in v0.4.0

type CreateConnectionRequest struct {
	AdapterType  string            `json:"adapter_type"`
	Config       map[string]string `json:"config,omitempty"`
	ConnectionId string            `json:"connection_id"`
	Credential   Credential        `json:"credential,omitempty"`

	// Secret Write-only: accepted on create, sealed at rest, never echoed in any response.
	Secret string `json:"secret,omitempty"`
}

CreateConnectionRequest defines model for CreateConnectionRequest.

type CreateConnectionRequestObject added in v0.4.0

type CreateConnectionRequestObject struct {
	Params CreateConnectionParams
	Body   *CreateConnectionJSONRequestBody
}

type CreateConnectionResponseObject added in v0.4.0

type CreateConnectionResponseObject interface {
	VisitCreateConnectionResponse(w http.ResponseWriter) error
}

type CreateRevisionRequest added in v0.4.0

type CreateRevisionRequest struct {
	Revision WorkloadRevision `json:"revision"`
}

CreateRevisionRequest defines model for CreateRevisionRequest.

type CreateRun202JSONResponse added in v0.4.0

type CreateRun202JSONResponse RunResponse

func (CreateRun202JSONResponse) VisitCreateRunResponse added in v0.4.0

func (response CreateRun202JSONResponse) VisitCreateRunResponse(w http.ResponseWriter) error

type CreateRun400JSONResponse added in v0.4.0

type CreateRun400JSONResponse ErrorResponse

func (CreateRun400JSONResponse) VisitCreateRunResponse added in v0.4.0

func (response CreateRun400JSONResponse) VisitCreateRunResponse(w http.ResponseWriter) error

type CreateRun401JSONResponse added in v0.4.0

type CreateRun401JSONResponse ErrorResponse

func (CreateRun401JSONResponse) VisitCreateRunResponse added in v0.4.0

func (response CreateRun401JSONResponse) VisitCreateRunResponse(w http.ResponseWriter) error

type CreateRun403JSONResponse added in v0.4.0

type CreateRun403JSONResponse ErrorResponse

func (CreateRun403JSONResponse) VisitCreateRunResponse added in v0.4.0

func (response CreateRun403JSONResponse) VisitCreateRunResponse(w http.ResponseWriter) error

type CreateRun404JSONResponse added in v0.4.0

type CreateRun404JSONResponse ErrorResponse

func (CreateRun404JSONResponse) VisitCreateRunResponse added in v0.4.0

func (response CreateRun404JSONResponse) VisitCreateRunResponse(w http.ResponseWriter) error

type CreateRun409JSONResponse added in v0.4.0

type CreateRun409JSONResponse ErrorResponse

func (CreateRun409JSONResponse) VisitCreateRunResponse added in v0.4.0

func (response CreateRun409JSONResponse) VisitCreateRunResponse(w http.ResponseWriter) error

type CreateRun413JSONResponse added in v0.4.0

type CreateRun413JSONResponse ErrorResponse

func (CreateRun413JSONResponse) VisitCreateRunResponse added in v0.4.0

func (response CreateRun413JSONResponse) VisitCreateRunResponse(w http.ResponseWriter) error

type CreateRun500JSONResponse added in v0.4.0

type CreateRun500JSONResponse ErrorResponse

func (CreateRun500JSONResponse) VisitCreateRunResponse added in v0.4.0

func (response CreateRun500JSONResponse) VisitCreateRunResponse(w http.ResponseWriter) error

type CreateRunJSONRequestBody added in v0.4.0

type CreateRunJSONRequestBody = CreateRunRequest

CreateRunJSONRequestBody defines body for CreateRun for application/json ContentType.

type CreateRunParams added in v0.4.0

type CreateRunParams struct {
	IdempotencyKey string `json:"Idempotency-Key"`
}

CreateRunParams defines parameters for CreateRun.

type CreateRunRequest added in v0.4.0

type CreateRunRequest struct {
	// Args Container args for the image shorthand.
	Args []string `json:"args,omitempty"`

	// Env Run-level literal env bindings. For stored or explicit workload specs, these override or add to the workload container env for this run only. For image shorthand, these become the synthesized container env.
	Env map[string]EnvBinding `json:"env,omitempty"`

	// Image Top-level image shorthand. Synthesizes the single container when no full workload spec is supplied. Ignored when an explicit workload spec is present.
	Image string `json:"image,omitempty"`

	// RunId Optional. When omitted the server generates a uuidv7-based run id and returns it.
	RunId              string           `json:"run_id,omitempty"`
	Workload           WorkloadRevision `json:"workload,omitempty"`
	WorkloadId         string           `json:"workload_id,omitempty"`
	WorkloadRevisionId string           `json:"workload_revision_id,omitempty"`
}

CreateRunRequest Create a run. The only required input is an image (top-level shorthand) or a full workload spec. run_id is optional and server-generated (uuidv7) when omitted; an Idempotency-Key header is required for retry-safe replay.

type CreateRunRequestObject added in v0.4.0

type CreateRunRequestObject struct {
	Params CreateRunParams
	Body   *CreateRunJSONRequestBody
}

type CreateRunResponseObject added in v0.4.0

type CreateRunResponseObject interface {
	VisitCreateRunResponse(w http.ResponseWriter) error
}

type CreateWorkload202JSONResponse added in v0.4.0

type CreateWorkload202JSONResponse struct {
	WorkloadId string `json:"workload_id"`
}

func (CreateWorkload202JSONResponse) VisitCreateWorkloadResponse added in v0.4.0

func (response CreateWorkload202JSONResponse) VisitCreateWorkloadResponse(w http.ResponseWriter) error

type CreateWorkload400JSONResponse added in v0.4.0

type CreateWorkload400JSONResponse ErrorResponse

func (CreateWorkload400JSONResponse) VisitCreateWorkloadResponse added in v0.4.0

func (response CreateWorkload400JSONResponse) VisitCreateWorkloadResponse(w http.ResponseWriter) error

type CreateWorkload401JSONResponse added in v0.4.0

type CreateWorkload401JSONResponse ErrorResponse

func (CreateWorkload401JSONResponse) VisitCreateWorkloadResponse added in v0.4.0

func (response CreateWorkload401JSONResponse) VisitCreateWorkloadResponse(w http.ResponseWriter) error

type CreateWorkload403JSONResponse added in v0.4.0

type CreateWorkload403JSONResponse ErrorResponse

func (CreateWorkload403JSONResponse) VisitCreateWorkloadResponse added in v0.4.0

func (response CreateWorkload403JSONResponse) VisitCreateWorkloadResponse(w http.ResponseWriter) error

type CreateWorkload413JSONResponse added in v0.4.0

type CreateWorkload413JSONResponse ErrorResponse

func (CreateWorkload413JSONResponse) VisitCreateWorkloadResponse added in v0.4.0

func (response CreateWorkload413JSONResponse) VisitCreateWorkloadResponse(w http.ResponseWriter) error

type CreateWorkload501JSONResponse added in v0.4.0

type CreateWorkload501JSONResponse ErrorResponse

func (CreateWorkload501JSONResponse) VisitCreateWorkloadResponse added in v0.4.0

func (response CreateWorkload501JSONResponse) VisitCreateWorkloadResponse(w http.ResponseWriter) error

type CreateWorkloadJSONRequestBody added in v0.4.0

type CreateWorkloadJSONRequestBody = CreateWorkloadRequest

CreateWorkloadJSONRequestBody defines body for CreateWorkload for application/json ContentType.

type CreateWorkloadParams added in v0.4.0

type CreateWorkloadParams struct {
	IdempotencyKey string `json:"Idempotency-Key"`
}

CreateWorkloadParams defines parameters for CreateWorkload.

type CreateWorkloadRequest added in v0.4.0

type CreateWorkloadRequest struct {
	Name       string `json:"name"`
	WorkloadId string `json:"workload_id"`
}

CreateWorkloadRequest defines model for CreateWorkloadRequest.

type CreateWorkloadRequestObject added in v0.4.0

type CreateWorkloadRequestObject struct {
	Params CreateWorkloadParams
	Body   *CreateWorkloadJSONRequestBody
}

type CreateWorkloadResponseObject added in v0.4.0

type CreateWorkloadResponseObject interface {
	VisitCreateWorkloadResponse(w http.ResponseWriter) error
}

type CreateWorkloadRevision202JSONResponse added in v0.4.0

type CreateWorkloadRevision202JSONResponse WorkloadRevisionResponse

func (CreateWorkloadRevision202JSONResponse) VisitCreateWorkloadRevisionResponse added in v0.4.0

func (response CreateWorkloadRevision202JSONResponse) VisitCreateWorkloadRevisionResponse(w http.ResponseWriter) error

type CreateWorkloadRevision400JSONResponse added in v0.4.0

type CreateWorkloadRevision400JSONResponse ErrorResponse

func (CreateWorkloadRevision400JSONResponse) VisitCreateWorkloadRevisionResponse added in v0.4.0

func (response CreateWorkloadRevision400JSONResponse) VisitCreateWorkloadRevisionResponse(w http.ResponseWriter) error

type CreateWorkloadRevision401JSONResponse added in v0.4.0

type CreateWorkloadRevision401JSONResponse ErrorResponse

func (CreateWorkloadRevision401JSONResponse) VisitCreateWorkloadRevisionResponse added in v0.4.0

func (response CreateWorkloadRevision401JSONResponse) VisitCreateWorkloadRevisionResponse(w http.ResponseWriter) error

type CreateWorkloadRevision403JSONResponse added in v0.4.0

type CreateWorkloadRevision403JSONResponse ErrorResponse

func (CreateWorkloadRevision403JSONResponse) VisitCreateWorkloadRevisionResponse added in v0.4.0

func (response CreateWorkloadRevision403JSONResponse) VisitCreateWorkloadRevisionResponse(w http.ResponseWriter) error

type CreateWorkloadRevision413JSONResponse added in v0.4.0

type CreateWorkloadRevision413JSONResponse ErrorResponse

func (CreateWorkloadRevision413JSONResponse) VisitCreateWorkloadRevisionResponse added in v0.4.0

func (response CreateWorkloadRevision413JSONResponse) VisitCreateWorkloadRevisionResponse(w http.ResponseWriter) error

type CreateWorkloadRevision501JSONResponse added in v0.4.0

type CreateWorkloadRevision501JSONResponse ErrorResponse

func (CreateWorkloadRevision501JSONResponse) VisitCreateWorkloadRevisionResponse added in v0.4.0

func (response CreateWorkloadRevision501JSONResponse) VisitCreateWorkloadRevisionResponse(w http.ResponseWriter) error

type CreateWorkloadRevisionJSONRequestBody added in v0.4.0

type CreateWorkloadRevisionJSONRequestBody = CreateRevisionRequest

CreateWorkloadRevisionJSONRequestBody defines body for CreateWorkloadRevision for application/json ContentType.

type CreateWorkloadRevisionParams added in v0.4.0

type CreateWorkloadRevisionParams struct {
	IdempotencyKey string `json:"Idempotency-Key"`
}

CreateWorkloadRevisionParams defines parameters for CreateWorkloadRevision.

type CreateWorkloadRevisionRequestObject added in v0.4.0

type CreateWorkloadRevisionRequestObject struct {
	WorkloadId string `json:"workload_id"`
	Params     CreateWorkloadRevisionParams
	Body       *CreateWorkloadRevisionJSONRequestBody
}

type CreateWorkloadRevisionResponseObject added in v0.4.0

type CreateWorkloadRevisionResponseObject interface {
	VisitCreateWorkloadRevisionResponse(w http.ResponseWriter) error
}

type Credential added in v0.4.0

type Credential = credential.Credential

Credential defines model for Credential.

type DeleteConnection200JSONResponse added in v0.4.0

type DeleteConnection200JSONResponse struct {
	Deleted bool `json:"deleted"`
}

func (DeleteConnection200JSONResponse) VisitDeleteConnectionResponse added in v0.4.0

func (response DeleteConnection200JSONResponse) VisitDeleteConnectionResponse(w http.ResponseWriter) error

type DeleteConnection400JSONResponse added in v0.4.0

type DeleteConnection400JSONResponse ErrorResponse

func (DeleteConnection400JSONResponse) VisitDeleteConnectionResponse added in v0.4.0

func (response DeleteConnection400JSONResponse) VisitDeleteConnectionResponse(w http.ResponseWriter) error

type DeleteConnection401JSONResponse added in v0.4.0

type DeleteConnection401JSONResponse ErrorResponse

func (DeleteConnection401JSONResponse) VisitDeleteConnectionResponse added in v0.4.0

func (response DeleteConnection401JSONResponse) VisitDeleteConnectionResponse(w http.ResponseWriter) error

type DeleteConnection403JSONResponse added in v0.4.0

type DeleteConnection403JSONResponse ErrorResponse

func (DeleteConnection403JSONResponse) VisitDeleteConnectionResponse added in v0.4.0

func (response DeleteConnection403JSONResponse) VisitDeleteConnectionResponse(w http.ResponseWriter) error

type DeleteConnection404JSONResponse added in v0.4.0

type DeleteConnection404JSONResponse ErrorResponse

func (DeleteConnection404JSONResponse) VisitDeleteConnectionResponse added in v0.4.0

func (response DeleteConnection404JSONResponse) VisitDeleteConnectionResponse(w http.ResponseWriter) error

type DeleteConnection500JSONResponse added in v0.4.0

type DeleteConnection500JSONResponse ErrorResponse

func (DeleteConnection500JSONResponse) VisitDeleteConnectionResponse added in v0.4.0

func (response DeleteConnection500JSONResponse) VisitDeleteConnectionResponse(w http.ResponseWriter) error

type DeleteConnection501JSONResponse added in v0.4.0

type DeleteConnection501JSONResponse ErrorResponse

func (DeleteConnection501JSONResponse) VisitDeleteConnectionResponse added in v0.4.0

func (response DeleteConnection501JSONResponse) VisitDeleteConnectionResponse(w http.ResponseWriter) error

type DeleteConnectionRequestObject added in v0.4.0

type DeleteConnectionRequestObject struct {
	ConnectionId string `json:"connection_id"`
}

type DeleteConnectionResponseObject added in v0.4.0

type DeleteConnectionResponseObject interface {
	VisitDeleteConnectionResponse(w http.ResponseWriter) error
}

type DeliverSink202JSONResponse added in v0.4.0

type DeliverSink202JSONResponse SinkResult

func (DeliverSink202JSONResponse) VisitDeliverSinkResponse added in v0.4.0

func (response DeliverSink202JSONResponse) VisitDeliverSinkResponse(w http.ResponseWriter) error

type DeliverSink401JSONResponse added in v0.4.0

type DeliverSink401JSONResponse ErrorResponse

func (DeliverSink401JSONResponse) VisitDeliverSinkResponse added in v0.4.0

func (response DeliverSink401JSONResponse) VisitDeliverSinkResponse(w http.ResponseWriter) error

type DeliverSink501JSONResponse added in v0.4.0

type DeliverSink501JSONResponse ErrorResponse

func (DeliverSink501JSONResponse) VisitDeliverSinkResponse added in v0.4.0

func (response DeliverSink501JSONResponse) VisitDeliverSinkResponse(w http.ResponseWriter) error

type DeliverSink502JSONResponse added in v0.4.0

type DeliverSink502JSONResponse ErrorResponse

func (DeliverSink502JSONResponse) VisitDeliverSinkResponse added in v0.4.0

func (response DeliverSink502JSONResponse) VisitDeliverSinkResponse(w http.ResponseWriter) error

type DeliverSinkRequestObject added in v0.4.0

type DeliverSinkRequestObject struct {
	SinkId string `json:"sink_id"`
}

type DeliverSinkResponseObject added in v0.4.0

type DeliverSinkResponseObject interface {
	VisitDeliverSinkResponse(w http.ResponseWriter) error
}

type Deps added in v0.2.0

type Deps struct {
	Orchestrator *orchestrator.Orchestrator
	Offers       OfferAggregator
	Workloads    *workload.Service
	Sinks        *sinkspkg.Manager
	Connections  *connection.Service
	Resolver     ImageResolver
	Events       ConsoleEventLog
}

Deps are the services the server routes to. Orchestrator and Offers are required; a nil optional service disables its endpoints. Placement preview and create-run intake both go through Orchestrator.

type DiskDemand added in v0.6.0

type DiskDemand struct {
	// EstablishedLandBytes The part of that somebody enumerated. Content nobody could describe is priced in seconds and never refuses a machine, because those bytes may already be on its disk.
	EstablishedLandBytes int64 `json:"established_land_bytes,omitempty"`

	// FreeBytes The room the offer said this machine had left. A machine that could not measure its disk offers none.
	FreeBytes int64 `json:"free_bytes"`

	// LandBytes Everything this Run's content still had to put on this disk: the image bytes it must transfer, the Artifact versions it must read out of the object store, and the caches it declared that this host does not hold.
	LandBytes int64 `json:"land_bytes,omitempty"`

	// ReservedBytes The ephemeral disk the workload declared it needs. It is asked for beside the content rather than out of it, because a Run admitted on a fifty gigabyte floor whose fifty gigabytes turn out to be its own dataset was promised nothing.
	ReservedBytes int64 `json:"reserved_bytes,omitempty"`
}

DiskDemand What one Run asked of one candidate's disk: the room the machine said it had left, the room the Run reserved for its own working state, and the content that still had to land there. It is one question over every kind of content at once because the disk is one resource, and a candidate short of room is refused rather than priced: nothing this Run could give up frees a byte it does not need straight back, and the only content that would make room belongs to somebody else.

type DiskRequirement added in v0.4.0

type DiskRequirement struct {
	MinBytes int64 `json:"min_bytes"`
}

DiskRequirement defines model for DiskRequirement.

type EnvBinding added in v0.4.0

type EnvBinding = domain.EnvBinding

EnvBinding defines model for EnvBinding.

type ErrorResponse added in v0.4.0

type ErrorResponse struct {
	Code    string      `json:"code"`
	Details []Violation `json:"details,omitempty"`
	Message string      `json:"message"`
}

ErrorResponse defines model for ErrorResponse.

type Estimate added in v0.4.0

type Estimate struct {
	Confidence float64 `json:"confidence,omitempty"`
	Expected   float64 `json:"expected,omitempty"`

	// Key The key the samples were read under, where any were. It is recorded so a reader can check what Mercator took the candidate to be against what it then learned about: an answer claiming this exact candidate, filed under a number a marketplace mints per search, is a claim of candidate-specific evidence made out of a key that cannot have any.
	Key string `json:"key,omitempty"`

	// Level Which evidence answered this estimate: measured launches of this exact candidate, of this provider in this region, of this provider, or none at all. A prior is named rather than left blank so a reader can tell a measurement from a published claim, which the seconds alone cannot say.
	Level        EstimateLevel `json:"level,omitempty"`
	ModelVersion string        `json:"model_version,omitempty"`
	P50          float64       `json:"p50,omitempty"`
	P90          float64       `json:"p90,omitempty"`

	// SampleCount How many measured launches stand behind this answer. Zero is the answer a prior gives, and it is a different claim from the same seconds read off one launch.
	SampleCount int    `json:"sample_count,omitempty"`
	Source      string `json:"source,omitempty"`
}

Estimate defines model for Estimate.

type EstimateLevel added in v0.6.0

type EstimateLevel string

EstimateLevel Which evidence answered this estimate: measured launches of this exact candidate, of this provider in this region, of this provider, or none at all. A prior is named rather than left blank so a reader can tell a measurement from a published claim, which the seconds alone cannot say.

const (
	ExactCandidate    EstimateLevel = "exact_candidate"
	Prior             EstimateLevel = "prior"
	Provider          EstimateLevel = "provider"
	ProviderAndRegion EstimateLevel = "provider_and_region"
)

Defines values for EstimateLevel.

func (EstimateLevel) Valid added in v0.6.0

func (e EstimateLevel) Valid() bool

Valid indicates whether the value is a known member of the EstimateLevel enum.

type EventListResponse added in v0.4.0

type EventListResponse struct {
	Events []CloudEvent `json:"events"`
}

EventListResponse defines model for EventListResponse.

type ExecutionPolicy added in v0.4.0

type ExecutionPolicy struct {
	MaxPreStartAttempts int   `json:"max_pre_start_attempts"`
	MaxRuntimeSeconds   int64 `json:"max_runtime_seconds"`
}

ExecutionPolicy defines model for ExecutionPolicy.

type FleetAnswer added in v0.6.0

type FleetAnswer = domain.FleetAnswer

FleetAnswer defines model for FleetAnswer.

type GetOpenAPI200JSONResponse added in v0.4.0

type GetOpenAPI200JSONResponse map[string]interface{}

func (GetOpenAPI200JSONResponse) VisitGetOpenAPIResponse added in v0.4.0

func (response GetOpenAPI200JSONResponse) VisitGetOpenAPIResponse(w http.ResponseWriter) error

type GetOpenAPIRequestObject added in v0.4.0

type GetOpenAPIRequestObject struct {
}

type GetOpenAPIResponseObject added in v0.4.0

type GetOpenAPIResponseObject interface {
	VisitGetOpenAPIResponse(w http.ResponseWriter) error
}

type GetRun200JSONResponse added in v0.4.0

type GetRun200JSONResponse RunResponse

func (GetRun200JSONResponse) VisitGetRunResponse added in v0.4.0

func (response GetRun200JSONResponse) VisitGetRunResponse(w http.ResponseWriter) error

type GetRun400JSONResponse added in v0.4.0

type GetRun400JSONResponse ErrorResponse

func (GetRun400JSONResponse) VisitGetRunResponse added in v0.4.0

func (response GetRun400JSONResponse) VisitGetRunResponse(w http.ResponseWriter) error

type GetRun401JSONResponse added in v0.4.0

type GetRun401JSONResponse ErrorResponse

func (GetRun401JSONResponse) VisitGetRunResponse added in v0.4.0

func (response GetRun401JSONResponse) VisitGetRunResponse(w http.ResponseWriter) error

type GetRun403JSONResponse added in v0.4.0

type GetRun403JSONResponse ErrorResponse

func (GetRun403JSONResponse) VisitGetRunResponse added in v0.4.0

func (response GetRun403JSONResponse) VisitGetRunResponse(w http.ResponseWriter) error

type GetRun404JSONResponse added in v0.4.0

type GetRun404JSONResponse ErrorResponse

func (GetRun404JSONResponse) VisitGetRunResponse added in v0.4.0

func (response GetRun404JSONResponse) VisitGetRunResponse(w http.ResponseWriter) error

type GetRunDecision200JSONResponse added in v0.4.0

type GetRunDecision200JSONResponse BookingDecisionResponse

func (GetRunDecision200JSONResponse) VisitGetRunDecisionResponse added in v0.4.0

func (response GetRunDecision200JSONResponse) VisitGetRunDecisionResponse(w http.ResponseWriter) error

type GetRunDecision400JSONResponse added in v0.4.0

type GetRunDecision400JSONResponse ErrorResponse

func (GetRunDecision400JSONResponse) VisitGetRunDecisionResponse added in v0.4.0

func (response GetRunDecision400JSONResponse) VisitGetRunDecisionResponse(w http.ResponseWriter) error

type GetRunDecision401JSONResponse added in v0.4.0

type GetRunDecision401JSONResponse ErrorResponse

func (GetRunDecision401JSONResponse) VisitGetRunDecisionResponse added in v0.4.0

func (response GetRunDecision401JSONResponse) VisitGetRunDecisionResponse(w http.ResponseWriter) error

type GetRunDecision403JSONResponse added in v0.4.0

type GetRunDecision403JSONResponse ErrorResponse

func (GetRunDecision403JSONResponse) VisitGetRunDecisionResponse added in v0.4.0

func (response GetRunDecision403JSONResponse) VisitGetRunDecisionResponse(w http.ResponseWriter) error

type GetRunDecision404JSONResponse added in v0.4.0

type GetRunDecision404JSONResponse ErrorResponse

func (GetRunDecision404JSONResponse) VisitGetRunDecisionResponse added in v0.4.0

func (response GetRunDecision404JSONResponse) VisitGetRunDecisionResponse(w http.ResponseWriter) error

type GetRunDecisionRequestObject added in v0.4.0

type GetRunDecisionRequestObject struct {
	RunId string `json:"run_id"`
}

type GetRunDecisionResponseObject added in v0.4.0

type GetRunDecisionResponseObject interface {
	VisitGetRunDecisionResponse(w http.ResponseWriter) error
}

type GetRunRequestObject added in v0.4.0

type GetRunRequestObject struct {
	RunId string `json:"run_id"`
}

type GetRunResponseObject added in v0.4.0

type GetRunResponseObject interface {
	VisitGetRunResponse(w http.ResponseWriter) error
}

type GetSinkStatus200JSONResponse added in v0.4.0

type GetSinkStatus200JSONResponse SinkStatus

func (GetSinkStatus200JSONResponse) VisitGetSinkStatusResponse added in v0.4.0

func (response GetSinkStatus200JSONResponse) VisitGetSinkStatusResponse(w http.ResponseWriter) error

type GetSinkStatus401JSONResponse added in v0.4.0

type GetSinkStatus401JSONResponse ErrorResponse

func (GetSinkStatus401JSONResponse) VisitGetSinkStatusResponse added in v0.4.0

func (response GetSinkStatus401JSONResponse) VisitGetSinkStatusResponse(w http.ResponseWriter) error

type GetSinkStatus404JSONResponse added in v0.4.0

type GetSinkStatus404JSONResponse ErrorResponse

func (GetSinkStatus404JSONResponse) VisitGetSinkStatusResponse added in v0.4.0

func (response GetSinkStatus404JSONResponse) VisitGetSinkStatusResponse(w http.ResponseWriter) error

type GetSinkStatus501JSONResponse added in v0.4.0

type GetSinkStatus501JSONResponse ErrorResponse

func (GetSinkStatus501JSONResponse) VisitGetSinkStatusResponse added in v0.4.0

func (response GetSinkStatus501JSONResponse) VisitGetSinkStatusResponse(w http.ResponseWriter) error

type GetSinkStatusRequestObject added in v0.4.0

type GetSinkStatusRequestObject struct {
	SinkId string `json:"sink_id"`
}

type GetSinkStatusResponseObject added in v0.4.0

type GetSinkStatusResponseObject interface {
	VisitGetSinkStatusResponse(w http.ResponseWriter) error
}

type GetWorkloadRevision200JSONResponse added in v0.4.0

type GetWorkloadRevision200JSONResponse WorkloadRevisionResponse

func (GetWorkloadRevision200JSONResponse) VisitGetWorkloadRevisionResponse added in v0.4.0

func (response GetWorkloadRevision200JSONResponse) VisitGetWorkloadRevisionResponse(w http.ResponseWriter) error

type GetWorkloadRevision400JSONResponse added in v0.4.0

type GetWorkloadRevision400JSONResponse ErrorResponse

func (GetWorkloadRevision400JSONResponse) VisitGetWorkloadRevisionResponse added in v0.4.0

func (response GetWorkloadRevision400JSONResponse) VisitGetWorkloadRevisionResponse(w http.ResponseWriter) error

type GetWorkloadRevision401JSONResponse added in v0.4.0

type GetWorkloadRevision401JSONResponse ErrorResponse

func (GetWorkloadRevision401JSONResponse) VisitGetWorkloadRevisionResponse added in v0.4.0

func (response GetWorkloadRevision401JSONResponse) VisitGetWorkloadRevisionResponse(w http.ResponseWriter) error

type GetWorkloadRevision403JSONResponse added in v0.4.0

type GetWorkloadRevision403JSONResponse ErrorResponse

func (GetWorkloadRevision403JSONResponse) VisitGetWorkloadRevisionResponse added in v0.4.0

func (response GetWorkloadRevision403JSONResponse) VisitGetWorkloadRevisionResponse(w http.ResponseWriter) error

type GetWorkloadRevision404JSONResponse added in v0.4.0

type GetWorkloadRevision404JSONResponse ErrorResponse

func (GetWorkloadRevision404JSONResponse) VisitGetWorkloadRevisionResponse added in v0.4.0

func (response GetWorkloadRevision404JSONResponse) VisitGetWorkloadRevisionResponse(w http.ResponseWriter) error

type GetWorkloadRevision501JSONResponse added in v0.4.0

type GetWorkloadRevision501JSONResponse ErrorResponse

func (GetWorkloadRevision501JSONResponse) VisitGetWorkloadRevisionResponse added in v0.4.0

func (response GetWorkloadRevision501JSONResponse) VisitGetWorkloadRevisionResponse(w http.ResponseWriter) error

type GetWorkloadRevisionRequestObject added in v0.4.0

type GetWorkloadRevisionRequestObject struct {
	WorkloadId string `json:"workload_id"`
	RevisionId string `json:"revision_id"`
}

type GetWorkloadRevisionResponseObject added in v0.4.0

type GetWorkloadRevisionResponseObject interface {
	VisitGetWorkloadRevisionResponse(w http.ResponseWriter) error
}

type HealthLive200JSONResponse added in v0.4.0

type HealthLive200JSONResponse struct {
	Status string `json:"status"`
}

func (HealthLive200JSONResponse) VisitHealthLiveResponse added in v0.4.0

func (response HealthLive200JSONResponse) VisitHealthLiveResponse(w http.ResponseWriter) error

type HealthLiveRequestObject added in v0.4.0

type HealthLiveRequestObject struct {
}

type HealthLiveResponseObject added in v0.4.0

type HealthLiveResponseObject interface {
	VisitHealthLiveResponse(w http.ResponseWriter) error
}

type HealthReady200JSONResponse added in v0.4.0

type HealthReady200JSONResponse struct {
	ApiEpoch              string   `json:"api_epoch"`
	BuildRevision         string   `json:"build_revision"`
	CompatibilityFeatures []string `json:"compatibility_features"`
	Status                string   `json:"status"`
	StorageEpoch          string   `json:"storage_epoch"`
	SupportedClientEpochs []string `json:"supported_client_epochs"`
}

func (HealthReady200JSONResponse) VisitHealthReadyResponse added in v0.4.0

func (response HealthReady200JSONResponse) VisitHealthReadyResponse(w http.ResponseWriter) error

type HealthReadyRequestObject added in v0.4.0

type HealthReadyRequestObject struct {
}

type HealthReadyResponseObject added in v0.4.0

type HealthReadyResponseObject interface {
	VisitHealthReadyResponse(w http.ResponseWriter) error
}

type HostFacts added in v0.6.0

type HostFacts struct {
	// Attested Every host promise somebody established about this machine, by name. It is not a set of the true ones: false is an answer, and a name absent was never established.
	Attested map[string]bool `json:"attested,omitempty"`

	// Driver The accelerator driver a host runs and the highest accelerator capability it supports, in the vendor's own versioning. It is the host half of the compatibility contract: the image carries the workload's own accelerator stack, and these two decide whether it can run here at all.
	Driver AcceleratorDriver `json:"driver,omitempty"`
}

HostFacts What a machine, or the provider selling it, has established about the substrate under a workload. Every promise is tri-state: stated true, stated false, or never stated at all. A machine with no driver can never run an image that needs one and a machine nobody asked is a machine nobody asked, so Placement refuses both and records them under different codes.

type HostRequirements added in v0.6.0

type HostRequirements struct {
	// Facts The host promises this Run refuses to run without. A machine that never stated one is refused UNKNOWN_FACT, as loudly as a machine that stated its opposite is refused CAPABILITY_MISMATCH.
	Facts []HostRequirementsFacts `json:"facts,omitempty"`

	// MinDriverCapability The lowest accelerator capability this workload's image was built for, in the vendor's own versioning. For NVIDIA it is the CUDA version the driver must support.
	MinDriverCapability string `json:"min_driver_capability,omitempty"`

	// MinDriverVersion The oldest accelerator driver this workload's image runs on, in the vendor's own versioning.
	MinDriverVersion string `json:"min_driver_version,omitempty"`
}

HostRequirements What a workload needs of the substrate under it rather than of the cards on it: the host promises it will not run without, and the driver its image's own accelerator stack was built against. The host provides the driver and the image provides the stack, so an image built against a newer driver than the machine runs is refused at placement rather than discovered by a process dying on capacity already paid for. Mercator never answers a mismatch by installing a stack onto somebody's host.

type HostRequirementsFacts added in v0.6.0

type HostRequirementsFacts string

HostRequirementsFacts defines model for HostRequirements.Facts.

const (
	NvidiaDriver HostRequirementsFacts = "nvidia_driver"
	Ssh          HostRequirementsFacts = "ssh"
)

Defines values for HostRequirementsFacts.

func (HostRequirementsFacts) Valid added in v0.6.0

func (e HostRequirementsFacts) Valid() bool

Valid indicates whether the value is a known member of the HostRequirementsFacts enum.

type ImageInventory added in v0.6.0

type ImageInventory struct {
	// ImageDigests Image manifests this host holds whole and has unpacked, so it can start a container on one now.
	ImageDigests []string `json:"image_digests,omitempty"`

	// Known Whether the holder enumerated its content at all. False is an honest answer rather than a failure: a provider that cannot say what a fresh machine holds says so, and the uncertainty is priced rather than mistaken for warmth.
	Known bool `json:"known"`

	// LayerDiffIds The same unpacked content named the way a container daemon names it: the digest of the uncompressed layer. A Docker host can enumerate only these, so a resolved manifest carries both spaces and matches whichever one the host answers in.
	LayerDiffIds []string `json:"layer_diff_ids,omitempty"`

	// LayerDigests Compressed layer blobs this host holds unpacked, named the way a registry manifest names them. A host can hold layers of an image it never held whole, which is why a second version of the same image starts faster than a first.
	LayerDigests []string `json:"layer_digests,omitempty"`

	// ObservedAt When the holder last looked. Locality decays, so the age of this answer is material. How long anyone stands behind it is the offer's own expiry: the enumeration and the capacity claim come out of one observation, and an expired offer is refused whole.
	ObservedAt time.Time `json:"observed_at,omitempty"`

	// PulledImageDigests Image manifests whose content arrived here and which are not assembled into a runnable layer chain. Fetching and unpacking are separate acts, and a host that has done the first and not the second is neither warm nor cold: what is left is local work rather than a pull.
	PulledImageDigests []string `json:"pulled_image_digests,omitempty"`

	// UnknownImageDigests Image manifests this host looked at and could not account for: a runtime that would not describe one, or a store reporting part of its content present and unable to name which part. A host that enumerates itself can still fail on one image, and an image absent from every other list would otherwise read as the confident claim that none of it is here.
	UnknownImageDigests []string `json:"unknown_image_digests,omitempty"`
}

ImageInventory What this host says it holds. It answers what is here and never what is missing: what a Run would still have to fetch depends on which image is being asked about, and only the scheduler holds both halves.

type ImageResolver added in v0.2.0

type ImageResolver interface {
	Resolve(context.Context, ociresolver.ResolveRequest) (ociresolver.ResolvedImage, error)
}

ImageResolver resolves a tag-form image reference to a digest-pinned one.

type InvalidParamFormatError added in v0.4.0

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error added in v0.4.0

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap added in v0.4.0

func (e *InvalidParamFormatError) Unwrap() error

type InviteNode201JSONResponse added in v0.6.0

type InviteNode201JSONResponse NodeBootstrapResponse

func (InviteNode201JSONResponse) VisitInviteNodeResponse added in v0.6.0

func (response InviteNode201JSONResponse) VisitInviteNodeResponse(w http.ResponseWriter) error

type InviteNode400JSONResponse added in v0.6.0

type InviteNode400JSONResponse ErrorResponse

func (InviteNode400JSONResponse) VisitInviteNodeResponse added in v0.6.0

func (response InviteNode400JSONResponse) VisitInviteNodeResponse(w http.ResponseWriter) error

type InviteNode401JSONResponse added in v0.6.0

type InviteNode401JSONResponse ErrorResponse

func (InviteNode401JSONResponse) VisitInviteNodeResponse added in v0.6.0

func (response InviteNode401JSONResponse) VisitInviteNodeResponse(w http.ResponseWriter) error

type InviteNode409JSONResponse added in v0.6.0

type InviteNode409JSONResponse ErrorResponse

func (InviteNode409JSONResponse) VisitInviteNodeResponse added in v0.6.0

func (response InviteNode409JSONResponse) VisitInviteNodeResponse(w http.ResponseWriter) error

type InviteNode500JSONResponse added in v0.6.0

type InviteNode500JSONResponse ErrorResponse

func (InviteNode500JSONResponse) VisitInviteNodeResponse added in v0.6.0

func (response InviteNode500JSONResponse) VisitInviteNodeResponse(w http.ResponseWriter) error

type InviteNodeJSONRequestBody added in v0.6.0

type InviteNodeJSONRequestBody = InviteNodeRequest

InviteNodeJSONRequestBody defines body for InviteNode for application/json ContentType.

type InviteNodeRequest added in v0.6.0

type InviteNodeRequest struct {
	// AvailableUntil When this machine stops being Mercator's to use. Omitted is a machine with no such moment. Work that could still be running then is refused before it starts, judged against the runtime Mercator enforces rather than the one its caller expects.
	AvailableUntil time.Time `json:"available_until,omitempty"`

	// BillingIntervalSeconds The block of time this machine is bought in. Work that runs past the end of the interval Mercator has committed to commits it to the next whole one, and the part of that nothing uses is charged to the placement that bought it rather than to nobody. Omitted is a machine bought in no increments at all, which is an operator's own hardware: Mercator holds it continuously, so no second of it is a fresh commitment and there is no tail to charge.
	BillingIntervalSeconds int64 `json:"billing_interval_seconds,omitempty"`

	// EligibleServiceClasses The kinds of work this machine may be used for. Omitted is a machine held for nobody in particular. Work of any other class is refused this machine outright rather than priced on it.
	EligibleServiceClasses []ServiceClass `json:"eligible_service_classes,omitempty"`

	// NodeId Node identity to reserve. Generated when omitted.
	NodeId string `json:"node_id,omitempty"`

	// RentalId The Rental this node belongs to. Generated when omitted.
	RentalId string `json:"rental_id,omitempty"`

	// ShadowPriceUsdPerHour What holding this machine costs. Placement needs a price to weigh a node against fresh capacity; a node invited at zero has unknown pricing and is refused rather than treated as free.
	ShadowPriceUsdPerHour float32 `json:"shadow_price_usd_per_hour"`
}

InviteNodeRequest defines model for InviteNodeRequest.

type InviteNodeRequestObject added in v0.6.0

type InviteNodeRequestObject struct {
	Body *InviteNodeJSONRequestBody
}

type InviteNodeResponseObject added in v0.6.0

type InviteNodeResponseObject interface {
	VisitInviteNodeResponse(w http.ResponseWriter) error
}

type LaunchStageEstimates added in v0.6.0

type LaunchStageEstimates struct {
	AcquisitionSeconds      Estimate `json:"acquisition_seconds"`
	AgentReadySeconds       Estimate `json:"agent_ready_seconds"`
	ApplicationReadySeconds Estimate `json:"application_ready_seconds"`
	ArtifactFetchSeconds    Estimate `json:"artifact_fetch_seconds"`
	BootSeconds             Estimate `json:"boot_seconds"`
	ContainerStartSeconds   Estimate `json:"container_start_seconds"`
	ImageFetchSeconds       Estimate `json:"image_fetch_seconds"`
	UnpackSeconds           Estimate `json:"unpack_seconds"`
}

LaunchStageEstimates What this candidate is predicted to spend on each stage of a launch. There are eight of them, and they are eight rather than four because each is answered by a different authority, fails for a different reason, and has an actual of its own.

type LifecycleCapabilities added in v0.4.0

type LifecycleCapabilities struct {
	CancelQueued     bool   `json:"cancel_queued"`
	IdempotentLaunch string `json:"idempotent_launch"`
	ListOwned        bool   `json:"list_owned"`
	ProviderTtl      bool   `json:"provider_ttl"`
}

LifecycleCapabilities defines model for LifecycleCapabilities.

type ListAdapters200JSONResponse added in v0.4.0

type ListAdapters200JSONResponse AdapterListResponse

func (ListAdapters200JSONResponse) VisitListAdaptersResponse added in v0.4.0

func (response ListAdapters200JSONResponse) VisitListAdaptersResponse(w http.ResponseWriter) error

type ListAdapters401JSONResponse added in v0.4.0

type ListAdapters401JSONResponse ErrorResponse

func (ListAdapters401JSONResponse) VisitListAdaptersResponse added in v0.4.0

func (response ListAdapters401JSONResponse) VisitListAdaptersResponse(w http.ResponseWriter) error

type ListAdaptersRequestObject added in v0.4.0

type ListAdaptersRequestObject struct {
}

type ListAdaptersResponseObject added in v0.4.0

type ListAdaptersResponseObject interface {
	VisitListAdaptersResponse(w http.ResponseWriter) error
}

type ListConnections200JSONResponse added in v0.4.0

type ListConnections200JSONResponse ConnectionListResponse

func (ListConnections200JSONResponse) VisitListConnectionsResponse added in v0.4.0

func (response ListConnections200JSONResponse) VisitListConnectionsResponse(w http.ResponseWriter) error

type ListConnections400JSONResponse added in v0.4.0

type ListConnections400JSONResponse ErrorResponse

func (ListConnections400JSONResponse) VisitListConnectionsResponse added in v0.4.0

func (response ListConnections400JSONResponse) VisitListConnectionsResponse(w http.ResponseWriter) error

type ListConnections401JSONResponse added in v0.4.0

type ListConnections401JSONResponse ErrorResponse

func (ListConnections401JSONResponse) VisitListConnectionsResponse added in v0.4.0

func (response ListConnections401JSONResponse) VisitListConnectionsResponse(w http.ResponseWriter) error

type ListConnections403JSONResponse added in v0.4.0

type ListConnections403JSONResponse ErrorResponse

func (ListConnections403JSONResponse) VisitListConnectionsResponse added in v0.4.0

func (response ListConnections403JSONResponse) VisitListConnectionsResponse(w http.ResponseWriter) error

type ListConnections500JSONResponse added in v0.4.0

type ListConnections500JSONResponse ErrorResponse

func (ListConnections500JSONResponse) VisitListConnectionsResponse added in v0.4.0

func (response ListConnections500JSONResponse) VisitListConnectionsResponse(w http.ResponseWriter) error

type ListConnectionsRequestObject added in v0.4.0

type ListConnectionsRequestObject struct {
}

type ListConnectionsResponseObject added in v0.4.0

type ListConnectionsResponseObject interface {
	VisitListConnectionsResponse(w http.ResponseWriter) error
}

type ListNodes200JSONResponse added in v0.6.0

type ListNodes200JSONResponse NodeListResponse

func (ListNodes200JSONResponse) VisitListNodesResponse added in v0.6.0

func (response ListNodes200JSONResponse) VisitListNodesResponse(w http.ResponseWriter) error

type ListNodes400JSONResponse added in v0.6.0

type ListNodes400JSONResponse ErrorResponse

func (ListNodes400JSONResponse) VisitListNodesResponse added in v0.6.0

func (response ListNodes400JSONResponse) VisitListNodesResponse(w http.ResponseWriter) error

type ListNodes401JSONResponse added in v0.6.0

type ListNodes401JSONResponse ErrorResponse

func (ListNodes401JSONResponse) VisitListNodesResponse added in v0.6.0

func (response ListNodes401JSONResponse) VisitListNodesResponse(w http.ResponseWriter) error

type ListNodes500JSONResponse added in v0.6.0

type ListNodes500JSONResponse ErrorResponse

func (ListNodes500JSONResponse) VisitListNodesResponse added in v0.6.0

func (response ListNodes500JSONResponse) VisitListNodesResponse(w http.ResponseWriter) error

type ListNodesRequestObject added in v0.6.0

type ListNodesRequestObject struct {
}

type ListNodesResponseObject added in v0.6.0

type ListNodesResponseObject interface {
	VisitListNodesResponse(w http.ResponseWriter) error
}

type ListOffers200JSONResponse added in v0.4.0

type ListOffers200JSONResponse OfferListResponse

func (ListOffers200JSONResponse) VisitListOffersResponse added in v0.4.0

func (response ListOffers200JSONResponse) VisitListOffersResponse(w http.ResponseWriter) error

type ListOffers400JSONResponse added in v0.4.0

type ListOffers400JSONResponse ErrorResponse

func (ListOffers400JSONResponse) VisitListOffersResponse added in v0.4.0

func (response ListOffers400JSONResponse) VisitListOffersResponse(w http.ResponseWriter) error

type ListOffers401JSONResponse added in v0.4.0

type ListOffers401JSONResponse ErrorResponse

func (ListOffers401JSONResponse) VisitListOffersResponse added in v0.4.0

func (response ListOffers401JSONResponse) VisitListOffersResponse(w http.ResponseWriter) error

type ListOffers403JSONResponse added in v0.4.0

type ListOffers403JSONResponse ErrorResponse

func (ListOffers403JSONResponse) VisitListOffersResponse added in v0.4.0

func (response ListOffers403JSONResponse) VisitListOffersResponse(w http.ResponseWriter) error

type ListOffers502JSONResponse added in v0.4.0

type ListOffers502JSONResponse ErrorResponse

func (ListOffers502JSONResponse) VisitListOffersResponse added in v0.4.0

func (response ListOffers502JSONResponse) VisitListOffersResponse(w http.ResponseWriter) error

type ListOffersRequestObject added in v0.4.0

type ListOffersRequestObject struct {
}

type ListOffersResponseObject added in v0.4.0

type ListOffersResponseObject interface {
	VisitListOffersResponse(w http.ResponseWriter) error
}

type ListRunEvents200JSONResponse added in v0.4.0

type ListRunEvents200JSONResponse EventListResponse

func (ListRunEvents200JSONResponse) VisitListRunEventsResponse added in v0.4.0

func (response ListRunEvents200JSONResponse) VisitListRunEventsResponse(w http.ResponseWriter) error

type ListRunEvents400JSONResponse added in v0.4.0

type ListRunEvents400JSONResponse ErrorResponse

func (ListRunEvents400JSONResponse) VisitListRunEventsResponse added in v0.4.0

func (response ListRunEvents400JSONResponse) VisitListRunEventsResponse(w http.ResponseWriter) error

type ListRunEvents401JSONResponse added in v0.4.0

type ListRunEvents401JSONResponse ErrorResponse

func (ListRunEvents401JSONResponse) VisitListRunEventsResponse added in v0.4.0

func (response ListRunEvents401JSONResponse) VisitListRunEventsResponse(w http.ResponseWriter) error

type ListRunEvents403JSONResponse added in v0.4.0

type ListRunEvents403JSONResponse ErrorResponse

func (ListRunEvents403JSONResponse) VisitListRunEventsResponse added in v0.4.0

func (response ListRunEvents403JSONResponse) VisitListRunEventsResponse(w http.ResponseWriter) error

type ListRunEvents500JSONResponse added in v0.4.0

type ListRunEvents500JSONResponse ErrorResponse

func (ListRunEvents500JSONResponse) VisitListRunEventsResponse added in v0.4.0

func (response ListRunEvents500JSONResponse) VisitListRunEventsResponse(w http.ResponseWriter) error

type ListRunEventsRequestObject added in v0.4.0

type ListRunEventsRequestObject struct {
	RunId string `json:"run_id"`
}

type ListRunEventsResponseObject added in v0.4.0

type ListRunEventsResponseObject interface {
	VisitListRunEventsResponse(w http.ResponseWriter) error
}

type ListRuns200JSONResponse added in v0.4.0

type ListRuns200JSONResponse RunListResponse

func (ListRuns200JSONResponse) VisitListRunsResponse added in v0.4.0

func (response ListRuns200JSONResponse) VisitListRunsResponse(w http.ResponseWriter) error

type ListRuns400JSONResponse added in v0.4.0

type ListRuns400JSONResponse ErrorResponse

func (ListRuns400JSONResponse) VisitListRunsResponse added in v0.4.0

func (response ListRuns400JSONResponse) VisitListRunsResponse(w http.ResponseWriter) error

type ListRuns401JSONResponse added in v0.4.0

type ListRuns401JSONResponse ErrorResponse

func (ListRuns401JSONResponse) VisitListRunsResponse added in v0.4.0

func (response ListRuns401JSONResponse) VisitListRunsResponse(w http.ResponseWriter) error

type ListRuns403JSONResponse added in v0.4.0

type ListRuns403JSONResponse ErrorResponse

func (ListRuns403JSONResponse) VisitListRunsResponse added in v0.4.0

func (response ListRuns403JSONResponse) VisitListRunsResponse(w http.ResponseWriter) error

type ListRuns500JSONResponse added in v0.4.0

type ListRuns500JSONResponse ErrorResponse

func (ListRuns500JSONResponse) VisitListRunsResponse added in v0.4.0

func (response ListRuns500JSONResponse) VisitListRunsResponse(w http.ResponseWriter) error

type ListRunsParams added in v0.4.0

type ListRunsParams struct {
	// Cursor Opaque cursor returned by the previous page.
	Cursor string `form:"cursor,omitempty" json:"cursor,omitempty"`
	Limit  int    `form:"limit,omitempty" json:"limit,omitempty"`
}

ListRunsParams defines parameters for ListRuns.

type ListRunsRequestObject added in v0.4.0

type ListRunsRequestObject struct {
	Params ListRunsParams
}

type ListRunsResponseObject added in v0.4.0

type ListRunsResponseObject interface {
	VisitListRunsResponse(w http.ResponseWriter) error
}

type ListWorkloadRevisions200JSONResponse added in v0.4.0

type ListWorkloadRevisions200JSONResponse WorkloadRevisionListResponse

func (ListWorkloadRevisions200JSONResponse) VisitListWorkloadRevisionsResponse added in v0.4.0

func (response ListWorkloadRevisions200JSONResponse) VisitListWorkloadRevisionsResponse(w http.ResponseWriter) error

type ListWorkloadRevisions400JSONResponse added in v0.4.0

type ListWorkloadRevisions400JSONResponse ErrorResponse

func (ListWorkloadRevisions400JSONResponse) VisitListWorkloadRevisionsResponse added in v0.4.0

func (response ListWorkloadRevisions400JSONResponse) VisitListWorkloadRevisionsResponse(w http.ResponseWriter) error

type ListWorkloadRevisions401JSONResponse added in v0.4.0

type ListWorkloadRevisions401JSONResponse ErrorResponse

func (ListWorkloadRevisions401JSONResponse) VisitListWorkloadRevisionsResponse added in v0.4.0

func (response ListWorkloadRevisions401JSONResponse) VisitListWorkloadRevisionsResponse(w http.ResponseWriter) error

type ListWorkloadRevisions403JSONResponse added in v0.4.0

type ListWorkloadRevisions403JSONResponse ErrorResponse

func (ListWorkloadRevisions403JSONResponse) VisitListWorkloadRevisionsResponse added in v0.4.0

func (response ListWorkloadRevisions403JSONResponse) VisitListWorkloadRevisionsResponse(w http.ResponseWriter) error

type ListWorkloadRevisions500JSONResponse added in v0.4.0

type ListWorkloadRevisions500JSONResponse ErrorResponse

func (ListWorkloadRevisions500JSONResponse) VisitListWorkloadRevisionsResponse added in v0.4.0

func (response ListWorkloadRevisions500JSONResponse) VisitListWorkloadRevisionsResponse(w http.ResponseWriter) error

type ListWorkloadRevisions501JSONResponse added in v0.4.0

type ListWorkloadRevisions501JSONResponse ErrorResponse

func (ListWorkloadRevisions501JSONResponse) VisitListWorkloadRevisionsResponse added in v0.4.0

func (response ListWorkloadRevisions501JSONResponse) VisitListWorkloadRevisionsResponse(w http.ResponseWriter) error

type ListWorkloadRevisionsRequestObject added in v0.4.0

type ListWorkloadRevisionsRequestObject struct {
	WorkloadId string `json:"workload_id"`
}

type ListWorkloadRevisionsResponseObject added in v0.4.0

type ListWorkloadRevisionsResponseObject interface {
	VisitListWorkloadRevisionsResponse(w http.ResponseWriter) error
}

type MemoryRequirement added in v0.4.0

type MemoryRequirement struct {
	MinBytes int64 `json:"min_bytes"`
}

MemoryRequirement defines model for MemoryRequirement.

type MiddlewareFunc added in v0.4.0

type MiddlewareFunc func(http.Handler) http.Handler

type NetworkCapabilities added in v0.4.0

type NetworkCapabilities struct {
	Inbound    NetworkCapabilitiesInbound `json:"inbound"`
	Protocols  []string                   `json:"protocols,omitempty"`
	PublicIpv4 bool                       `json:"public_ipv4"`
}

NetworkCapabilities defines model for NetworkCapabilities.

type NetworkCapabilitiesInbound added in v0.4.0

type NetworkCapabilitiesInbound string

NetworkCapabilitiesInbound defines model for NetworkCapabilities.Inbound.

const (
	NetworkCapabilitiesInboundNone       NetworkCapabilitiesInbound = "none"
	NetworkCapabilitiesInboundPublicPort NetworkCapabilitiesInbound = "public_port"
)

Defines values for NetworkCapabilitiesInbound.

func (NetworkCapabilitiesInbound) Valid added in v0.4.0

func (e NetworkCapabilitiesInbound) Valid() bool

Valid indicates whether the value is a known member of the NetworkCapabilitiesInbound enum.

type NetworkDownloadRequirement added in v0.4.0

type NetworkDownloadRequirement struct {
	AllowUnknown             bool                            `json:"allow_unknown"`
	MaxMeasurementAgeSeconds int64                           `json:"max_measurement_age_seconds"`
	MinP10Mbps               float64                         `json:"min_p10_mbps"`
	Scope                    NetworkDownloadRequirementScope `json:"scope"`
}

NetworkDownloadRequirement defines model for NetworkDownloadRequirement.

type NetworkDownloadRequirementScope added in v0.4.0

type NetworkDownloadRequirementScope string

NetworkDownloadRequirementScope defines model for NetworkDownloadRequirement.Scope.

const (
	NetworkDownloadRequirementScopeObjectStore    NetworkDownloadRequirementScope = "object_store"
	NetworkDownloadRequirementScopePublicInternet NetworkDownloadRequirementScope = "public_internet"
	NetworkDownloadRequirementScopeRegistry       NetworkDownloadRequirementScope = "registry"
)

Defines values for NetworkDownloadRequirementScope.

func (NetworkDownloadRequirementScope) Valid added in v0.4.0

Valid indicates whether the value is a known member of the NetworkDownloadRequirementScope enum.

type NetworkFact added in v0.4.0

type NetworkFact struct {
	Confidence  float64          `json:"confidence"`
	ObservedAt  time.Time        `json:"observed_at"`
	SampleCount int              `json:"sample_count"`
	Scope       NetworkFactScope `json:"scope"`
	Source      string           `json:"source"`
	Statistic   string           `json:"statistic"`
	ValidUntil  time.Time        `json:"valid_until"`
	ValueMbps   float64          `json:"value_mbps"`
}

NetworkFact defines model for NetworkFact.

type NetworkFactScope added in v0.4.0

type NetworkFactScope string

NetworkFactScope defines model for NetworkFact.Scope.

const (
	NetworkFactScopeObjectStore    NetworkFactScope = "object_store"
	NetworkFactScopePublicInternet NetworkFactScope = "public_internet"
	NetworkFactScopeRegistry       NetworkFactScope = "registry"
)

Defines values for NetworkFactScope.

func (NetworkFactScope) Valid added in v0.4.0

func (e NetworkFactScope) Valid() bool

Valid indicates whether the value is a known member of the NetworkFactScope enum.

type NetworkFacts added in v0.4.0

type NetworkFacts struct {
	Download []NetworkFact `json:"download,omitempty"`
}

NetworkFacts defines model for NetworkFacts.

type NetworkRequirements added in v0.4.0

type NetworkRequirements struct {
	Download NetworkDownloadRequirement `json:"download,omitempty"`
	Inbound  NetworkRequirementsInbound `json:"inbound"`
}

NetworkRequirements defines model for NetworkRequirements.

type NetworkRequirementsInbound added in v0.4.0

type NetworkRequirementsInbound string

NetworkRequirementsInbound defines model for NetworkRequirements.Inbound.

const (
	NetworkRequirementsInboundNone       NetworkRequirementsInbound = "none"
	NetworkRequirementsInboundPublicPort NetworkRequirementsInbound = "public_port"
)

Defines values for NetworkRequirementsInbound.

func (NetworkRequirementsInbound) Valid added in v0.4.0

func (e NetworkRequirementsInbound) Valid() bool

Valid indicates whether the value is a known member of the NetworkRequirementsInbound enum.

type NodeBootstrapResponse added in v0.6.0

type NodeBootstrapResponse struct {
	AgentVersion    string `json:"agent_version"`
	ControlPlaneUrl string `json:"control_plane_url"`

	// EnrollmentToken Short-lived and redeemable once. It is returned exactly this once and is never stored in a readable form.
	EnrollmentToken string `json:"enrollment_token"`
	Generation      int64  `json:"generation"`
	NodeId          string `json:"node_id"`
	RentalId        string `json:"rental_id"`
}

NodeBootstrapResponse defines model for NodeBootstrapResponse.

type NodeListResponse added in v0.6.0

type NodeListResponse struct {
	Nodes []NodeSummary `json:"nodes"`
}

NodeListResponse defines model for NodeListResponse.

type NodeRegistry added in v0.6.0

type NodeRegistry interface {
	Invite(ctx context.Context, invitation node.Invitation) (capability.NodeBootstrap, error)
	List(ctx context.Context) ([]node.Record, error)
}

NodeRegistry is the operator-facing half of the node registry. The agent protocol is a separate handler with separate credentials; these routes are for the person who decides which machines Mercator may use.

type NodeSummary added in v0.6.0

type NodeSummary struct {
	Accelerators     int    `json:"accelerators,omitempty"`
	AgentVersion     string `json:"agent_version,omitempty"`
	ContainerRuntime string `json:"container_runtime,omitempty"`

	// DiskFreeBytes The room this node last measured, always stated. It is zero unless disk_report is measured, because bytes nobody established are not room: it is what the node's offer advertises, so a node with none wins no placement that declares a disk floor. Zero with disk_report measured is a machine that is full.
	DiskFreeBytes int64 `json:"disk_free_bytes"`

	// DiskReport What is known about the room on the filesystem this node's daemon keeps content on, which is three answers and not two. never_reported is an identity nobody has heard from yet, so nothing has been measured because nothing has been asked. unmeasurable is a node that answered and could not measure: its daemon keeps content somewhere its agent cannot see, which costs it every placement that declares a disk floor and never its membership of the fleet. measured is a number this node established, and zero of it is a full machine.
	DiskReport            NodeSummaryDiskReport `json:"disk_report"`
	Generation            int64                 `json:"generation"`
	Id                    string                `json:"id"`
	LastHeartbeatAt       time.Time             `json:"last_heartbeat_at,omitempty"`
	LeaseExpires          time.Time             `json:"lease_expires,omitempty"`
	RentalId              string                `json:"rental_id"`
	ShadowPriceUsdPerHour float32               `json:"shadow_price_usd_per_hour"`

	// State What the control plane believes about this node. A lost node is unobserved, not dead.
	State NodeSummaryState `json:"state"`
}

NodeSummary defines model for NodeSummary.

type NodeSummaryDiskReport added in v0.6.0

type NodeSummaryDiskReport string

NodeSummaryDiskReport What is known about the room on the filesystem this node's daemon keeps content on, which is three answers and not two. never_reported is an identity nobody has heard from yet, so nothing has been measured because nothing has been asked. unmeasurable is a node that answered and could not measure: its daemon keeps content somewhere its agent cannot see, which costs it every placement that declares a disk floor and never its membership of the fleet. measured is a number this node established, and zero of it is a full machine.

const (
	Measured      NodeSummaryDiskReport = "measured"
	NeverReported NodeSummaryDiskReport = "never_reported"
	Unmeasurable  NodeSummaryDiskReport = "unmeasurable"
)

Defines values for NodeSummaryDiskReport.

func (NodeSummaryDiskReport) Valid added in v0.6.0

func (e NodeSummaryDiskReport) Valid() bool

Valid indicates whether the value is a known member of the NodeSummaryDiskReport enum.

type NodeSummaryState added in v0.6.0

type NodeSummaryState string

NodeSummaryState What the control plane believes about this node. A lost node is unobserved, not dead.

const (
	Enrolling NodeSummaryState = "enrolling"
	Lost      NodeSummaryState = "lost"
	Ready     NodeSummaryState = "ready"
	Retired   NodeSummaryState = "retired"
)

Defines values for NodeSummaryState.

func (NodeSummaryState) Valid added in v0.6.0

func (e NodeSummaryState) Valid() bool

Valid indicates whether the value is a known member of the NodeSummaryState enum.

type ObservabilityCapabilities added in v0.4.0

type ObservabilityCapabilities struct {
	Logs    string `json:"logs"`
	Metrics string `json:"metrics"`
	Shell   string `json:"shell"`
}

ObservabilityCapabilities defines model for ObservabilityCapabilities.

type OfferAggregator added in v0.4.0

type OfferAggregator interface {
	AggregateOffers(context.Context, adapter.OfferRequest) (broker.OfferAggregation, error)
}

type OfferListResponse added in v0.4.0

type OfferListResponse struct {
	Failures []ConnectionFailure `json:"failures"`
	Offers   []OfferSnapshot     `json:"offers"`
}

OfferListResponse defines model for OfferListResponse.

type OfferSnapshot added in v0.4.0

type OfferSnapshot = domain.OfferSnapshot

OfferSnapshot defines model for OfferSnapshot.

type Option

type Option func(*Server)

func WithAdapterManifests added in v0.4.0

func WithAdapterManifests(manifests func() []adapter.Manifest) Option

WithAdapterManifests wires the registered adapters' onboarding manifests served by GET /v1/adapters (in practice broker.Factory.Manifests).

func WithAdminAddr added in v0.6.0

func WithAdminAddr(addr string) Option

WithAdminAddr names the local address of the listener the administrative operations answer on. The address must be the one a listener is actually bound to, wildcards resolved, because it is compared against the local address of each accepted connection.

Without it every route answers on every listener, which is what a loopback deployment with one listener wants. The process entrypoint is what refuses to start a non-loopback deployment that has not set one, because only it knows the public address.

func WithBearerAuth

func WithBearerAuth(token string) Option

func WithNodes added in v0.6.0

func WithNodes(registry NodeRegistry) Option

WithNodes enables the node endpoints. A Mercator without a node registry serves 404 for them rather than pretending nodes could exist.

func WithReportSigner

func WithReportSigner(signer *reporting.Signer) Option

WithReportSigner wires the per-run token signer used to authenticate the POST /v1/runs/{id}/report ingest endpoint.

func WithVerifier

func WithVerifier(verifier connectionVerifier) Option

WithVerifier wires the connection verifier (the Broker) the server uses to validate a connection during the authorize flow.

func WithWebAuth added in v0.3.0

func WithWebAuth(auth WebAuth) Option

WithWebAuth mounts the OIDC human-login surface. Session-cookie requests are then accepted by the API gate with the signed-in email as the principal subject, and unauthenticated console page loads are routed into /auth/login.

type PlacementPolicy added in v0.4.0

type PlacementPolicy struct {
	// AllowUnknownPricing Whether this Run would rather run on a machine nobody has quoted a price for than not run at all. It admits such a candidate and never prefers one: an unpriced candidate ranks behind every candidate somebody priced, and it cannot clear max_expected_cost_usd, because a bound on dollars is not cleared by a candidate that has none.
	AllowUnknownPricing bool `json:"allow_unknown_pricing,omitempty"`

	// ExpectedReadySeconds How long this workload takes to become ready for work once its process is running. It is the only prediction of the application-ready stage there is: readiness is the application's own semantics, so the workload is the only authority that can state it, and a Run that states nothing is predicted nothing.
	ExpectedReadySeconds   float64 `json:"expected_ready_seconds,omitempty"`
	ExpectedRuntimeSeconds float64 `json:"expected_runtime_seconds,omitempty"`

	// Group The family of Runs this one belongs to and the most of that family Mercator may have holding capacity at once. It is a bound on the work rather than a request for a machine: a member whose family is already that wide is queued GROUP_AT_PARALLELISM even where the fleet has capacity standing idle, and the wait ends when a member of the same family finishes. Every member states the width, because a group is a label the work carries rather than an object an operator creates: there is nothing to register before submitting, and a name without a width is refused with RUN_GROUP_INCOMPLETE. The name is deployment-global.
	Group              RunGroup `json:"group,omitempty"`
	MaxExpectedCostUsd float64  `json:"max_expected_cost_usd,omitempty"`
	MaxP90StartSeconds float64  `json:"max_p90_start_seconds,omitempty"`

	// ServiceClass The kind of work this Run is, which is the only thing that says what waiting is worth to it. Every class declares its own exchange rate, and the score is computed over those rates: interactive prices a second of waiting to the start at twenty times the rent of the machine doing the waiting, standard at that rent, experimental and batch price it to the finish at twice and a fifth of it, and opportunistic prices it at nothing and takes whatever costs least. A class Mercator does not know is refused with SERVICE_CLASS_UNKNOWN rather than ranked on price alone. Omitted means standard.
	ServiceClass PlacementPolicyServiceClass `json:"service_class"`
}

PlacementPolicy defines model for PlacementPolicy.

type PlacementPolicyServiceClass added in v0.6.0

type PlacementPolicyServiceClass string

PlacementPolicyServiceClass The kind of work this Run is, which is the only thing that says what waiting is worth to it. Every class declares its own exchange rate, and the score is computed over those rates: interactive prices a second of waiting to the start at twenty times the rent of the machine doing the waiting, standard at that rent, experimental and batch price it to the finish at twice and a fifth of it, and opportunistic prices it at nothing and takes whatever costs least. A class Mercator does not know is refused with SERVICE_CLASS_UNKNOWN rather than ranked on price alone. Omitted means standard.

const (
	Batch         PlacementPolicyServiceClass = "batch"
	Experimental  PlacementPolicyServiceClass = "experimental"
	Interactive   PlacementPolicyServiceClass = "interactive"
	Opportunistic PlacementPolicyServiceClass = "opportunistic"
	Standard      PlacementPolicyServiceClass = "standard"
)

Defines values for PlacementPolicyServiceClass.

func (PlacementPolicyServiceClass) Valid added in v0.6.0

Valid indicates whether the value is a known member of the PlacementPolicyServiceClass enum.

type PlacementPreviewRequest added in v0.4.0

type PlacementPreviewRequest struct {
	RunId    string           `json:"run_id,omitempty"`
	Workload WorkloadRevision `json:"workload"`
}

PlacementPreviewRequest defines model for PlacementPreviewRequest.

type PlacementPreviewResponse added in v0.4.0

type PlacementPreviewResponse struct {
	Decision BookingDecision `json:"decision"`
}

PlacementPreviewResponse defines model for PlacementPreviewResponse.

type Platform added in v0.4.0

type Platform struct {
	Architecture string `json:"architecture"`
	Os           string `json:"os"`
}

Platform defines model for Platform.

type PortSpec added in v0.4.0

type PortSpec struct {
	ContainerPort int              `json:"container_port"`
	Exposure      PortSpecExposure `json:"exposure"`
	Name          string           `json:"name"`
	Protocol      string           `json:"protocol"`
}

PortSpec defines model for PortSpec.

type PortSpecExposure added in v0.4.0

type PortSpecExposure string

PortSpecExposure defines model for PortSpec.Exposure.

const (
	None    PortSpecExposure = "none"
	Private PortSpecExposure = "private"
	Public  PortSpecExposure = "public"
)

Defines values for PortSpecExposure.

func (PortSpecExposure) Valid added in v0.4.0

func (e PortSpecExposure) Valid() bool

Valid indicates whether the value is a known member of the PortSpecExposure enum.

type PreviewPlacement200JSONResponse added in v0.4.0

type PreviewPlacement200JSONResponse PlacementPreviewResponse

func (PreviewPlacement200JSONResponse) VisitPreviewPlacementResponse added in v0.4.0

func (response PreviewPlacement200JSONResponse) VisitPreviewPlacementResponse(w http.ResponseWriter) error

type PreviewPlacement400JSONResponse added in v0.4.0

type PreviewPlacement400JSONResponse ErrorResponse

func (PreviewPlacement400JSONResponse) VisitPreviewPlacementResponse added in v0.4.0

func (response PreviewPlacement400JSONResponse) VisitPreviewPlacementResponse(w http.ResponseWriter) error

type PreviewPlacement401JSONResponse added in v0.4.0

type PreviewPlacement401JSONResponse ErrorResponse

func (PreviewPlacement401JSONResponse) VisitPreviewPlacementResponse added in v0.4.0

func (response PreviewPlacement401JSONResponse) VisitPreviewPlacementResponse(w http.ResponseWriter) error

type PreviewPlacement403JSONResponse added in v0.4.0

type PreviewPlacement403JSONResponse ErrorResponse

func (PreviewPlacement403JSONResponse) VisitPreviewPlacementResponse added in v0.4.0

func (response PreviewPlacement403JSONResponse) VisitPreviewPlacementResponse(w http.ResponseWriter) error

type PreviewPlacement413JSONResponse added in v0.4.0

type PreviewPlacement413JSONResponse ErrorResponse

func (PreviewPlacement413JSONResponse) VisitPreviewPlacementResponse added in v0.4.0

func (response PreviewPlacement413JSONResponse) VisitPreviewPlacementResponse(w http.ResponseWriter) error

type PreviewPlacement502JSONResponse added in v0.4.0

type PreviewPlacement502JSONResponse ErrorResponse

func (PreviewPlacement502JSONResponse) VisitPreviewPlacementResponse added in v0.4.0

func (response PreviewPlacement502JSONResponse) VisitPreviewPlacementResponse(w http.ResponseWriter) error

type PreviewPlacementJSONRequestBody added in v0.4.0

type PreviewPlacementJSONRequestBody = PlacementPreviewRequest

PreviewPlacementJSONRequestBody defines body for PreviewPlacement for application/json ContentType.

type PreviewPlacementRequestObject added in v0.4.0

type PreviewPlacementRequestObject struct {
	Body *PreviewPlacementJSONRequestBody
}

type PreviewPlacementResponseObject added in v0.4.0

type PreviewPlacementResponseObject interface {
	VisitPreviewPlacementResponse(w http.ResponseWriter) error
}

type PriceModel added in v0.4.0

type PriceModel struct {
	Currency             string  `json:"currency"`
	GranularitySeconds   int64   `json:"granularity_seconds"`
	Known                bool    `json:"known"`
	MinimumChargeSeconds int64   `json:"minimum_charge_seconds"`
	RatePerSecondUsd     float64 `json:"rate_per_second_usd"`
	SetupFeeUsd          float64 `json:"setup_fee_usd"`
}

PriceModel defines model for PriceModel.

type PricingCapabilities added in v0.4.0

type PricingCapabilities struct {
	Known bool `json:"known"`
}

PricingCapabilities defines model for PricingCapabilities.

type QueueSnapshot added in v0.4.0

type QueueSnapshot struct {
	ActiveSlots       int     `json:"active_slots"`
	QueuedWorkSeconds float64 `json:"queued_work_seconds"`
}

QueueSnapshot defines model for QueueSnapshot.

type QueuedAhead added in v0.6.0

type QueuedAhead = domain.QueuedAhead

QueuedAhead defines model for QueuedAhead.

type RefreshRun200JSONResponse added in v0.4.0

type RefreshRun200JSONResponse RunResponse

func (RefreshRun200JSONResponse) VisitRefreshRunResponse added in v0.4.0

func (response RefreshRun200JSONResponse) VisitRefreshRunResponse(w http.ResponseWriter) error

type RefreshRun400JSONResponse added in v0.4.0

type RefreshRun400JSONResponse ErrorResponse

func (RefreshRun400JSONResponse) VisitRefreshRunResponse added in v0.4.0

func (response RefreshRun400JSONResponse) VisitRefreshRunResponse(w http.ResponseWriter) error

type RefreshRun401JSONResponse added in v0.4.0

type RefreshRun401JSONResponse ErrorResponse

func (RefreshRun401JSONResponse) VisitRefreshRunResponse added in v0.4.0

func (response RefreshRun401JSONResponse) VisitRefreshRunResponse(w http.ResponseWriter) error

type RefreshRun403JSONResponse added in v0.4.0

type RefreshRun403JSONResponse ErrorResponse

func (RefreshRun403JSONResponse) VisitRefreshRunResponse added in v0.4.0

func (response RefreshRun403JSONResponse) VisitRefreshRunResponse(w http.ResponseWriter) error

type RefreshRun502JSONResponse added in v0.4.0

type RefreshRun502JSONResponse ErrorResponse

func (RefreshRun502JSONResponse) VisitRefreshRunResponse added in v0.4.0

func (response RefreshRun502JSONResponse) VisitRefreshRunResponse(w http.ResponseWriter) error

type RefreshRunRequestObject added in v0.4.0

type RefreshRunRequestObject struct {
	RunId string `json:"run_id"`
}

type RefreshRunResponseObject added in v0.4.0

type RefreshRunResponseObject interface {
	VisitRefreshRunResponse(w http.ResponseWriter) error
}

type ReliabilityEvidence added in v0.4.0

type ReliabilityEvidence struct {
	// Interruptions One share of a machine's history somebody measured, and how much the publisher of that measurement stands behind it. The confidence is what says the measurement happened at all: a rate of zero stated at a confidence somebody owns is a machine measured and never seen to fail, and a rate nobody stands behind is silence.
	Interruptions StatedRate `json:"interruptions,omitempty"`

	// StartFailures One share of a machine's history somebody measured, and how much the publisher of that measurement stands behind it. The confidence is what says the measurement happened at all: a rate of zero stated at a confidence somebody owns is a machine measured and never seen to fail, and a rate nobody stands behind is silence.
	StartFailures StatedRate `json:"start_failures,omitempty"`
}

ReliabilityEvidence The risk history a machine's publisher states about it. Each rate stands on its own measurement, because a publisher measures what it measures, and an unmeasured rate is absent rather than zero. The whole history is absent when a publisher has measured nothing, which is every provider in this tree today, so a reader must treat no history and a history of zeroes as different answers.

type ReplaySink202JSONResponse added in v0.4.0

type ReplaySink202JSONResponse SinkResult

func (ReplaySink202JSONResponse) VisitReplaySinkResponse added in v0.4.0

func (response ReplaySink202JSONResponse) VisitReplaySinkResponse(w http.ResponseWriter) error

type ReplaySink400JSONResponse added in v0.4.0

type ReplaySink400JSONResponse ErrorResponse

func (ReplaySink400JSONResponse) VisitReplaySinkResponse added in v0.4.0

func (response ReplaySink400JSONResponse) VisitReplaySinkResponse(w http.ResponseWriter) error

type ReplaySink401JSONResponse added in v0.4.0

type ReplaySink401JSONResponse ErrorResponse

func (ReplaySink401JSONResponse) VisitReplaySinkResponse added in v0.4.0

func (response ReplaySink401JSONResponse) VisitReplaySinkResponse(w http.ResponseWriter) error

type ReplaySink413JSONResponse added in v0.4.0

type ReplaySink413JSONResponse ErrorResponse

func (ReplaySink413JSONResponse) VisitReplaySinkResponse added in v0.4.0

func (response ReplaySink413JSONResponse) VisitReplaySinkResponse(w http.ResponseWriter) error

type ReplaySink501JSONResponse added in v0.4.0

type ReplaySink501JSONResponse ErrorResponse

func (ReplaySink501JSONResponse) VisitReplaySinkResponse added in v0.4.0

func (response ReplaySink501JSONResponse) VisitReplaySinkResponse(w http.ResponseWriter) error

type ReplaySink502JSONResponse added in v0.4.0

type ReplaySink502JSONResponse ErrorResponse

func (ReplaySink502JSONResponse) VisitReplaySinkResponse added in v0.4.0

func (response ReplaySink502JSONResponse) VisitReplaySinkResponse(w http.ResponseWriter) error

type ReplaySinkJSONRequestBody added in v0.4.0

type ReplaySinkJSONRequestBody = ReplaySinkRequest

ReplaySinkJSONRequestBody defines body for ReplaySink for application/json ContentType.

type ReplaySinkRequest added in v0.4.0

type ReplaySinkRequest struct {
	FromExclusive int    `json:"from_exclusive,omitempty"`
	Limit         int    `json:"limit,omitempty"`
	ReplayId      string `json:"replay_id,omitempty"`
}

ReplaySinkRequest defines model for ReplaySinkRequest.

type ReplaySinkRequestObject added in v0.4.0

type ReplaySinkRequestObject struct {
	SinkId string `json:"sink_id"`
	Body   *ReplaySinkJSONRequestBody
}

type ReplaySinkResponseObject added in v0.4.0

type ReplaySinkResponseObject interface {
	VisitReplaySinkResponse(w http.ResponseWriter) error
}

type ReportRun202JSONResponse added in v0.4.0

type ReportRun202JSONResponse struct {
	Recorded bool `json:"recorded"`
}

func (ReportRun202JSONResponse) VisitReportRunResponse added in v0.4.0

func (response ReportRun202JSONResponse) VisitReportRunResponse(w http.ResponseWriter) error

type ReportRun400JSONResponse added in v0.4.0

type ReportRun400JSONResponse ErrorResponse

func (ReportRun400JSONResponse) VisitReportRunResponse added in v0.4.0

func (response ReportRun400JSONResponse) VisitReportRunResponse(w http.ResponseWriter) error

type ReportRun401JSONResponse added in v0.4.0

type ReportRun401JSONResponse ErrorResponse

func (ReportRun401JSONResponse) VisitReportRunResponse added in v0.4.0

func (response ReportRun401JSONResponse) VisitReportRunResponse(w http.ResponseWriter) error

type ReportRun404JSONResponse added in v0.4.0

type ReportRun404JSONResponse ErrorResponse

func (ReportRun404JSONResponse) VisitReportRunResponse added in v0.4.0

func (response ReportRun404JSONResponse) VisitReportRunResponse(w http.ResponseWriter) error

type ReportRun409JSONResponse added in v0.4.5

type ReportRun409JSONResponse ErrorResponse

func (ReportRun409JSONResponse) VisitReportRunResponse added in v0.4.5

func (response ReportRun409JSONResponse) VisitReportRunResponse(w http.ResponseWriter) error

type ReportRun413JSONResponse added in v0.4.0

type ReportRun413JSONResponse ErrorResponse

func (ReportRun413JSONResponse) VisitReportRunResponse added in v0.4.0

func (response ReportRun413JSONResponse) VisitReportRunResponse(w http.ResponseWriter) error

type ReportRun501JSONResponse added in v0.4.0

type ReportRun501JSONResponse ErrorResponse

func (ReportRun501JSONResponse) VisitReportRunResponse added in v0.4.0

func (response ReportRun501JSONResponse) VisitReportRunResponse(w http.ResponseWriter) error

type ReportRun502JSONResponse added in v0.4.0

type ReportRun502JSONResponse ErrorResponse

func (ReportRun502JSONResponse) VisitReportRunResponse added in v0.4.0

func (response ReportRun502JSONResponse) VisitReportRunResponse(w http.ResponseWriter) error

type ReportRunJSONRequestBody added in v0.4.0

type ReportRunJSONRequestBody = ReportRunRequest

ReportRunJSONRequestBody defines body for ReportRun for application/json ContentType.

type ReportRunParams added in v0.4.0

type ReportRunParams struct {
	// Authorization Per-run bearer token issued in the launch reporting environment.
	Authorization string `json:"Authorization,omitempty"`
}

ReportRunParams defines parameters for ReportRun.

type ReportRunRequest added in v0.4.0

type ReportRunRequest struct {
	Data json.RawMessage `json:"data,omitempty"`

	// ExitCode Required when type is exit and forbidden for every other report type. The broker records the authoritative outcome and requests cleanup.
	ExitCode *int `json:"exit_code,omitempty"`

	// Type Report kind. The reserved exit kind is terminal and requires exit_code; every other kind is nonterminal and must omit exit_code. The reserved ready kind is the application saying it can do work and requires data.ready_at, the application's own moment: it completes the last stage of a launch, and a readiness with no moment in it leaves that stage with no actual.
	Type string `json:"type"`
}

ReportRunRequest defines model for ReportRunRequest.

type ReportRunRequestObject added in v0.4.0

type ReportRunRequestObject struct {
	RunId  string `json:"run_id"`
	Params ReportRunParams
	Body   *ReportRunJSONRequestBody
}

type ReportRunResponseObject added in v0.4.0

type ReportRunResponseObject interface {
	VisitReportRunResponse(w http.ResponseWriter) error
}

type RequiredHeaderError added in v0.4.0

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

func (*RequiredHeaderError) Error added in v0.4.0

func (e *RequiredHeaderError) Error() string

func (*RequiredHeaderError) Unwrap added in v0.4.0

func (e *RequiredHeaderError) Unwrap() error

type RequiredParamError added in v0.4.0

type RequiredParamError struct {
	ParamName string
}

func (*RequiredParamError) Error added in v0.4.0

func (e *RequiredParamError) Error() string

type ResolveImage200JSONResponse added in v0.4.0

type ResolveImage200JSONResponse ResolveImageResponse

func (ResolveImage200JSONResponse) VisitResolveImageResponse added in v0.4.0

func (response ResolveImage200JSONResponse) VisitResolveImageResponse(w http.ResponseWriter) error

type ResolveImage400JSONResponse added in v0.4.0

type ResolveImage400JSONResponse ErrorResponse

func (ResolveImage400JSONResponse) VisitResolveImageResponse added in v0.4.0

func (response ResolveImage400JSONResponse) VisitResolveImageResponse(w http.ResponseWriter) error

type ResolveImage401JSONResponse added in v0.4.0

type ResolveImage401JSONResponse ErrorResponse

func (ResolveImage401JSONResponse) VisitResolveImageResponse added in v0.4.0

func (response ResolveImage401JSONResponse) VisitResolveImageResponse(w http.ResponseWriter) error

type ResolveImage413JSONResponse added in v0.4.0

type ResolveImage413JSONResponse ErrorResponse

func (ResolveImage413JSONResponse) VisitResolveImageResponse added in v0.4.0

func (response ResolveImage413JSONResponse) VisitResolveImageResponse(w http.ResponseWriter) error

type ResolveImage501JSONResponse added in v0.4.0

type ResolveImage501JSONResponse ErrorResponse

func (ResolveImage501JSONResponse) VisitResolveImageResponse added in v0.4.0

func (response ResolveImage501JSONResponse) VisitResolveImageResponse(w http.ResponseWriter) error

type ResolveImageJSONRequestBody added in v0.4.0

type ResolveImageJSONRequestBody = ResolveImageRequest

ResolveImageJSONRequestBody defines body for ResolveImage for application/json ContentType.

type ResolveImageRequest added in v0.4.0

type ResolveImageRequest struct {
	Image    string `json:"image"`
	Platform string `json:"platform"`
}

ResolveImageRequest defines model for ResolveImageRequest.

type ResolveImageRequestObject added in v0.4.0

type ResolveImageRequestObject struct {
	Body *ResolveImageJSONRequestBody
}

type ResolveImageResponse added in v0.4.0

type ResolveImageResponse struct {
	Image ResolvedImage `json:"image"`
}

ResolveImageResponse defines model for ResolveImageResponse.

type ResolveImageResponseObject added in v0.4.0

type ResolveImageResponseObject interface {
	VisitResolveImageResponse(w http.ResponseWriter) error
}

type ResolvedImage added in v0.4.0

type ResolvedImage = ociresolver.ResolvedImage

ResolvedImage defines model for ResolvedImage.

type ResourceCapabilities added in v0.4.0

type ResourceCapabilities struct {
	GpuVendors []string `json:"gpu_vendors,omitempty"`
}

ResourceCapabilities defines model for ResourceCapabilities.

type ResourceInventory added in v0.4.0

type ResourceInventory struct {
	Accelerators       []AcceleratorInventory `json:"accelerators,omitempty"`
	CpuMillis          int64                  `json:"cpu_millis"`
	EphemeralDiskBytes int64                  `json:"ephemeral_disk_bytes"`
	MemoryBytes        int64                  `json:"memory_bytes"`
}

ResourceInventory defines model for ResourceInventory.

type ResourceRequirements added in v0.4.0

type ResourceRequirements struct {
	Accelerators  []AcceleratorRequirement `json:"accelerators,omitempty"`
	Cpu           CPURequirement           `json:"cpu"`
	EphemeralDisk DiskRequirement          `json:"ephemeral_disk"`

	// Host What a workload needs of the substrate under it rather than of the cards on it: the host promises it will not run without, and the driver its image's own accelerator stack was built against. The host provides the driver and the image provides the stack, so an image built against a newer driver than the machine runs is refused at placement rather than discovered by a process dying on capacity already paid for. Mercator never answers a mismatch by installing a stack onto somebody's host.
	Host   HostRequirements  `json:"host,omitempty"`
	Memory MemoryRequirement `json:"memory"`
}

ResourceRequirements defines model for ResourceRequirements.

type Run added in v0.4.0

type Run = domain.RunRecord

Run defines model for Run.

type RunGroup added in v0.6.0

type RunGroup struct {
	Id string `json:"id,omitempty"`

	// MaxParallel How many members of this family may hold capacity at once. Zero is the absence of a family rather than a family of nothing.
	MaxParallel int `json:"max_parallel,omitempty"`
}

RunGroup The family of Runs this one belongs to and the most of that family Mercator may have holding capacity at once. It is a bound on the work rather than a request for a machine: a member whose family is already that wide is queued GROUP_AT_PARALLELISM even where the fleet has capacity standing idle, and the wait ends when a member of the same family finishes. Every member states the width, because a group is a label the work carries rather than an object an operator creates: there is nothing to register before submitting, and a name without a width is refused with RUN_GROUP_INCOMPLETE. The name is deployment-global.

type RunListResponse added in v0.4.0

type RunListResponse struct {
	// NextCursor Opaque cursor for the next page. Omitted on the final page.
	NextCursor string `json:"next_cursor,omitempty"`
	Runs       []Run  `json:"runs"`
}

RunListResponse defines model for RunListResponse.

type RunResponse added in v0.4.0

type RunResponse struct {
	// Duplicate True when this create was a safe idempotent replay of an existing run.
	Duplicate bool              `json:"duplicate,omitempty"`
	Links     map[string]string `json:"links,omitempty"`

	// Metadata Reserved for per-response metadata.
	Metadata map[string]interface{} `json:"metadata,omitempty"`
	Run      Run                    `json:"run"`

	// RunId Convenience top-level run identifier, equal to run.id. Returned on every run response alongside the full run record.
	RunId string `json:"run_id"`
}

RunResponse defines model for RunResponse.

type RunningBookingEvidence added in v0.6.0

type RunningBookingEvidence struct {
	BookingId string `json:"booking_id"`

	// OverrunSeconds How far past the runtime Mercator enforces this Booking has run. Both remainders above bottom out at zero, so without this the record of a Rental nothing can project is the record a Rental a moment from free writes.
	OverrunSeconds float64 `json:"overrun_seconds,omitempty"`

	// RemainingExpectedRuntimeSeconds The p50 runtime this Booking has left, which is what a projected start behind it is made of.
	RemainingExpectedRuntimeSeconds float64 `json:"remaining_expected_runtime_seconds,omitempty"`

	// RemainingMaxRuntimeSeconds The enforced maximum runtime this Booking has left, which is what a latest start for anything waiting behind it is made of.
	RemainingMaxRuntimeSeconds float64 `json:"remaining_max_runtime_seconds,omitempty"`
	RunId                      string  `json:"run_id"`
}

RunningBookingEvidence The Booking holding the Rental when a decision was made. Its runtimes are what it has left rather than what its Run declared, because a Booking twenty-nine minutes into half an hour is one minute of waiting.

type ScheduleEvidence added in v0.6.0

type ScheduleEvidence struct {
	// Preceding The Bookings already waiting on this Rental, in the order they will run.
	Preceding []WaitingBookingEvidence `json:"preceding,omitempty"`

	// ProjectedStartSeconds How long work arriving at this moment waits for this Rental, projected from where the Bookings above actually are.
	ProjectedStartSeconds float64 `json:"projected_start_seconds"`

	// Running The Booking holding the Rental when a decision was made. Its runtimes are what it has left rather than what its Run declared, because a Booking twenty-nine minutes into half an hour is one minute of waiting.
	Running RunningBookingEvidence `json:"running,omitempty"`

	// Version The schedule version this decision was weighed against. A Booking the decision creates follows it.
	Version int64 `json:"version"`
}

ScheduleEvidence One Rental Schedule as a placement decision read it: the version that answered, the Booking holding the Rental, the Bookings already waiting in front of this Run, and the wait that projects from them. A schedule moves, so the wait a Run was priced was read from one version of it at one moment, and a decision that recorded only the seconds leaves nobody able to retrace them.

type ScoreWeights added in v0.6.0

type ScoreWeights struct {
	CompletionLatencyUsdPerSecond float64 `json:"completion_latency_usd_per_second,omitempty"`
	StartLatencyUsdPerSecond      float64 `json:"start_latency_usd_per_second,omitempty"`

	// UncertaintyPenaltyUsd What one whole point of doubt costs. A point is one answer worth nothing.
	UncertaintyPenaltyUsd float64 `json:"uncertainty_penalty_usd,omitempty"`
}

ScoreWeights The exchange rates one service class declares, which are what a score is computed over. They are recorded on every decision rather than looked up, because a rate that changes would otherwise silently rewrite the arithmetic of every decision already taken. The two reliability terms a score will eventually carry are absent on purpose: probability times the cost of starting again is a derivation over a prediction, and a flat penalty invented for it now would be an unmeasured constant.

type ServeMux added in v0.4.0

type ServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

ServeMux is an abstraction of http.ServeMux.

type Server

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

func (*Server) AuthorizeConnection added in v0.4.0

func (*Server) CancelRun added in v0.4.0

func (*Server) CreateConnection added in v0.4.0

func (*Server) CreateRun added in v0.4.0

func (*Server) CreateWorkload added in v0.4.0

func (*Server) CreateWorkloadRevision added in v0.4.0

func (*Server) DeleteConnection added in v0.4.0

DeleteConnection appends the deleted fact. The event stream itself is retained; the connection service removes sealed credentials atomically.

func (*Server) DeliverSink added in v0.4.0

func (*Server) GetOpenAPI added in v0.4.0

func (*Server) GetRun added in v0.4.0

func (*Server) GetRunDecision added in v0.4.0

func (*Server) GetSinkStatus added in v0.4.0

func (*Server) GetWorkloadRevision added in v0.4.0

func (*Server) HealthLive added in v0.4.0

func (*Server) HealthReady added in v0.4.0

func (*Server) InviteNode added in v0.6.0

InviteNode reserves a node identity and returns the material one machine needs to enroll. The enrollment token is returned exactly this once: it is short-lived, redeemable once, and never stored in a readable form.

func (*Server) ListAdapters added in v0.4.0

ListAdapters serves the registered adapters' onboarding manifests. The list is static per process and sits behind the same /v1 auth gate as everything else.

func (*Server) ListConnections added in v0.4.0

func (*Server) ListNodes added in v0.6.0

ListNodes reports every node identity in this deployment, whatever its state, so an operator sees capacity that never enrolled as readily as capacity that did.

func (*Server) ListOffers added in v0.4.0

func (*Server) ListRunEvents added in v0.4.0

func (*Server) ListRuns added in v0.4.0

func (*Server) ListWorkloadRevisions added in v0.4.0

func (*Server) PreviewPlacement added in v0.4.0

func (*Server) RefreshRun added in v0.4.0

func (*Server) ReplaySink added in v0.4.0

func (*Server) ReportRun added in v0.4.0

func (*Server) ResolveImage added in v0.4.0

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*Server) StreamConsoleEvents added in v0.5.0

func (*Server) WaitRun added in v0.4.0

type ServerInterface added in v0.4.0

type ServerInterface interface {

	// (GET /health/live)
	HealthLive(w http.ResponseWriter, r *http.Request)

	// (GET /health/ready)
	HealthReady(w http.ResponseWriter, r *http.Request)

	// (GET /openapi.json)
	GetOpenAPI(w http.ResponseWriter, r *http.Request)

	// (GET /v1/adapters)
	ListAdapters(w http.ResponseWriter, r *http.Request)

	// (GET /v1/connections)
	ListConnections(w http.ResponseWriter, r *http.Request)

	// (POST /v1/connections)
	CreateConnection(w http.ResponseWriter, r *http.Request, params CreateConnectionParams)

	// (DELETE /v1/connections/{connection_id})
	DeleteConnection(w http.ResponseWriter, r *http.Request, connectionId string)

	// (POST /v1/connections/{connection_id}/authorize)
	AuthorizeConnection(w http.ResponseWriter, r *http.Request, connectionId string)

	// (GET /v1/console/events)
	StreamConsoleEvents(w http.ResponseWriter, r *http.Request, params StreamConsoleEventsParams)

	// (POST /v1/images:resolve)
	ResolveImage(w http.ResponseWriter, r *http.Request)
	// List the nodes enrolled in a deployment
	// (GET /v1/nodes)
	ListNodes(w http.ResponseWriter, r *http.Request)
	// Reserve a node identity and mint its enrollment material
	// (POST /v1/nodes)
	InviteNode(w http.ResponseWriter, r *http.Request)

	// (GET /v1/offers)
	ListOffers(w http.ResponseWriter, r *http.Request)

	// (POST /v1/placements:preview)
	PreviewPlacement(w http.ResponseWriter, r *http.Request)

	// (GET /v1/runs)
	ListRuns(w http.ResponseWriter, r *http.Request, params ListRunsParams)

	// (POST /v1/runs)
	CreateRun(w http.ResponseWriter, r *http.Request, params CreateRunParams)

	// (GET /v1/runs/{run_id})
	GetRun(w http.ResponseWriter, r *http.Request, runId string)

	// (POST /v1/runs/{run_id}/cancel)
	CancelRun(w http.ResponseWriter, r *http.Request, runId string)

	// (GET /v1/runs/{run_id}/decision)
	GetRunDecision(w http.ResponseWriter, r *http.Request, runId string)

	// (GET /v1/runs/{run_id}/events)
	ListRunEvents(w http.ResponseWriter, r *http.Request, runId string)

	// (POST /v1/runs/{run_id}/refresh)
	RefreshRun(w http.ResponseWriter, r *http.Request, runId string)

	// (POST /v1/runs/{run_id}/report)
	ReportRun(w http.ResponseWriter, r *http.Request, runId string, params ReportRunParams)

	// (GET /v1/runs/{run_id}/wait)
	WaitRun(w http.ResponseWriter, r *http.Request, runId string)

	// (GET /v1/sinks/{sink_id})
	GetSinkStatus(w http.ResponseWriter, r *http.Request, sinkId string)

	// (POST /v1/sinks/{sink_id}/deliver)
	DeliverSink(w http.ResponseWriter, r *http.Request, sinkId string)

	// (POST /v1/sinks/{sink_id}/replay)
	ReplaySink(w http.ResponseWriter, r *http.Request, sinkId string)

	// (POST /v1/workloads)
	CreateWorkload(w http.ResponseWriter, r *http.Request, params CreateWorkloadParams)

	// (GET /v1/workloads/{workload_id}/revisions)
	ListWorkloadRevisions(w http.ResponseWriter, r *http.Request, workloadId string)

	// (POST /v1/workloads/{workload_id}/revisions)
	CreateWorkloadRevision(w http.ResponseWriter, r *http.Request, workloadId string, params CreateWorkloadRevisionParams)

	// (GET /v1/workloads/{workload_id}/revisions/{revision_id})
	GetWorkloadRevision(w http.ResponseWriter, r *http.Request, workloadId string, revisionId string)
}

ServerInterface represents all server handlers.

func NewStrictHandler added in v0.4.0

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

func NewStrictHandlerWithOptions added in v0.4.0

func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface

type ServerInterfaceWrapper added in v0.4.0

type ServerInterfaceWrapper struct {
	Handler            ServerInterface
	HandlerMiddlewares []MiddlewareFunc
	ErrorHandlerFunc   func(w http.ResponseWriter, r *http.Request, err error)
}

ServerInterfaceWrapper converts contexts to parameters.

func (*ServerInterfaceWrapper) AuthorizeConnection added in v0.4.0

func (siw *ServerInterfaceWrapper) AuthorizeConnection(w http.ResponseWriter, r *http.Request)

AuthorizeConnection operation middleware

func (*ServerInterfaceWrapper) CancelRun added in v0.4.0

func (siw *ServerInterfaceWrapper) CancelRun(w http.ResponseWriter, r *http.Request)

CancelRun operation middleware

func (*ServerInterfaceWrapper) CreateConnection added in v0.4.0

func (siw *ServerInterfaceWrapper) CreateConnection(w http.ResponseWriter, r *http.Request)

CreateConnection operation middleware

func (*ServerInterfaceWrapper) CreateRun added in v0.4.0

func (siw *ServerInterfaceWrapper) CreateRun(w http.ResponseWriter, r *http.Request)

CreateRun operation middleware

func (*ServerInterfaceWrapper) CreateWorkload added in v0.4.0

func (siw *ServerInterfaceWrapper) CreateWorkload(w http.ResponseWriter, r *http.Request)

CreateWorkload operation middleware

func (*ServerInterfaceWrapper) CreateWorkloadRevision added in v0.4.0

func (siw *ServerInterfaceWrapper) CreateWorkloadRevision(w http.ResponseWriter, r *http.Request)

CreateWorkloadRevision operation middleware

func (*ServerInterfaceWrapper) DeleteConnection added in v0.4.0

func (siw *ServerInterfaceWrapper) DeleteConnection(w http.ResponseWriter, r *http.Request)

DeleteConnection operation middleware

func (*ServerInterfaceWrapper) DeliverSink added in v0.4.0

func (siw *ServerInterfaceWrapper) DeliverSink(w http.ResponseWriter, r *http.Request)

DeliverSink operation middleware

func (*ServerInterfaceWrapper) GetOpenAPI added in v0.4.0

func (siw *ServerInterfaceWrapper) GetOpenAPI(w http.ResponseWriter, r *http.Request)

GetOpenAPI operation middleware

func (*ServerInterfaceWrapper) GetRun added in v0.4.0

GetRun operation middleware

func (*ServerInterfaceWrapper) GetRunDecision added in v0.4.0

func (siw *ServerInterfaceWrapper) GetRunDecision(w http.ResponseWriter, r *http.Request)

GetRunDecision operation middleware

func (*ServerInterfaceWrapper) GetSinkStatus added in v0.4.0

func (siw *ServerInterfaceWrapper) GetSinkStatus(w http.ResponseWriter, r *http.Request)

GetSinkStatus operation middleware

func (*ServerInterfaceWrapper) GetWorkloadRevision added in v0.4.0

func (siw *ServerInterfaceWrapper) GetWorkloadRevision(w http.ResponseWriter, r *http.Request)

GetWorkloadRevision operation middleware

func (*ServerInterfaceWrapper) HealthLive added in v0.4.0

func (siw *ServerInterfaceWrapper) HealthLive(w http.ResponseWriter, r *http.Request)

HealthLive operation middleware

func (*ServerInterfaceWrapper) HealthReady added in v0.4.0

func (siw *ServerInterfaceWrapper) HealthReady(w http.ResponseWriter, r *http.Request)

HealthReady operation middleware

func (*ServerInterfaceWrapper) InviteNode added in v0.6.0

func (siw *ServerInterfaceWrapper) InviteNode(w http.ResponseWriter, r *http.Request)

InviteNode operation middleware

func (*ServerInterfaceWrapper) ListAdapters added in v0.4.0

func (siw *ServerInterfaceWrapper) ListAdapters(w http.ResponseWriter, r *http.Request)

ListAdapters operation middleware

func (*ServerInterfaceWrapper) ListConnections added in v0.4.0

func (siw *ServerInterfaceWrapper) ListConnections(w http.ResponseWriter, r *http.Request)

ListConnections operation middleware

func (*ServerInterfaceWrapper) ListNodes added in v0.6.0

func (siw *ServerInterfaceWrapper) ListNodes(w http.ResponseWriter, r *http.Request)

ListNodes operation middleware

func (*ServerInterfaceWrapper) ListOffers added in v0.4.0

func (siw *ServerInterfaceWrapper) ListOffers(w http.ResponseWriter, r *http.Request)

ListOffers operation middleware

func (*ServerInterfaceWrapper) ListRunEvents added in v0.4.0

func (siw *ServerInterfaceWrapper) ListRunEvents(w http.ResponseWriter, r *http.Request)

ListRunEvents operation middleware

func (*ServerInterfaceWrapper) ListRuns added in v0.4.0

func (siw *ServerInterfaceWrapper) ListRuns(w http.ResponseWriter, r *http.Request)

ListRuns operation middleware

func (*ServerInterfaceWrapper) ListWorkloadRevisions added in v0.4.0

func (siw *ServerInterfaceWrapper) ListWorkloadRevisions(w http.ResponseWriter, r *http.Request)

ListWorkloadRevisions operation middleware

func (*ServerInterfaceWrapper) PreviewPlacement added in v0.4.0

func (siw *ServerInterfaceWrapper) PreviewPlacement(w http.ResponseWriter, r *http.Request)

PreviewPlacement operation middleware

func (*ServerInterfaceWrapper) RefreshRun added in v0.4.0

func (siw *ServerInterfaceWrapper) RefreshRun(w http.ResponseWriter, r *http.Request)

RefreshRun operation middleware

func (*ServerInterfaceWrapper) ReplaySink added in v0.4.0

func (siw *ServerInterfaceWrapper) ReplaySink(w http.ResponseWriter, r *http.Request)

ReplaySink operation middleware

func (*ServerInterfaceWrapper) ReportRun added in v0.4.0

func (siw *ServerInterfaceWrapper) ReportRun(w http.ResponseWriter, r *http.Request)

ReportRun operation middleware

func (*ServerInterfaceWrapper) ResolveImage added in v0.4.0

func (siw *ServerInterfaceWrapper) ResolveImage(w http.ResponseWriter, r *http.Request)

ResolveImage operation middleware

func (*ServerInterfaceWrapper) StreamConsoleEvents added in v0.5.0

func (siw *ServerInterfaceWrapper) StreamConsoleEvents(w http.ResponseWriter, r *http.Request)

StreamConsoleEvents operation middleware

func (*ServerInterfaceWrapper) WaitRun added in v0.4.0

WaitRun operation middleware

type ServiceClass added in v0.6.0

type ServiceClass = domain.ServiceClass

ServiceClass The kind of work a Run is, as its caller declared it. It is the only thing that can say what a second of waiting is worth, which is why it decides how a candidate is scored, and it is what capacity reserved for particular work is reserved by.

type SinkResult added in v0.4.0

type SinkResult = sinks.Result

SinkResult defines model for SinkResult.

type SinkStatus added in v0.4.0

type SinkStatus = sinks.Status

SinkStatus defines model for SinkStatus.

type StatedRate added in v0.6.0

type StatedRate struct {
	Confidence float64 `json:"confidence"`
	Rate       float64 `json:"rate"`
}

StatedRate One share of a machine's history somebody measured, and how much the publisher of that measurement stands behind it. The confidence is what says the measurement happened at all: a rate of zero stated at a confidence somebody owns is a machine measured and never seen to fail, and a rate nobody stands behind is silence.

type StdHTTPServerOptions added in v0.4.0

type StdHTTPServerOptions struct {
	BaseURL          string
	BaseRouter       ServeMux
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StreamConsoleEvents200TexteventStreamResponse added in v0.5.0

type StreamConsoleEvents200TexteventStreamResponse struct {
	Body          io.Reader
	ContentLength int64
}

func (StreamConsoleEvents200TexteventStreamResponse) VisitStreamConsoleEventsResponse added in v0.5.0

func (response StreamConsoleEvents200TexteventStreamResponse) VisitStreamConsoleEventsResponse(w http.ResponseWriter) error

type StreamConsoleEvents400JSONResponse added in v0.5.0

type StreamConsoleEvents400JSONResponse ErrorResponse

func (StreamConsoleEvents400JSONResponse) VisitStreamConsoleEventsResponse added in v0.5.0

func (response StreamConsoleEvents400JSONResponse) VisitStreamConsoleEventsResponse(w http.ResponseWriter) error

type StreamConsoleEvents401JSONResponse added in v0.5.0

type StreamConsoleEvents401JSONResponse ErrorResponse

func (StreamConsoleEvents401JSONResponse) VisitStreamConsoleEventsResponse added in v0.5.0

func (response StreamConsoleEvents401JSONResponse) VisitStreamConsoleEventsResponse(w http.ResponseWriter) error

type StreamConsoleEvents403JSONResponse added in v0.5.0

type StreamConsoleEvents403JSONResponse ErrorResponse

func (StreamConsoleEvents403JSONResponse) VisitStreamConsoleEventsResponse added in v0.5.0

func (response StreamConsoleEvents403JSONResponse) VisitStreamConsoleEventsResponse(w http.ResponseWriter) error

type StreamConsoleEvents501JSONResponse added in v0.5.0

type StreamConsoleEvents501JSONResponse ErrorResponse

func (StreamConsoleEvents501JSONResponse) VisitStreamConsoleEventsResponse added in v0.5.0

func (response StreamConsoleEvents501JSONResponse) VisitStreamConsoleEventsResponse(w http.ResponseWriter) error

type StreamConsoleEvents502JSONResponse added in v0.5.0

type StreamConsoleEvents502JSONResponse ErrorResponse

func (StreamConsoleEvents502JSONResponse) VisitStreamConsoleEventsResponse added in v0.5.0

func (response StreamConsoleEvents502JSONResponse) VisitStreamConsoleEventsResponse(w http.ResponseWriter) error

type StreamConsoleEventsParams added in v0.5.0

type StreamConsoleEventsParams struct {
	LastEventID string `json:"Last-Event-ID,omitempty"`
}

StreamConsoleEventsParams defines parameters for StreamConsoleEvents.

type StreamConsoleEventsRequestObject added in v0.5.0

type StreamConsoleEventsRequestObject struct {
	Params StreamConsoleEventsParams
}

type StreamConsoleEventsResponseObject added in v0.5.0

type StreamConsoleEventsResponseObject interface {
	VisitStreamConsoleEventsResponse(w http.ResponseWriter) error
}

type StrictHTTPServerOptions added in v0.4.0

type StrictHTTPServerOptions struct {
	RequestErrorHandlerFunc  func(w http.ResponseWriter, r *http.Request, err error)
	ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

type StrictHandlerFunc added in v0.4.0

type StrictHandlerFunc = strictnethttp.StrictHTTPHandlerFunc

type StrictMiddlewareFunc added in v0.4.0

type StrictMiddlewareFunc = strictnethttp.StrictHTTPMiddlewareFunc

type StrictServerInterface added in v0.4.0

type StrictServerInterface interface {

	// (GET /health/live)
	HealthLive(ctx context.Context, request HealthLiveRequestObject) (HealthLiveResponseObject, error)

	// (GET /health/ready)
	HealthReady(ctx context.Context, request HealthReadyRequestObject) (HealthReadyResponseObject, error)

	// (GET /openapi.json)
	GetOpenAPI(ctx context.Context, request GetOpenAPIRequestObject) (GetOpenAPIResponseObject, error)

	// (GET /v1/adapters)
	ListAdapters(ctx context.Context, request ListAdaptersRequestObject) (ListAdaptersResponseObject, error)

	// (GET /v1/connections)
	ListConnections(ctx context.Context, request ListConnectionsRequestObject) (ListConnectionsResponseObject, error)

	// (POST /v1/connections)
	CreateConnection(ctx context.Context, request CreateConnectionRequestObject) (CreateConnectionResponseObject, error)

	// (DELETE /v1/connections/{connection_id})
	DeleteConnection(ctx context.Context, request DeleteConnectionRequestObject) (DeleteConnectionResponseObject, error)

	// (POST /v1/connections/{connection_id}/authorize)
	AuthorizeConnection(ctx context.Context, request AuthorizeConnectionRequestObject) (AuthorizeConnectionResponseObject, error)

	// (GET /v1/console/events)
	StreamConsoleEvents(ctx context.Context, request StreamConsoleEventsRequestObject) (StreamConsoleEventsResponseObject, error)

	// (POST /v1/images:resolve)
	ResolveImage(ctx context.Context, request ResolveImageRequestObject) (ResolveImageResponseObject, error)
	// List the nodes enrolled in a deployment
	// (GET /v1/nodes)
	ListNodes(ctx context.Context, request ListNodesRequestObject) (ListNodesResponseObject, error)
	// Reserve a node identity and mint its enrollment material
	// (POST /v1/nodes)
	InviteNode(ctx context.Context, request InviteNodeRequestObject) (InviteNodeResponseObject, error)

	// (GET /v1/offers)
	ListOffers(ctx context.Context, request ListOffersRequestObject) (ListOffersResponseObject, error)

	// (POST /v1/placements:preview)
	PreviewPlacement(ctx context.Context, request PreviewPlacementRequestObject) (PreviewPlacementResponseObject, error)

	// (GET /v1/runs)
	ListRuns(ctx context.Context, request ListRunsRequestObject) (ListRunsResponseObject, error)

	// (POST /v1/runs)
	CreateRun(ctx context.Context, request CreateRunRequestObject) (CreateRunResponseObject, error)

	// (GET /v1/runs/{run_id})
	GetRun(ctx context.Context, request GetRunRequestObject) (GetRunResponseObject, error)

	// (POST /v1/runs/{run_id}/cancel)
	CancelRun(ctx context.Context, request CancelRunRequestObject) (CancelRunResponseObject, error)

	// (GET /v1/runs/{run_id}/decision)
	GetRunDecision(ctx context.Context, request GetRunDecisionRequestObject) (GetRunDecisionResponseObject, error)

	// (GET /v1/runs/{run_id}/events)
	ListRunEvents(ctx context.Context, request ListRunEventsRequestObject) (ListRunEventsResponseObject, error)

	// (POST /v1/runs/{run_id}/refresh)
	RefreshRun(ctx context.Context, request RefreshRunRequestObject) (RefreshRunResponseObject, error)

	// (POST /v1/runs/{run_id}/report)
	ReportRun(ctx context.Context, request ReportRunRequestObject) (ReportRunResponseObject, error)

	// (GET /v1/runs/{run_id}/wait)
	WaitRun(ctx context.Context, request WaitRunRequestObject) (WaitRunResponseObject, error)

	// (GET /v1/sinks/{sink_id})
	GetSinkStatus(ctx context.Context, request GetSinkStatusRequestObject) (GetSinkStatusResponseObject, error)

	// (POST /v1/sinks/{sink_id}/deliver)
	DeliverSink(ctx context.Context, request DeliverSinkRequestObject) (DeliverSinkResponseObject, error)

	// (POST /v1/sinks/{sink_id}/replay)
	ReplaySink(ctx context.Context, request ReplaySinkRequestObject) (ReplaySinkResponseObject, error)

	// (POST /v1/workloads)
	CreateWorkload(ctx context.Context, request CreateWorkloadRequestObject) (CreateWorkloadResponseObject, error)

	// (GET /v1/workloads/{workload_id}/revisions)
	ListWorkloadRevisions(ctx context.Context, request ListWorkloadRevisionsRequestObject) (ListWorkloadRevisionsResponseObject, error)

	// (POST /v1/workloads/{workload_id}/revisions)
	CreateWorkloadRevision(ctx context.Context, request CreateWorkloadRevisionRequestObject) (CreateWorkloadRevisionResponseObject, error)

	// (GET /v1/workloads/{workload_id}/revisions/{revision_id})
	GetWorkloadRevision(ctx context.Context, request GetWorkloadRevisionRequestObject) (GetWorkloadRevisionResponseObject, error)
}

StrictServerInterface represents all server handlers.

type TooManyValuesForParamError added in v0.4.0

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error added in v0.4.0

type TransferRate added in v0.6.0

type TransferRate struct {
	// Assumption The stated constant this rate is when nothing measured the path. Absent when something did.
	Assumption string `json:"assumption,omitempty"`

	// Bytes What had to move at that rate, so the stage's seconds can be retraced from this record alone.
	Bytes      int64   `json:"bytes"`
	Confidence float64 `json:"confidence"`
	Mbps       float64 `json:"mbps"`

	// Measurement Who measured this path, in their own words. Absent when nothing measured it.
	Measurement string `json:"measurement,omitempty"`

	// Scope The path this rate describes. Absent for a rate that crosses no path: assembling content already on the disk is priced from a storage rate, and naming a link for it would invite a reader to check it against a measurement of something else.
	Scope TransferRateScope `json:"scope,omitempty"`
	Stage TransferRateStage `json:"stage"`
}

TransferRate The throughput one stage of a launch was priced at, named by the stage and by the path it crosses. Exactly one of measurement and assumption is stated: a rate is either something somebody measured on this path or the constant Mercator falls back to when nobody did.

type TransferRateScope added in v0.6.0

type TransferRateScope string

TransferRateScope The path this rate describes. Absent for a rate that crosses no path: assembling content already on the disk is priced from a storage rate, and naming a link for it would invite a reader to check it against a measurement of something else.

const (
	ObjectStore    TransferRateScope = "object_store"
	PublicInternet TransferRateScope = "public_internet"
	Registry       TransferRateScope = "registry"
)

Defines values for TransferRateScope.

func (TransferRateScope) Valid added in v0.6.0

func (e TransferRateScope) Valid() bool

Valid indicates whether the value is a known member of the TransferRateScope enum.

type TransferRateStage added in v0.6.0

type TransferRateStage string

TransferRateStage defines model for TransferRate.Stage.

const (
	Acquisition      TransferRateStage = "acquisition"
	AgentReady       TransferRateStage = "agent_ready"
	ApplicationReady TransferRateStage = "application_ready"
	ArtifactFetch    TransferRateStage = "artifact_fetch"
	Boot             TransferRateStage = "boot"
	ContainerStart   TransferRateStage = "container_start"
	ImageFetch       TransferRateStage = "image_fetch"
	Unpack           TransferRateStage = "unpack"
)

Defines values for TransferRateStage.

func (TransferRateStage) Valid added in v0.6.0

func (e TransferRateStage) Valid() bool

Valid indicates whether the value is a known member of the TransferRateStage enum.

type UnescapedCookieParamError added in v0.4.0

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

func (*UnescapedCookieParamError) Error added in v0.4.0

func (e *UnescapedCookieParamError) Error() string

func (*UnescapedCookieParamError) Unwrap added in v0.4.0

func (e *UnescapedCookieParamError) Unwrap() error

type UnmarshalingParamError added in v0.4.0

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error added in v0.4.0

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap added in v0.4.0

func (e *UnmarshalingParamError) Unwrap() error

type Violation added in v0.4.0

type Violation = domain.Violation

Violation defines model for Violation.

type WaitRun200JSONResponse added in v0.4.0

type WaitRun200JSONResponse RunResponse

func (WaitRun200JSONResponse) VisitWaitRunResponse added in v0.4.0

func (response WaitRun200JSONResponse) VisitWaitRunResponse(w http.ResponseWriter) error

type WaitRun202JSONResponse added in v0.4.0

type WaitRun202JSONResponse RunResponse

func (WaitRun202JSONResponse) VisitWaitRunResponse added in v0.4.0

func (response WaitRun202JSONResponse) VisitWaitRunResponse(w http.ResponseWriter) error

type WaitRun400JSONResponse added in v0.4.0

type WaitRun400JSONResponse ErrorResponse

func (WaitRun400JSONResponse) VisitWaitRunResponse added in v0.4.0

func (response WaitRun400JSONResponse) VisitWaitRunResponse(w http.ResponseWriter) error

type WaitRun401JSONResponse added in v0.4.0

type WaitRun401JSONResponse ErrorResponse

func (WaitRun401JSONResponse) VisitWaitRunResponse added in v0.4.0

func (response WaitRun401JSONResponse) VisitWaitRunResponse(w http.ResponseWriter) error

type WaitRun403JSONResponse added in v0.4.0

type WaitRun403JSONResponse ErrorResponse

func (WaitRun403JSONResponse) VisitWaitRunResponse added in v0.4.0

func (response WaitRun403JSONResponse) VisitWaitRunResponse(w http.ResponseWriter) error

type WaitRun404JSONResponse added in v0.4.0

type WaitRun404JSONResponse ErrorResponse

func (WaitRun404JSONResponse) VisitWaitRunResponse added in v0.4.0

func (response WaitRun404JSONResponse) VisitWaitRunResponse(w http.ResponseWriter) error

type WaitRun408JSONResponse added in v0.4.0

type WaitRun408JSONResponse ErrorResponse

func (WaitRun408JSONResponse) VisitWaitRunResponse added in v0.4.0

func (response WaitRun408JSONResponse) VisitWaitRunResponse(w http.ResponseWriter) error

type WaitRunRequestObject added in v0.4.0

type WaitRunRequestObject struct {
	RunId string `json:"run_id"`
}

type WaitRunResponseObject added in v0.4.0

type WaitRunResponseObject interface {
	VisitWaitRunResponse(w http.ResponseWriter) error
}

type WaitingBookingEvidence added in v0.6.0

type WaitingBookingEvidence struct {
	BookingId string `json:"booking_id"`

	// ExpectedRuntimeSeconds The p50 runtime this Booking's Run declared.
	ExpectedRuntimeSeconds float64 `json:"expected_runtime_seconds,omitempty"`

	// MaxRuntimeSeconds The enforced maximum runtime this Booking's Run declared.
	MaxRuntimeSeconds float64 `json:"max_runtime_seconds,omitempty"`
	RunId             string  `json:"run_id"`
}

WaitingBookingEvidence A Booking that had not started when a decision was made. It still owes every second its Run declared, which is why these fields carry the declared runtimes rather than remaining ones.

type WebAuth added in v0.3.0

type WebAuth interface {
	http.Handler
	SessionEmail(*http.Request) (string, bool)
	VerifyCLIToken(token string) (string, bool)
}

WebAuth is the human-login surface the server mounts at /auth/ when OIDC is configured: it serves the login/callback/logout/session endpoints, answers which signed-in human a request's session cookie belongs to, verifies the bearer tokens `mercator login` mints for CLI users.

type WorkloadRevision added in v0.4.0

type WorkloadRevision = domain.WorkloadRevision

WorkloadRevision defines model for WorkloadRevision.

type WorkloadRevisionListResponse added in v0.4.0

type WorkloadRevisionListResponse struct {
	Revisions []WorkloadRevision `json:"revisions"`
}

WorkloadRevisionListResponse defines model for WorkloadRevisionListResponse.

type WorkloadRevisionResponse added in v0.4.0

type WorkloadRevisionResponse struct {
	Revision WorkloadRevision `json:"revision"`
}

WorkloadRevisionResponse defines model for WorkloadRevisionResponse.

type WorkloadSpec added in v0.4.0

type WorkloadSpec struct {
	// Artifacts The immutable Artifact versions this workload reads and publishes. A declared input is a dependency on durable content in the object store rather than on any host holding a copy, so a Run waits for a publication and never for a particular machine.
	Artifacts ArtifactRequirements `json:"artifacts"`

	// Caches The mutable, application-owned state this workload wants mounted across Runs. Every cache name is deployment-global.
	Caches     []CacheMountRequirement `json:"caches,omitempty"`
	Containers []ContainerSpec         `json:"containers"`
	Execution  ExecutionPolicy         `json:"execution"`
	Metadata   map[string]string       `json:"metadata,omitempty"`
	Network    NetworkRequirements     `json:"network"`
	Placement  PlacementPolicy         `json:"placement"`
	Raw        map[string]interface{}  `json:"raw,omitempty"`
	Resources  ResourceRequirements    `json:"resources"`
}

WorkloadSpec defines model for WorkloadSpec.

Jump to

Keyboard shortcuts

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