provider

package
v0.0.0-...-611bec0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 43 Imported by: 19

Documentation

Index

Constants

View Source
const (
	ErrorKindCanceled = "canceled"
	ErrorKindTimeout  = "timeout"
	ErrorKindFailed   = "failed"
)
View Source
const (
	MaxNamespaceLength = 44
	NamespaceEnvVar    = "OCEL_NAMESPACE"
)
View Source
const (
	StackGroupKind     = "stack"
	ParameterGroupKind = "parameters"

	DetailUnavailable = "resource-level detail unavailable"

	ReasonCurrent = "already current"
)
View Source
const (
	PropertyHost          = "host"
	PropertyPort          = "port"
	PropertyDatabase      = "database"
	PropertyUsername      = "username"
	PropertyPassword      = "password"
	PropertyBucket        = "bucket"
	PropertyPublicBaseURL = "publicBaseUrl"
	PropertyPublic        = "public"
	PropertyEndpoint      = "endpoint"
	PropertyTLS           = "tls"
	PropertyTLSMode       = "tlsMode"
	PropertyTLSCA         = "tlsCa"
	PropertyTLSServerName = "tlsServerName"
	PropertyCAPEM         = "caPem"
	PropertyURL           = "url"
	PropertySigningKey    = "signingKey"
	PropertyVerifyKey     = "verifyKey"
)
View Source
const (
	GrantPasswordSecret    = "password secret"
	GrantIAMAuthentication = "iam authentication"
)
View Source
const BasePart = "base"
View Source
const ConnectorConfigEnvVar = "OCEL_CONNECTOR_CONFIG_JSON"
View Source
const ConsoleTrustPart = "console-trust"
View Source
const CostSource = "ocel"
View Source
const DefaultIdempotencyKeyLife = 30 * 24 * time.Hour
View Source
const (
	FingerprintHexLen = 12
)
View Source
const ImageKind = "image"
View Source
const MaxConcurrency = 1000
View Source
const VariablesKeyPart = "variables-key"

Variables

View Source
var ErrUnscopedGrant = errors.New("unscoped grant")

Functions

func ActionProto

func ActionProto(action ChangeAction) planv1.Change_Action

func Ask

func Ask(message string, question Question) error

func AttrApp

func AttrApp(name string) progress.Attr

func AttrBytes

func AttrBytes(n int64) progress.Attr

func AttrDurationMS

func AttrDurationMS(d time.Duration) progress.Attr

func AttrResourceAction

func AttrResourceAction(action ChangeAction) progress.Attr

func AttrResourceCount

func AttrResourceCount(n int) progress.Attr

func AttrResourceName

func AttrResourceName(name string) progress.Attr

func AttrResourceType

func AttrResourceType(typ string) progress.Attr

func BindingMessage

func BindingMessage(binding Binding) (*bindingsv1.Binding, error)

func BootstrapCommand

func BootstrapCommand(tier environment.Tier) string

func ClassifyError

func ClassifyError(err error) string

func ComputeNames

func ComputeNames(computes []Compute) []string

func Decode

func Decode[T any](vendor Vendor, options Options) (T, error)

func DecodeEdgeOptions

func DecodeEdgeOptions[T any](kind edge.Kind, options Options) (T, error)

func GrantMessages

func GrantMessages(grants []Grant) []*variablestorev1.Grant

func IsWorkerApp

func IsWorkerApp(app string, workers []WorkerSpec) bool

func KnownCompute

func KnownCompute(name string) bool

func NewOriginDispatchEnv

func NewOriginDispatchEnv() map[string]string

func NewRouteTableEnv

func NewRouteTableEnv(app *AppSpec, routeTable string) map[string]string

func ProductionHostnames

func ProductionHostnames(app AppEntry) []string

func ProtoBindingType

func ProtoBindingType(kind BindingType) bindingsv1.BindingType

func PublishedBindingMessage

func PublishedBindingMessage(binding Binding) (*variablestorev1.PublishedBinding, error)

func RefusalError

func RefusalError(err error) error

func RefuseConcurrency

func RefuseConcurrency(concurrency int32) error

func RefuseTransforms

func RefuseTransforms(vendor Vendor, transforms []string) error

func RefuseUnconsentedChanges

func RefuseUnconsentedChanges(shown, fresh Plan) error

func RefusedCode

func RefusedCode(err error) (refusal.Code, bool)

func RequiredProperties

func RequiredProperties(t BindingType) []string

func ResourceEnvName

func ResourceEnvName(kind BindingType, resource string) string

func Resumable

func Resumable(err error) error

func ResumableMessage

func ResumableMessage(err error) (string, bool)

func RollUpProto

