Documentation
¶
Index ¶
- Constants
- Variables
- func AttributeHostnames(project []string, apps [][]string) [][]string
- func DerivePurgeSecret(seed, storageCoordinate string) string
- func EdgeGroupName(kind Kind) string
- func ListPreviewHostnames(hosts []PreviewHost) []string
- func Loopback(hostname string) bool
- func NeedNames(needs []Need) []string
- func NewCachingOriginEnv(facts Facts, release string) map[string]string
- func NewPreviewToken() (string, error)
- func OriginSecretFingerprint(secret string) string
- func Pointable(target DNSTarget, bound []string, hostname string) bool
- func PreviewWildcard(baseDomain string) string
- func ProbeHostname(hostname string) string
- func RefuseUnusablePreviewBase(base string) error
- func ValidNeed(need Need) bool
- func ValidPlanAction(action PlanAction) bool
- func ZoneOwns(hostname, zone string) bool
- type Adoption
- type BootstrapOutput
- type BootstrapPart
- type CacheRule
- type CacheTagLimits
- type ClientCertificateHooks
- type CodeEntitlement
- type CredentialDocument
- type CredentialIdentity
- type CredentialPurpose
- type DNSRecords
- type DNSTarget
- type DomainBinding
- type Edge
- type EdgeCacheMode
- type EdgeStack
- type Entitlement
- type Facts
- type Fallback
- type GatePublication
- type HeaderRule
- type Hooks
- type Kind
- type Need
- type OcelRouteTable
- type Origin
- type OriginCertificate
- type OriginCertificateHooks
- type OriginImages
- type OriginReach
- type OriginStore
- type Outstanding
- type OutstandingError
- type PlanAction
- type PlanChange
- type PlanGroup
- type PreviewHost
- type PreviewKey
- type PreviewSite
- type PreviewWildcardSpec
- type Private
- type Program
- type ProjectScope
- type PurgeBudget
- type Reach
- type ReachKind
- type Record
- type RecordType
- type RedirectRule
- type ReleasesStore
- type Route
- type RouteTableFormat
- type StackSpec
- type StackState
- func (s *StackState) Bind(hostname string)
- func (s StackState) Empty() bool
- func (s StackState) Equal(other StackState) bool
- func (s *StackState) PublishAddress(hostname, address string)
- func (s *StackState) RecordWrites(records []Record)
- func (s *StackState) Release(hostname string)
- func (s StackState) ServedOnGlobalPreview(baseDomain string) bool
- type Static
- type Throttle
- type TrailingSlash
- type TrustBoundary
- type Tunnel
- type TunnelConnector
- type TunnelHooks
- type Zone
Constants ¶
View Source
const ( PreviewTokenLen = 16 PreviewTailLen = PreviewTokenLen + previewMACLen )
View Source
const ( NextRouteTableFile = "next-route-table.json" OcelRouteTableFile = "ocel-route-table.json" )
View Source
const ( ImmutableCacheControl = "public, max-age=31536000, immutable" RevalidateCacheControl = "public, max-age=0, must-revalidate" )
View Source
const ( OcelRouteTableVar = "OCEL_ROUTE_TABLE" ReleaseTokenVar = "OCEL_RELEASE_TOKEN" EdgeCacheVar = "OCEL_EDGE_CACHE" EdgeCacheControlHeaderVar = "OCEL_EDGE_CACHE_CONTROL_HEADER" )
View Source
const ( OriginSecretVar = "OCEL_ORIGIN_SECRET" OriginSecretPreviousVar = "OCEL_ORIGIN_SECRET_PREVIOUS" OriginSignedVar = "OCEL_ORIGIN_SIGNED" OriginDispatchVar = "OCEL_ORIGIN_DISPATCH" CacheTagPurgeVar = "OCEL_CACHE_TAG_PURGE" OriginSecretHeader = "x-ocel-origin-secret" OriginContainerHeader = "x-ocel-container" )
View Source
const AppBundleFile = "edge/bundle.json"
View Source
const EdgeGroupKind = "edge"
View Source
const HeaderClientAddress = "x-ocel-client-address"
View Source
const HeaderClientAuthorization = "x-ocel-client-authorization"
View Source
const HeaderEmptyBody = "x-ocel-empty-body"
View Source
const ImageOptimizerURLVar = "OCEL_IMAGE_OPTIMIZER_URL"
View Source
const LivenessProbeLabel = "ocel-edge-probe"
View Source
const LivenessProbePath = "/.well-known/ocel-edge"
View Source
const OcelRouteTableVersion = 1
View Source
const OriginCertificateRenewal = 182 * 24 * time.Hour
View Source
const OriginFrontedVar = "OCEL_ORIGIN_FRONTED"
View Source
const OriginGroupName = "origin"
View Source
const OriginReachVar = "OCEL_ORIGIN"
View Source
const PreviewEntryOwner = "ocel-preview-entry"
View Source
const PreviewKeyVar = "OCEL_PREVIEW_KEY"
View Source
const PreviewLabelMaxLen = 63
View Source
const ProxyPlaceholder = "100::"
View Source
const PurgeURLVar = "OCEL_PURGE_URL"
View Source
const StaticAssetDir = "static"
View Source
const StaticRulesVar = "OCEL_STATIC_RULES"
Variables ¶
View Source
var ErrStoreAbsent = errors.New("the releases store is not provisioned")
Functions ¶
func AttributeHostnames ¶
func DerivePurgeSecret ¶
func EdgeGroupName ¶
func ListPreviewHostnames ¶
func ListPreviewHostnames(hosts []PreviewHost) []string
func NewPreviewToken ¶
func OriginSecretFingerprint ¶
func PreviewWildcard ¶
func ProbeHostname ¶
func ValidPlanAction ¶
func ValidPlanAction(action PlanAction) bool
Types ¶
type BootstrapOutput ¶
type BootstrapOutput struct {
Trust TrustBoundary
ReleasesStore *ReleasesStore
}
type BootstrapPart ¶
type CacheTagLimits ¶
func (CacheTagLimits) IsZero ¶
func (l CacheTagLimits) IsZero() bool
type ClientCertificateHooks ¶
type CodeEntitlement ¶
type CodeEntitlement struct {
Plan string
Granted Entitlement
Reason string
}
type CredentialDocument ¶
type CredentialIdentity ¶
type CredentialIdentity struct {
Account string
}
type CredentialPurpose ¶
type CredentialPurpose string
const ( PurposeBootstrap CredentialPurpose = "bootstrap" PurposeDeploy CredentialPurpose = "deploy" )
type DNSRecords ¶
type DNSTarget ¶
type DNSTarget struct {
Kind Kind
ServesUnbound bool
ProxiesRecords bool
Address string
AddressByHost map[string]string
}
func TargetFor ¶
func TargetFor(e Edge, state StackState) DNSTarget
func (DNSTarget) AddressFor ¶
type DomainBinding ¶
type Edge ¶
type Edge interface {
Kind() Kind
Facts() Facts
Hooks() Hooks
Bootstrap(ctx context.Context, tier environment.Tier) (BootstrapOutput, error)
Teardown(ctx context.Context, tier environment.Tier) error
Reconcile(ctx context.Context, spec StackSpec, prior StackState) (EdgeStack, error)
Open(state StackState) (EdgeStack, error)
ReconcilePreviewWildcard(ctx context.Context, spec PreviewWildcardSpec) (string, error)
DestroyPreviewWildcard(ctx context.Context, baseDomain string) error
DomainOwner(ctx context.Context, hostname string) (string, error)
ProjectOwner(ctx context.Context, slug string, tier environment.Tier) (string, error)
PlanProjectRemoval(scope ProjectScope) ([]PlanGroup, error)
PlanPreviewWildcardRemoval(wildcard string) (removed, kept PlanGroup, err error)
}
type EdgeCacheMode ¶
type EdgeCacheMode string
const ( EdgeCacheNone EdgeCacheMode = "" EdgeCacheMarked EdgeCacheMode = "marked" EdgeCacheAll EdgeCacheMode = "all" )
func NewEdgeCacheMode ¶
func NewEdgeCacheMode(facts Facts) EdgeCacheMode
type Entitlement ¶
type Entitlement string
const ( EntitlementUnknown Entitlement = "unknown" EntitlementGranted Entitlement = "granted" EntitlementWithheld Entitlement = "withheld" )
type Facts ¶
type Facts struct {
Supported []Need
RunsCode bool
ServesUnbound bool
ProxiesRecords bool
ProxiedRecordNote string
ShieldsOrigin bool
TunnelsToOrigin bool
OriginFacingRanges []string
InvalidatesByCacheTag bool
CachesResponses bool
CacheControlHeader string
CacheTagLimits CacheTagLimits
PurgeBudget PurgeBudget
Gates bool
GatesAtOrigin bool
ChecksSignedPasswords bool
CredentialScope string
}
type GatePublication ¶
type GatePublication struct {
State StackState
Gate *gate.Gate
Say func(string)
}
type HeaderRule ¶
type Hooks ¶
type Hooks struct {
PlanBootstrap func(ctx context.Context, tier environment.Tier) ([]PlanChange, error)
PlanRemoveBootstrap func(ctx context.Context, tier environment.Tier) ([]PlanChange, error)
PlanAdoption func(ctx context.Context, tier environment.Tier) (Adoption, error)
DescribeBootstrap func(ctx context.Context, tier environment.Tier) ([]BootstrapPart, error)
CheckBootstrapInstalled func(ctx context.Context, tier environment.Tier) (bool, error)
ListBoundHostnames func(ctx context.Context, tier environment.Tier) ([]string, error)
VerifyCredentials func(ctx context.Context) (CredentialIdentity, error)
CheckCodeEntitlement func(ctx context.Context) (CodeEntitlement, error)
DescribeCredentialPermissions func(purpose CredentialPurpose) (CredentialDocument, error)
ClientCertificates *ClientCertificateHooks
OriginCertificates *OriginCertificateHooks
PurgeHostnames func(ctx context.Context, hostnames []string) error
Tunnels *TunnelHooks
PublishGate func(ctx context.Context, publication GatePublication) error
}
type OcelRouteTable ¶
type OcelRouteTable struct {
Version int `json:"version"`
BasePath string `json:"basePath"`
TrailingSlash TrailingSlash `json:"trailingSlash"`
Headers []HeaderRule `json:"headers"`
Redirects []RedirectRule `json:"redirects"`
Routes []Route `json:"routes"`
Fallback Fallback `json:"fallback"`
}
func ReadOcelRouteTable ¶
func ReadOcelRouteTable(raw []byte) (OcelRouteTable, error)
func (OcelRouteTable) Functions ¶
func (r OcelRouteTable) Functions() []string
func (OcelRouteTable) HasCachedRoute ¶
func (r OcelRouteTable) HasCachedRoute() bool
type OriginCertificate ¶
type OriginCertificateHooks ¶
type OriginImages ¶
type OriginReach ¶
type OriginReach struct {
Reach Reach `json:"reach"`
Store *OriginStore `json:"store,omitempty"`
Throttle Throttle `json:"throttle"`
Images *OriginImages `json:"images,omitempty"`
}
func (OriginReach) RefuseIncomplete ¶
func (o OriginReach) RefuseIncomplete() error
type OriginStore ¶
type Outstanding ¶
type OutstandingError ¶
type OutstandingError struct {
Because string
Waited time.Duration
Items []Outstanding
}
func (*OutstandingError) Error ¶
func (e *OutstandingError) Error() string
type PlanAction ¶
type PlanAction string
const ( PlanCreate PlanAction = "create" PlanUpdate PlanAction = "update" PlanDelete PlanAction = "delete" PlanDisableThenDelete PlanAction = "disable-then-delete" PlanKeep PlanAction = "keep" )
type PlanChange ¶
type PlanChange struct {
Kind string
Name string
Action PlanAction
Reason string
Slow bool
}
type PlanGroup ¶
type PlanGroup struct {
Kind string
Name string
Part string
Action PlanAction
Reason string
Slow bool
Changes []PlanChange
}
type PreviewHost ¶
func (PreviewHost) ReadLabel ¶
func (h PreviewHost) ReadLabel() string
func (PreviewHost) ReadPrefix ¶
func (h PreviewHost) ReadPrefix() string
func (PreviewHost) ReadTail ¶
func (h PreviewHost) ReadTail() string
type PreviewKey ¶
type PreviewKey string
func NewPreviewKey ¶
func NewPreviewKey() (PreviewKey, error)
func (PreviewKey) Sign ¶
func (k PreviewKey) Sign(prefix, token string) string
type PreviewSite ¶
type PreviewSite struct {
// contains filtered or unexported fields
}
func NewProjectPreviewSite ¶
func NewProjectPreviewSite(baseDomain string, key PreviewKey) PreviewSite
func NewSharedPreviewSite ¶
func NewSharedPreviewSite(slug, baseDomain string, key PreviewKey) PreviewSite
func (PreviewSite) IsServing ¶
func (s PreviewSite) IsServing() bool
func (PreviewSite) ListHosts ¶
func (s PreviewSite) ListHosts(name, token string, apps []string) []PreviewHost
func (PreviewSite) RefuseOverlongLabels ¶
func (s PreviewSite) RefuseOverlongLabels(hosts []PreviewHost) error
type PreviewWildcardSpec ¶
type Private ¶
type Private struct {
// contains filtered or unexported fields
}
func (Private) MarshalJSON ¶
func (*Private) UnmarshalJSON ¶
type Program ¶
type Program struct {
Origin OriginReach
ReleasesStore ReleasesStore
PreviewBaseDomain string
PreviewKey PreviewKey
}
type ProjectScope ¶
type ProjectScope struct {
Slug string
Tier environment.Tier
Hostnames []string
Address string
}
type PurgeBudget ¶
type PurgeBudget struct {
TagsPerPurge int
}
func (PurgeBudget) IsZero ¶
func (b PurgeBudget) IsZero() bool
type Reach ¶
type Reach struct {
Kind ReachKind `json:"kind"`
Service string `json:"service,omitempty"`
Region string `json:"region,omitempty"`
AccessKeyID string `json:"accessKeyId,omitempty"`
SecretAccessKey string `json:"secretAccessKey,omitempty"`
Secret string `json:"secret,omitempty"`
PreviousSecret string `json:"previousSecret,omitempty"`
PreviousFingerprint string `json:"previousFingerprint,omitempty"`
}
type Record ¶
type Record struct {
Name string `json:"name"`
Type RecordType `json:"type"`
Value string `json:"value"`
Proxied bool `json:"proxied,omitempty"`
}
func (Record) Instruction ¶
type RecordType ¶
type RecordType string
const ( RecordTypeA RecordType = "A" RecordTypeAAAA RecordType = "AAAA" RecordTypeCNAME RecordType = "CNAME" )
type RedirectRule ¶
type ReleasesStore ¶
type RouteTableFormat ¶
type RouteTableFormat string
const ( RouteTableNext RouteTableFormat = "next" RouteTableOcel RouteTableFormat = "ocel" )
type StackState ¶
type StackState struct {
Slug string `json:"slug,omitempty"`
Tier environment.Tier `json:"tier,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
Secret string `json:"secret,omitempty"`
Address string `json:"address,omitempty"`
Addresses map[string]string `json:"addresses,omitempty"`
Bound []string `json:"bound,omitempty"`
Records []Record `json:"records,omitempty"`
GlobalPreview string `json:"globalPreview,omitempty"`
PreviewBase string `json:"previewBase,omitempty"`
PurgeURL string `json:"purgeURL,omitempty"`
Private Private `json:"private,omitzero"`
}
func (*StackState) Bind ¶
func (s *StackState) Bind(hostname string)
func (StackState) Empty ¶
func (s StackState) Empty() bool
func (StackState) Equal ¶
func (s StackState) Equal(other StackState) bool
func (*StackState) PublishAddress ¶
func (s *StackState) PublishAddress(hostname, address string)
func (*StackState) RecordWrites ¶
func (s *StackState) RecordWrites(records []Record)
func (*StackState) Release ¶
func (s *StackState) Release(hostname string)
func (StackState) ServedOnGlobalPreview ¶
func (s StackState) ServedOnGlobalPreview(baseDomain string) bool
type Static ¶
type Static struct {
ImmutablePrefixes []string `json:"immutablePrefixes"`
MustRevalidatePrefixes []string `json:"mustRevalidatePrefixes,omitempty"`
}
func (*Static) CacheControl ¶
func (*Static) IsImmutable ¶
type TrailingSlash ¶
type TrailingSlash string
const ( TrailingSlashNever TrailingSlash = "never" TrailingSlashAlways TrailingSlash = "always" TrailingSlashIgnore TrailingSlash = "ignore" )
type TrustBoundary ¶
type TrustBoundary string
const ( TrustExternal TrustBoundary = "external" TrustInternal TrustBoundary = "internal" )
type TunnelConnector ¶
type TunnelHooks ¶
Source Files
¶
- bootstrap.go
- buildfiles.go
- cacheenv.go
- cachetaglimits.go
- clientaddress.go
- clientauthorization.go
- dns.go
- domains.go
- edge.go
- emptybody.go
- fronted.go
- hooks.go
- hostnames.go
- liveness.go
- ocelroutepattern.go
- ocelroutetable.go
- outstanding.go
- previewbase.go
- previewkey.go
- previewlabel.go
- previewwildcard.go
- program.go
- purgebudget.go
- purgesecret.go
- routetable.go
- stack.go
- static.go
- tunnel.go
- variables.go
Click to show internal directories.
Click to hide internal directories.