func RollUpProto(changes []*planv1.Change) planv1.Change_Action

func ValidChangeAction

func ValidChangeAction(action ChangeAction) bool

func VerifyProperties

func VerifyProperties(binding Binding) error

func WithDetailUnavailable

func WithDetailUnavailable(reason string) string

func WorkerCeilingMessages

func WorkerCeilingMessages(ceilings []WorkerCeiling) []*contractv1.WorkerCeiling

func WriteLenPrefixed

func WriteLenPrefixed(h io.Writer, b []byte)

Types

type AppContainer

type AppContainer struct {
	Name                      string `json:"name"`
	Physical                  string `json:"physical,omitempty"`
	URL                       string `json:"url,omitempty"`
	DeploymentURL             string `json:"deploymentUrl,omitempty"`
	Image                     string `json:"image,omitempty"`
	Revision                  string `json:"revision,omitempty"`
	DiscoveredHealthCheckPath string `json:"discoveredHealthCheckPath,omitempty"`
}

type AppEntry

type AppEntry struct {
	App      string
	Stack    naming.StackName
	Release  Release
	Manifest *contractv1.ManifestApp

	Image           string
	HealthCheckPath string
	Arch            string
	Instances       Instances

	Workers []WorkerSpec
}

func (AppEntry) Compute

func (e AppEntry) Compute() Compute

func (AppEntry) IsBuiltFromFunction

func (e AppEntry) IsBuiltFromFunction() bool

type AppRelease

type AppRelease struct {
	App     string
	Release Release
}

type AppSpec

type AppSpec struct {
	App          string
	Framework    string
	RootFunction string
	BuildID      string
	Compute      Compute
	Router       router.Kind
	Functions    []FunctionSpec

	Image                     string
	HealthCheckPath           string
	DiscoveredHealthCheckPath string
	Arch                      string
	Instances                 Instances

	Workers           []WorkerSpec
	DeploymentWorkers []WorkerSpec

	Values AppValues

	Grants []Binding

	Routing        *RoutingSpec
	OcelRouteTable *RoutingSpec
	EdgeRouteTable *EdgeRouteTable
	Guard          *OriginGuard
	ISR            *ISRSpec
	Gate           *gate.Gate

	StorageCoordinate naming.Coordinate
	Static            *edge.Static
	OutputRoot        string

	Proxied bool

	Topics []Resource
}

func (*AppSpec) IsBuiltAsFunctions

func (a *AppSpec) IsBuiltAsFunctions() bool

func (*AppSpec) IsBuiltFromFunction

func (a *AppSpec) IsBuiltFromFunction() bool

type AppUsage

type AppUsage struct {
	App       string
	Resources []Resource
	Grants    []Binding
}

type AppValues

type AppValues struct {
	Plain        map[string]string
	Sensitive    map[string]string
	Secrets      []SecretRef
	Bindings     []Binding
	Owners       map[string]string
	Folder       string
	ContainerEnv map[string]string
	Phase        string
}

func (AppValues) GoString

func (v AppValues) GoString() string

func (AppValues) PhaseEnv

func (v AppValues) PhaseEnv() map[string]string

func (AppValues) String

func (v AppValues) String() string

type ArtifactRef

type ArtifactRef struct {
	Tier environment.Tier `json:"tier,omitempty"`
	Key  string           `json:"key,omitempty"`
}

type ArtifactStore

type ArtifactStore interface {
	Put(ctx context.Context, ref ArtifactRef, body io.Reader) error

	Has(ctx context.Context, ref ArtifactRef) (bool, error)

	Open(ctx context.Context, ref ArtifactRef) (io.ReadCloser, error)

	RemoveObjects(ctx context.Context, tier environment.Tier, scope naming.StorageScope, kinds []naming.ObjectKind, progress progress.Log) error
}

type BatchPolicy

type BatchPolicy struct {
	Size    int
	Timeout time.Duration
}

type Binding

type Binding struct {
	Type       BindingType       `json:"type"`
	Name       string            `json:"name"`
	Resource   string            `json:"resource,omitempty"`
	Source     string            `json:"source,omitempty"`
	Properties map[string]string `json:"properties,omitempty"`
	Grants     []Grant           `json:"grants,omitempty"`
	Version    int64             `json:"version,omitempty"`
}

func BindingOf

func BindingOf(message *bindingsv1.Binding) Binding

func PublishedBindingOf

func PublishedBindingOf(message *variablestorev1.PublishedBinding) Binding

func (Binding) Endpointed

func (b Binding) Endpointed() bool

func (Binding) HasIAMAuthentication

func (b Binding) HasIAMAuthentication() bool

func (Binding) PasswordSecret

func (b Binding) PasswordSecret() string

type BindingAccessHooks

type BindingAccessHooks struct {
	ForwardPorts func(ctx context.Context, req PortForwardRequest, progress progress.Log) ([]PortForward, error)
	ServeProxy   func(ctx context.Context, req BindingProxyRequest, progress progress.Log) (BindingProxy, error)
}

type BindingGrant

type BindingGrant struct {
	Grantee  string
	Bindings []Binding
}

type BindingProxy

type BindingProxy struct {
	Address  string
	Sessions []BindingSession
	Unserved []string
	Close    func()
}

type BindingProxyRequest

type BindingProxyRequest struct {
	Slug          string
	Tier          environment.Tier
	Env           string
	Grants        []BindingGrant
	ReportFailure func(error)
}

type BindingSession

type BindingSession struct {
	Grantee      string
	SessionToken string
}

type BindingType

type BindingType string
const (
	BindingPostgres BindingType = "postgres"
	BindingBucket   BindingType = "bucket"
	BindingTopic    BindingType = "topic"
	BindingTask     BindingType = "task"
	BindingKV       BindingType = "kv"
	BindingRealtime BindingType = "realtime"
	BindingCustom   BindingType = "custom"
)

func BindingTypeFromProto

func BindingTypeFromProto(encoded bindingsv1.BindingType) (BindingType, bool)

type Bindings

type Bindings interface {
	Names(ctx context.Context) ([]string, error)

	Published(ctx context.Context) ([]Binding, error)

	Named(ctx context.Context, binding string) (Binding, error)
}

type Bootstrap

type Bootstrap interface {
	Parts() []Part

	Describe(ctx context.Context, tier environment.Tier) (BootstrapDescription, error)

	Plan(ctx context.Context, req BootstrapRequest) (Plan, error)

	Apply(ctx context.Context, req BootstrapRequest, progress progress.Log) error

	PlanRemove(ctx context.Context, tier environment.Tier) (Plan, error)

	Remove(ctx context.Context, tier environment.Tier, progress progress.Log) error

	DescribeParts(ctx context.Context, described BootstrapDescription) ([]BootstrapPart, error)
}

type BootstrapDescription

type BootstrapDescription struct {
	Tier    environment.Tier
	Present bool
	Stacks  []BootstrapStack

	Unfinished bool

	Identity *TierIdentity

	Trust *WebIdentityTrust
}

type BootstrapPart

type BootstrapPart struct {
	Name                string
	Summary             string
	Current             bool
	Digest              string
	Resources           []PhysicalResource
	UsedBy              []string
	UsedByEveryProject  bool
	RetiresWithLastUser bool
	Shape               *PartShape
}

type BootstrapRequest

type BootstrapRequest struct {
	Tier environment.Tier

	Parts []string

	Remove []string

	Force bool

	RefuseReplacements bool

	WrittenBy WrittenBy

	Trust *WebIdentityTrust
}

type BootstrapStack

type BootstrapStack struct {
	Name    string
	Part    string
	Present bool

	DigestCurrent bool

	WrittenBy string

	ReadError string
}

type BucketSpec

type BucketSpec struct {
	AllowedOrigins []string
	Public         bool
}

type Certificate

type Certificate struct {
	ID        string        `json:"id,omitempty"`
	Requested bool          `json:"requested,omitempty"`
	Written   []edge.Record `json:"written,omitempty"`
	Manual    []edge.Record `json:"manual,omitempty"`
}

func (Certificate) Issued

func (c Certificate) Issued() bool

type CertificateHealth

type CertificateHealth struct {
	Terminates   bool
	Status       string
	Issued       bool
	Domains      []string
	Covers       bool
	Renewal      string
	ExpiresAt    int64
	ExpiringSoon bool
}

type CertificateRequest

type CertificateRequest struct {
	Tier     environment.Tier
	Kind     edge.Kind
	Router   router.Kind
	Hostname string
	Current  Certificate
	Prove    func(ctx context.Context, cert Certificate, records []edge.Record) (Certificate, error)
	Progress progress.Log
}

type Certificates

type Certificates interface {
	Issue(ctx context.Context, req CertificateRequest) (Certificate, error)

	Inspect(ctx context.Context, kind edge.Kind, answering router.Kind, hostname string, cert Certificate) (CertificateHealth, error)

	Discard(ctx context.Context, cert Certificate, progress progress.Log) error
}

type Change

type Change struct {
	Kind   string
	Name   string
	Action ChangeAction
	Reason string
	Slow   bool
}

type ChangeAction

type ChangeAction string
const (
	ActionCreate            ChangeAction = "create"
	ActionUpdate            ChangeAction = "update"
	ActionReplace           ChangeAction = "replace"
	ActionDelete            ChangeAction = "delete"
	ActionDisableThenDelete ChangeAction = "disable-then-delete"
	ActionKeep              ChangeAction = "keep"
	ActionAdopt             ChangeAction = "adopt"
)

func ActionFromProto

func ActionFromProto(drawn planv1.Change_Action) (ChangeAction, bool)

func KeepOrCreate

func KeepOrCreate(exists bool) ChangeAction

func RollUp

func RollUp(changes []Change) (ChangeAction, string)

func (ChangeAction) Writes

func (a ChangeAction) Writes() bool

type ChangeGroup

type ChangeGroup struct {
	Kind    string
	Name    string
	Part    string
	Action  ChangeAction
	Reason  string
	Slow    bool
	Changes []Change
}

type ChannelSpec

type ChannelSpec struct {
	Pattern   string
	Wildcard  bool
	Schema    string
	Subscribe realtime.ChannelAccess
	Publish   realtime.ChannelAccess
}

type Compute

type Compute string
const (
	ComputeServerless Compute = "serverless"
	ComputeContainer  Compute = "container"
)

func ComputeOf

func ComputeOf(app *contractv1.ManifestApp) Compute

func Computes

func Computes() []Compute

func ConnectorCompute

func ConnectorCompute(requested Compute, supported ...Compute) (Compute, error)

type Connector

type Connector interface {
	Target(ctx context.Context) (ConnectorTarget, error)

	Install(ctx context.Context, install ConnectorInstall, progress progress.Log) (ConnectorAddress, error)

	Remove(ctx context.Context, progress progress.Log) error
}

type ConnectorAddress

type ConnectorAddress struct {
	URL       string
	PublicKey string
	Compute   Compute
}

type ConnectorInstall

type ConnectorInstall struct {
	Binary  []byte
	Version string
	Config  []byte
	Compute Compute
}

type ConnectorTarget

type ConnectorTarget struct {
	Fingerprint string
	Hostname    string
	OS          string
	Arch        string
	Installed   *InstalledConnector
}

type ConsumerSpec

type ConsumerSpec struct {
	Name        string
	Worker      string
	Exclusive   bool
	Retry       RetryPolicy
	Concurrency int
	MaxDuration time.Duration
	Lanes       []Lane
	Batch       *BatchPolicy
}

type ContainerReleaseHooks

type ContainerReleaseHooks struct {
	ScaleUp   func(ctx context.Context, promoted PromotedReleases, progress progress.Log) error
	ScaleDown func(ctx context.Context, demoted DemotedReleases, progress progress.Log) error
}

type CostHooks

type CostHooks struct {
	Shape    func(ctx context.Context, req ShapeRequest) (*costv1.ResourceSet, error)
	Estimate func(ctx context.Context, req *costv1.PriceRequest) (*costv1.Estimate, error)
}

type Credentials

type Credentials interface {
	Whoami(ctx context.Context) (Principal, error)

	Permissions(purpose edge.CredentialPurpose, tier environment.Tier) (edge.CredentialDocument, error)
}

type DNS

type DNS interface {
	Open(kind DNSKind, zone string, front edge.Kind) (edge.DNSRecords, error)
}

type DNSKind

type DNSKind string

type DemotedReleases

type DemotedReleases struct {
	Slug     string
	Tier     environment.Tier
	Env      string
	Previous []AppRelease
	Older    []AppRelease
}

type DeployPreflight

type DeployPreflight struct {
	Deploy            DeploySpec
	PreviewBaseDomain string
	Edge              edge.Kind
	Resources         []Resource
	Grants            []Binding
	Apps              []AppUsage
	Progress          progress.Log
	WrittenBy         WrittenBy
	Uses              []buildoutput.Uses
}

type DeploySpec

type DeploySpec struct {
	Slug    string
	Tier    environment.Tier
	Env     string
	Label   string
	Pointer string

	Infra naming.StackName
	Apps  []AppEntry

	Workers []WorkerSpec

	PromotionID string
	Tag         string
	Releases    map[string]string
	Phase       string
}

type EdgeProgramRequest

type EdgeProgramRequest struct {
	Tier environment.Tier
	Kind edge.Kind
}

type EdgeRouteTable

type EdgeRouteTable struct {
	Location router.RouteTableLocation
	Table    []byte
}

type Edges

type Edges interface {
	Open(kind edge.Kind, options Options) (edge.Edge, error)
}

type EnvSourceHooks

type EnvSourceHooks struct {
	ProveIdentity func(ctx context.Context, audience string) (envsource.IdentityProof, error)
	EnsureSync    func(ctx context.Context, tier environment.Tier, project string) error
}

type ExpiringRecord

type ExpiringRecord struct {
	Purpose   RecordPurpose
	Topic     string
	Key       string
	Value     json.RawMessage
	ExpiresAt time.Time
}

type Facts

type Facts struct {
	Vendor            Vendor
	Bindings          []BindingType
	Computes          []Compute
	Edges             []edge.Kind
	DefaultEdge       edge.Kind
	Pairings          []Pairing
	DNSKinds          []DNSKind
	RendersTransforms bool
	StoresArtifacts   bool
	RunsTunnels       bool
	WorkerCeilings    []WorkerCeiling

	RetainsContainerReleases bool
	RunsGates                bool
	RunsFunctionsAsImages    bool
	MaxFunctionBytes         int64

	WebIdentity *WebIdentityFacts
}

func (Facts) FindEdgeRouter

func (f Facts) FindEdgeRouter(front edge.Kind) (router.Kind, bool)

func (Facts) IsForwarded

func (f Facts) IsForwarded(front edge.Kind, kind router.Kind) bool

func (Facts) ListPairedRouters

func (f Facts) ListPairedRouters(front edge.Kind) []router.Kind

func (Facts) PairedRouter

func (f Facts) PairedRouter(front edge.Kind, compute Compute) (router.Kind, bool)

type Function

type Function struct {
	Name          string `json:"name"`
	Physical      string `json:"physical,omitempty"`
	URL           string `json:"url,omitempty"`
	DeploymentURL string `json:"deploymentUrl,omitempty"`
	Revision      string `json:"revision,omitempty"`

	IgnoresGate bool `json:"ignoresGate,omitempty"`
}

type FunctionSpec

type FunctionSpec struct {
	Name        string
	Route       string
	EntryFile   string
	Framework   buildoutput.Framework
	ArtifactDir string
	Overlay     map[string][]byte
	Env         map[string]string
	Memory      int

	HasWorkerEntry bool
}

type Grant

type Grant struct {
	Label      string           `json:"label,omitempty"`
	Actions    []string         `json:"actions,omitempty"`
	Resources  []string         `json:"resources,omitempty"`
	Conditions []GrantCondition `json:"conditions,omitempty"`
}

func GrantsOf

func GrantsOf(grants []*variablestorev1.Grant) []Grant

type GrantCondition

type GrantCondition struct {
	Operator string   `json:"operator,omitempty"`
	Key      string   `json:"key,omitempty"`
	Values   []string `json:"values,omitempty"`
}

type Hooks

type Hooks struct {
	Preflight            *PreflightHooks
	InfraPreflight       *PreflightHooks
	CheckBucket          func(ctx context.Context, record *bindingsv1.BucketProperties, public bool, origins []string) ([]string, error)
	ProgramEdge          func(ctx context.Context, req EdgeProgramRequest) (edge.Program, error)
	EnsureImageRegistry  func(ctx context.Context, tier environment.Tier) (RegistryTarget, error)
	OpenRegistryImages   func(ctx context.Context, target RegistryTarget) (ImageStore, error)
	OpenDirectImages     func(ctx context.Context) (ImageStore, error)
	CheckHost            func(ctx context.Context, req HostCheckRequest) ([]HostCheck, error)
	BindingAccess        *BindingAccessHooks
	EnvSource            *EnvSourceHooks
	Cost                 *CostHooks
	Retirement           *RetirementHooks
	ContainerReleases    *ContainerReleaseHooks
	ProjectRemoval       *ProjectRemovalHooks
	ListProjectResources func(ctx context.Context, req ProjectResourcesRequest) ([]PhysicalResource, error)
}

type HostCheck

type HostCheck struct {
	Subject string
	Verdict HostVerdict
	Finding string
	Fix     string
}

type HostCheckRequest

type HostCheckRequest struct {
	Tier      environment.Tier
	Edge      edge.Kind
	Hostnames []string
}

type HostVerdict

type HostVerdict int
const (
	HostPass HostVerdict = iota
	HostNeedsAction
	HostFail
)

type ISRSpec

type ISRSpec struct {
	TagNamespace string
	PurgeURL     string
}

type ImagePush

type ImagePush struct {
	App      string
	Source   string
	ImageRef string
	Digest   string

	Function bool
	Built    v1.Image
	Wrap     Wrapped
}

type ImagePushes

type ImagePushes struct {
	Store    ImageStore
	Registry RegistryTarget
	Pushes   []ImagePush
}

func (ImagePushes) GoString

func (p ImagePushes) GoString() string

func (ImagePushes) ImageRef

func (p ImagePushes) ImageRef(app string) string

func (ImagePushes) PushMissing

func (p ImagePushes) PushMissing(ctx context.Context, progress progress.Log) error

func (ImagePushes) PushRemoved

func (p ImagePushes) PushRemoved(ctx context.Context, progress progress.Log) error

func (ImagePushes) Rows

func (p ImagePushes) Rows(ctx context.Context) ([]Change, error)

func (ImagePushes) String

func (p ImagePushes) String() string

type ImageStore

type ImageStore interface {
	Destination() string

	Has(ctx context.Context, push ImagePush) (bool, error)

	Push(ctx context.Context, push ImagePush, progress progress.Log) error

	ProbePush(ctx context.Context, repository string) error

	Remove(ctx context.Context, imageRef string) error
}

type InstalledConnector

type InstalledConnector struct {
	Version   string
	PublicKey string
	Compute   Compute
}

type Instances

type Instances struct {
	Min int
	Max int
}

type KVSpec

type KVSpec struct {
	Version     string
	Eviction    string
	MemoryBytes int64
}

type Lane

type Lane string
const (
	LaneHigh    Lane = "high"
	LaneDefault Lane = "default"
	LaneLow     Lane = "low"
)

type Lease

type Lease struct {
	Tier    environment.Tier
	Project string
	Env     string
}

func (Lease) Covers

func (l Lease) Covers(ref StackRef) bool

type LiveApp

type LiveApp struct {
	App     string
	Compute Compute
	Workers []string
}

type LiveApps

type LiveApps struct {
	Slug string
	Tier environment.Tier
	Env  string
	Apps []LiveApp

	Lease Lease
}

func (LiveApps) Find

func (l LiveApps) Find(app string) (LiveApp, bool)

func (LiveApps) Has

func (l LiveApps) Has(app string) bool

type Liveness

type Liveness interface {
	ServingRouter(ctx context.Context, hostname string) (router.Kind, error)

	LastProbeFailure(hostname string) ProbeFailure
}

type LogEntry

type LogEntry struct {
	ID       string
	Time     time.Time
	App      string
	Source   string
	Release  string
	Instance string
	Stream   LogStream
	Message  string
	Severity string
	Failure  bool
}

type LogNotice

type LogNotice struct {
	Kind    LogNoticeKind
	Omitted int
	Message string
	Target  LogTarget
}

type LogNoticeKind

type LogNoticeKind int
const (
	LogSampled LogNoticeKind = iota + 1
	LogReconnected
	LogSourceGone
)

type LogQuery

type LogQuery struct {
	Tier         environment.Tier
	Slug, Env    string
	Targets      []LogTarget
	Since, Until time.Time
	Limit        int
	Contains     string
	Tail         bool
}

type LogStream

type LogStream string
const (
	LogStreamStdout LogStream = "stdout"
	LogStreamStderr LogStream = "stderr"
)

type LogTarget

type LogTarget struct {
	App, Release, Source string
	Function             *Function
	Container            *AppContainer
}

func (LogTarget) Physical

func (t LogTarget) Physical() string

func (LogTarget) Revision

func (t LogTarget) Revision() string

type LogTargetsMissing

type LogTargetsMissing struct{ Targets []LogTarget }

func (LogTargetsMissing) Error

func (e LogTargetsMissing) Error() string

type Logs

type Logs interface {
	Read(ctx context.Context, q LogQuery, emit func([]LogEntry) error, notice func(LogNotice) error) error
}

type Namespace

type Namespace string
const DefaultNamespace Namespace = "ocel"

func NamespaceFromEnv

func NamespaceFromEnv() (Namespace, error)

func ParseNamespace

func ParseNamespace(given string) (Namespace, error)

func (Namespace) String

func (n Namespace) String() string

type Options

type Options map[string]any

type OriginGuard

type OriginGuard struct {
	RootFunction string
}

type Pairing

type Pairing struct {
	Edge      edge.Kind
	Router    router.Kind
	Computes  []Compute
	Forwarded bool
}

type Part

type Part struct {
	Name    string
	Summary string
	Edges   []edge.Kind
}

type PartShape

type PartShape struct {
	Vendor    string
	Region    string
	Resources []pricing.Shaped
}

type PhysicalResource

type PhysicalResource struct {
	Kind       string
	ID         string
	Location   string `json:",omitempty"`
	ConsoleURL string `json:",omitempty"`
}

type Plan

type Plan struct {
	Groups []ChangeGroup
}

type PortForward

type PortForward struct {
	Binding      string
	LocalAddress string
	Properties   map[string]string
	Close        func()
}

type PortForwardRequest

type PortForwardRequest struct {
	Tier          environment.Tier
	Bindings      []Binding
	ReportFailure func(error)
}

type PostgresSpec

type PostgresSpec struct {
	Version string
}

type PreflightHooks

type PreflightHooks struct {
	Plan  func(ctx context.Context, pre DeployPreflight) (Plan, error)
	Apply func(ctx context.Context, pre DeployPreflight) error
}

type Principal

type Principal struct {
	Vendor    Vendor
	Account   string
	Name      string
	Location  string
	EdgeScope string
	Details   []PrincipalDetail
}

type PrincipalDetail

type PrincipalDetail struct {
	Label string
	Value string
}

type ProbeFailure

type ProbeFailure struct {
	Cause      string
	HTTPStatus int
}

type ProjectRemovalHooks

type ProjectRemovalHooks struct {
	Plan   func(ctx context.Context, tier environment.Tier, project string) ([]ChangeGroup, error)
	Remove func(ctx context.Context, tier environment.Tier, project string, progress progress.Log) error
}

type ProjectResourcesRequest

type ProjectResourcesRequest struct {
	Tier           environment.Tier
	Project        string
	EdgeKind       edge.Kind
	EdgeStack      edge.StackState
	Routers        map[router.Kind]router.StackState
	DNSKind        DNSKind
	WrittenRecords []edge.Record
	Certificates   []Certificate
	Images         []string
}

type PromotedReleases

type PromotedReleases struct {
	Slug     string
	Tier     environment.Tier
	Env      string
	Releases []AppRelease
}

type Provider

type Provider interface {
	Facts() Facts
	Hooks() Hooks

	Bootstrap(kind edge.Kind) (Bootstrap, error)
	Stacks() Stacks
	Artifacts() ArtifactStore
	KeyValues() records.Store
	Cipher() seal.Cipher
	Credentials() Credentials
	Edges() Edges
	Routers() Routers
	DNS() DNS
	Certificates() Certificates
	Connector() Connector
	Runtime() Runtime
	Liveness() Liveness
	Logs() Logs
}

type Question

type Question struct {
	Finding string
	Prompt  string
	Remedy  string
	Confirm func(ctx context.Context) error
}

func QuestionOf

func QuestionOf(err error) (Question, bool)

type QuestionRefusal

type QuestionRefusal struct {
	refusal.Refusal
	Question Question
}

func (QuestionRefusal) Unwrap

func (r QuestionRefusal) Unwrap() error

type RealtimeSpec

type RealtimeSpec struct {
	Channels []ChannelSpec
	TokenTTL time.Duration
}

type RecordPurpose

type RecordPurpose string
const (
	RecordIdempotency RecordPurpose = "idempotency"
	RecordDebounce    RecordPurpose = "debounce"
)

type RegistryTarget

type RegistryTarget struct {
	Server    string
	Namespace string
	Username  string
	Password  string
}

func (RegistryTarget) GoString

func (t RegistryTarget) GoString() string

func (RegistryTarget) ImageRef

func (t RegistryTarget) ImageRef(repository, tag string) string

func (RegistryTarget) Named

func (t RegistryTarget) Named() bool

func (RegistryTarget) String

func (t RegistryTarget) String() string

type Release

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

func NewRelease

func NewRelease(buildID, promotionID, environment, values string) (Release, error)

func ParseRelease

func ParseRelease(rendered string) (Release, error)

func (Release) BuildID

func (r Release) BuildID() string

func (Release) Fingerprint

func (r Release) Fingerprint() string

func (Release) IsZero

func (r Release) IsZero() bool

func (Release) String

func (r Release) String() string

func (Release) Token

func (r Release) Token() naming.ReleaseToken

type Resource

type Resource struct {
	Name     string
	Declared string
	Type     BindingType
	Binding  string

	Postgres *PostgresSpec
	Bucket   *BucketSpec
	KV       *KVSpec
	Topic    *TopicSpec
	Realtime *RealtimeSpec
}

type RetirementHooks

type RetirementHooks struct {
	Plan   func(ctx context.Context, live LiveApps, progress progress.Log) (Plan, error)
	Retire func(ctx context.Context, live LiveApps, progress progress.Log) error
}

type RetryPolicy

type RetryPolicy struct {
	MaxAttempts int
	MinDelay    time.Duration
	MaxDelay    time.Duration
}

type Routers

type Routers interface {
	Open(kind router.Kind) (router.Router, error)
}

type RoutingSpec

type RoutingSpec struct {
	RootFunction string
	RouteTable   router.RouteTable
}

type RunStatus

type RunStatus string
const (
	RunDelayed   RunStatus = "delayed"
	RunQueued    RunStatus = "queued"
	RunExecuting RunStatus = "executing"
	RunCompleted RunStatus = "completed"
	RunFailed    RunStatus = "failed"
	RunCanceled  RunStatus = "canceled"
	RunExpired   RunStatus = "expired"
	RunTimedOut  RunStatus = "timed-out"
)

type Runtime

type Runtime interface {
	Arch(ctx context.Context, app, declared string) (string, error)
	Binary(ctx context.Context, arch string) ([]byte, error)
	FunctionBase(ctx context.Context, framework buildoutput.Framework) (v1.Image, error)
	FunctionFiles(ctx context.Context, framework buildoutput.Framework) (map[string][]byte, error)
	FunctionBuildPaths(framework buildoutput.Framework) []string
}

type SecretRef

type SecretRef struct {
	Key    string
	Folder string
}

type Settings

type Settings struct {
	Options    Options
	Transforms []string
	Slug       string
	ProjectDir string
	WrittenBy  WrittenBy

	WebIdentity *WebIdentity
}

type ShapeRequest

type ShapeRequest struct {
	Deploy     DeploySpec
	Edge       edge.Kind
	Parts      []string
	Resources  []Resource
	Functions  map[string][]FunctionSpec
	Usages     []AppUsage
	Transforms []string
	Uses       []buildoutput.Uses
}

type StackDestroy

type StackDestroy struct {
	Ref       StackRef
	Images    ImageStore
	Lease     Lease
	KeepParts bool
}

type StackKind

type StackKind string
const (
	StackInfra StackKind = "infra"
	StackApp   StackKind = "app"
)

type StackRef

type StackRef struct {
	Project string
	Tier    environment.Tier
	Name    naming.StackName
}

type StackResources

type StackResources struct {
	Ref           StackRef
	NewestRelease bool
}

type StackResult

type StackResult struct {
	Bindings []Binding

	Functions []Function

	Containers []AppContainer

	EdgeBundleKey string

	RouteTableKey string

	Envelope string

	PurgeSecret string

	OriginSecretFingerprint string
}

type StackSpec

type StackSpec struct {
	Ref   StackRef
	Kind  StackKind
	Lease Lease

	Edge edge.Edge

	Tags map[string]string

	Resources []Resource

	Images ImagePushes

	Recorded bool

	Bindings Bindings

	App *AppSpec
}

type Stacks

type Stacks interface {
	Plan(ctx context.Context, spec StackSpec, progress progress.Log) (Plan, error)

	Provision(ctx context.Context, spec StackSpec, progress progress.Log) (StackResult, error)

	PlanDestroy(ctx context.Context, ref StackRef, progress progress.Log) (Plan, error)

	Destroy(ctx context.Context, req StackDestroy, progress progress.Log) error

	Resources(ctx context.Context, req StackResources) ([]PhysicalResource, error)
}

type TierIdentity

type TierIdentity struct {
	IdentityProvider string
	Principal        string
}

type TopicSpec

type TopicSpec struct {
	Schema    string
	Ordered   bool
	TTL       time.Duration
	Cron      string
	Consumers []ConsumerSpec
}

type Vendor

type Vendor string

type WantedPartError

type WantedPartError struct {
	Part string
	Err  error
}

func (WantedPartError) Error

func (e WantedPartError) Error() string

func (WantedPartError) Unwrap

func (e WantedPartError) Unwrap() error

type WebIdentity

type WebIdentity struct {
	TokenFile        string
	IdentityProvider string
	Principal        string
	SessionName      string
}

type WebIdentityFacts

type WebIdentityFacts struct {
	CredentialEnvVars []string
}

type WebIdentityTrust

type WebIdentityTrust struct {
	Issuer         string
	Audience       string
	OrganizationID string
	TargetID       string
}

type WorkerCeiling

type WorkerCeiling struct {
	Compute     Compute
	MaxDuration time.Duration
	Unbounded   bool
}

func WorkerCeilingsOf

func WorkerCeilingsOf(messages []*contractv1.WorkerCeiling) []WorkerCeiling

type WorkerSpec

type WorkerSpec struct {
	Name        string
	Concurrency int
	App         string
	Compute     Compute
}

type Wrapped

type Wrapped func(ctx context.Context) (v1.Image, func(), error)

type WrittenBy

type WrittenBy string

func WrittenByVersion

func WrittenByVersion(version string) WrittenBy

func (WrittenBy) Development

func (w WrittenBy) Development() bool

func (WrittenBy) Newer

func (w WrittenBy) Newer(than WrittenBy) bool

func (WrittenBy) Release

func (w WrittenBy) Release() bool

func (WrittenBy) String

func (w WrittenBy) String() string

Jump to

Keyboard shortcuts

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