projectconfig

package
v0.43.3 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package projectconfig handles declarative project configuration manifests (volcano-config.yaml). The CLI is a thin client: it parses the manifest, interpolates ${ENV} references, and uploads it to the server, which owns validation and reconciliation.

Index

Constants

View Source
const (
	// ManifestVersion is the only currently supported manifest schema version.
	ManifestVersion = 1

	// FunctionKindDurable is the manifest value that declares a durable
	// function.
	FunctionKindDurable = "durable"

	// FunctionKindStandard is the kind a function has when the manifest omits
	// one, and the only other value it may carry.
	FunctionKindStandard = "standard"
)
View Source
const (
	FunctionVisibilityPrivate       = "private"
	FunctionVisibilityAuthenticated = "authenticated"
	FunctionVisibilityPublic        = "public"
)

The function visibility levels a manifest may declare.

Variables

View Source
var ErrManifestNotFound = errors.New("no volcano-config.yaml file found.\ncreate volcano/volcano-config.yaml or ./volcano-config.yaml, or use --file to specify a path")

ErrManifestNotFound reports that no volcano-config.yaml exists at any of the locations the CLI looks in. Callers that treat an absent manifest as "nothing declared" match it with errors.Is; every other resolution failure (an explicit path that does not exist, or two competing manifests) is a real error that must not be read as absence.

View Source
var ErrUnsafePulledManifest = errors.New("downloaded configuration could not be checked for variable values")

ErrUnsafePulledManifest reports that a downloaded manifest could not be checked or cleaned of variable values, so nothing was written. The download itself succeeded; callers match it with errors.Is to avoid framing this as a transport failure.

Functions

func DefaultPullPath added in v0.0.5

func DefaultPullPath() string

DefaultPullPath returns where `config pull` writes when no --file is given: an existing manifest location if one is found, else volcano/volcano-config.yaml when the volcano directory exists, else ./volcano-config.yaml.

func FunctionVariableDeclarations added in v0.24.0

func FunctionVariableDeclarations(fileArg string) (map[string]FunctionVariableDeclaration, error)

FunctionVariableDeclarations reads the manifest that `volcano config deploy` would use and returns each function's variable declaration keyed by function name. The manifest is only read — deploy never writes it back.

Absence and invalidity are different answers. With no volcano-config.yaml anywhere, there is nothing to declare: this returns an empty map and deploy behaves exactly as it did before scoping existed. When a manifest does exist but cannot be resolved, read, interpolated, or validated, this returns an error so deploy aborts before uploading. Failing open there would silently drop an explicit `variable_scope: scoped` — for example when an unrelated `value: ${API_KEY}` elsewhere in the manifest is unset in the deploying shell — and hand the function every project variable instead.

func ResolveManifestPath

func ResolveManifestPath(fileArg string) (string, error)

ResolveManifestPath returns the manifest path that config commands should use. An explicit path is used as-is (after existence check); otherwise the CLI looks for volcano/volcano-config.yaml then volcano-config.yaml in the working directory. When nothing is found it returns ErrManifestNotFound.

Types

type AuthCORSManifest added in v0.0.5

type AuthCORSManifest struct {
	Enabled          *bool     `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	AllowedOrigins   *[]string `yaml:"allowed_origins,omitempty" json:"allowed_origins,omitempty"`
	AllowCredentials *bool     `yaml:"allow_credentials,omitempty" json:"allow_credentials,omitempty"`
	MaxAge           *int      `yaml:"max_age,omitempty" json:"max_age,omitempty"`
}

AuthCORSManifest declares auth CORS settings.

type AuthEmailFromManifest added in v0.0.5

type AuthEmailFromManifest struct {
	Address *string `yaml:"address,omitempty" json:"address,omitempty"`
	Name    *string `yaml:"name,omitempty" json:"name,omitempty"`
}

AuthEmailFromManifest declares the sender identity.

type AuthEmailManifest added in v0.0.5

type AuthEmailManifest struct {
	Enabled   *bool                   `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	From      *AuthEmailFromManifest  `yaml:"from,omitempty" json:"from,omitempty"`
	SMTP      *AuthEmailSMTPManifest  `yaml:"smtp,omitempty" json:"smtp,omitempty"`
	Templates *EmailTemplatesManifest `yaml:"templates,omitempty" json:"templates,omitempty"`
}

AuthEmailManifest declares transactional email settings.

type AuthEmailPasswordManifest added in v0.0.5

type AuthEmailPasswordManifest struct {
	Enabled *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
}

AuthEmailPasswordManifest declares the email/password provider switch.

type AuthEmailSMTPManifest added in v0.0.5

type AuthEmailSMTPManifest struct {
	Host     *string `yaml:"host,omitempty" json:"host,omitempty"`
	Port     *int    `yaml:"port,omitempty" json:"port,omitempty"`
	Username *string `yaml:"username,omitempty" json:"username,omitempty"`
	Password *string `yaml:"password,omitempty" json:"password,omitempty"`
	UseTLS   *bool   `yaml:"use_tls,omitempty" json:"use_tls,omitempty"`
}

AuthEmailSMTPManifest declares SMTP delivery settings.

type AuthEmailVerificationManifest added in v0.0.5

type AuthEmailVerificationManifest struct {
	RequireConfirmation *bool `yaml:"require_confirmation,omitempty" json:"require_confirmation,omitempty"`
	ConfirmationTimeout *int  `yaml:"confirmation_timeout,omitempty" json:"confirmation_timeout,omitempty"`
}

AuthEmailVerificationManifest declares email confirmation behavior.

type AuthManagedPagesManifest added in v0.0.5

type AuthManagedPagesManifest struct {
	Enabled   *bool                  `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Redirects *AuthRedirectsManifest `yaml:"redirects,omitempty" json:"redirects,omitempty"`
	Pages     *HostedPagesManifest   `yaml:"pages,omitempty" json:"pages,omitempty"`
}

AuthManagedPagesManifest declares managed auth page settings.

type AuthManifest added in v0.0.5

type AuthManifest struct {
	Tokens            *AuthTokensManifest            `yaml:"tokens,omitempty" json:"tokens,omitempty"`
	Sessions          *AuthSessionsManifest          `yaml:"sessions,omitempty" json:"sessions,omitempty"`
	Signup            *AuthSignupManifest            `yaml:"signup,omitempty" json:"signup,omitempty"`
	RateLimits        *AuthRateLimitsManifest        `yaml:"rate_limits,omitempty" json:"rate_limits,omitempty"`
	Password          *AuthPasswordManifest          `yaml:"password,omitempty" json:"password,omitempty"`
	PasswordReset     *AuthPasswordResetManifest     `yaml:"password_reset,omitempty" json:"password_reset,omitempty"`
	EmailVerification *AuthEmailVerificationManifest `yaml:"email_verification,omitempty" json:"email_verification,omitempty"`
	Cors              *AuthCORSManifest              `yaml:"cors,omitempty" json:"cors,omitempty"`
	Providers         *AuthProvidersManifest         `yaml:"providers,omitempty" json:"providers,omitempty"`
	Email             *AuthEmailManifest             `yaml:"email,omitempty" json:"email,omitempty"`
	ManagedPages      *AuthManagedPagesManifest      `yaml:"managed_pages,omitempty" json:"managed_pages,omitempty"`
}

AuthManifest groups authentication settings like the dashboard tabs.

type AuthPasswordManifest added in v0.0.5

type AuthPasswordManifest struct {
	MinLength           *int  `yaml:"min_length,omitempty" json:"min_length,omitempty"`
	RequireUppercase    *bool `yaml:"require_uppercase,omitempty" json:"require_uppercase,omitempty"`
	RequireLowercase    *bool `yaml:"require_lowercase,omitempty" json:"require_lowercase,omitempty"`
	RequireNumbers      *bool `yaml:"require_numbers,omitempty" json:"require_numbers,omitempty"`
	RequireSpecialChars *bool `yaml:"require_special_chars,omitempty" json:"require_special_chars,omitempty"`
}

AuthPasswordManifest declares password strength requirements.

type AuthPasswordResetManifest added in v0.0.5

type AuthPasswordResetManifest struct {
	Allow      *bool `yaml:"allow,omitempty" json:"allow,omitempty"`
	Timeout    *int  `yaml:"timeout,omitempty" json:"timeout,omitempty"`
	MaxHistory *int  `yaml:"max_history,omitempty" json:"max_history,omitempty"`
}

AuthPasswordResetManifest declares password reset behavior.

type AuthProvidersManifest added in v0.0.5

type AuthProvidersManifest struct {
	EmailPassword *AuthEmailPasswordManifest `yaml:"email_password,omitempty" json:"email_password,omitempty"`
	Oauth         *[]OAuthProviderManifest   `yaml:"oauth,omitempty" json:"oauth,omitempty"`
}

AuthProvidersManifest declares sign-in providers.

type AuthRateLimitsManifest added in v0.0.5

type AuthRateLimitsManifest struct {
	Signup        *int `yaml:"signup,omitempty" json:"signup,omitempty"`
	Signin        *int `yaml:"signin,omitempty" json:"signin,omitempty"`
	TokenRefresh  *int `yaml:"token_refresh,omitempty" json:"token_refresh,omitempty"`
	PasswordReset *int `yaml:"password_reset,omitempty" json:"password_reset,omitempty"`
}

AuthRateLimitsManifest declares per-hour auth rate limits.

type AuthRedirectsManifest added in v0.0.5

type AuthRedirectsManifest struct {
	Allowed            *[]string `yaml:"allowed,omitempty" json:"allowed,omitempty"`
	PostAuth           *string   `yaml:"post_auth,omitempty" json:"post_auth,omitempty"`
	PostLogout         *string   `yaml:"post_logout,omitempty" json:"post_logout,omitempty"`
	DeviceVerification *string   `yaml:"device_verification,omitempty" json:"device_verification,omitempty"`
}

AuthRedirectsManifest declares the redirect allowlist and defaults.

type AuthSessionsManifest added in v0.0.5

type AuthSessionsManifest struct {
	InactivityTimeout  *int `yaml:"inactivity_timeout,omitempty" json:"inactivity_timeout,omitempty"`
	MaxSessionDuration *int `yaml:"max_session_duration,omitempty" json:"max_session_duration,omitempty"`
}

AuthSessionsManifest declares session lifetime limits.

type AuthSignupManifest added in v0.0.5

type AuthSignupManifest struct {
	EnableSignup           *bool `yaml:"enable_signup,omitempty" json:"enable_signup,omitempty"`
	EnableAnonymousSignins *bool `yaml:"enable_anonymous_signins,omitempty" json:"enable_anonymous_signins,omitempty"`
	// AllowedEmailDomains replaces the stored allowlist; an empty list removes
	// the restriction. AllowedEmailDomainsMode is disabled, signup, or
	// signup_and_signin.
	AllowedEmailDomains     *[]string `yaml:"allowed_email_domains,omitempty" json:"allowed_email_domains,omitempty"`
	AllowedEmailDomainsMode *string   `yaml:"allowed_email_domains_mode,omitempty" json:"allowed_email_domains_mode,omitempty"`
}

AuthSignupManifest declares signup and access control switches.

type AuthTokensManifest added in v0.0.5

type AuthTokensManifest struct {
	AccessTokenLifetime       *int `yaml:"access_token_lifetime,omitempty" json:"access_token_lifetime,omitempty"`
	RefreshTokenLifetime      *int `yaml:"refresh_token_lifetime,omitempty" json:"refresh_token_lifetime,omitempty"`
	RefreshTokenReuseInterval *int `yaml:"refresh_token_reuse_interval,omitempty" json:"refresh_token_reuse_interval,omitempty"`
	PlatformTokenTTL          *int `yaml:"platform_token_ttl,omitempty" json:"platform_token_ttl,omitempty"`
}

AuthTokensManifest declares token lifetimes in seconds.

type BucketManifest

type BucketManifest struct {
	Name             string            `yaml:"name" json:"name"`
	FileSizeLimit    *int64            `yaml:"file_size_limit,omitempty" json:"file_size_limit,omitempty"`
	AllowedMimeTypes *[]string         `yaml:"allowed_mime_types,omitempty" json:"allowed_mime_types,omitempty"`
	Policies         *[]PolicyManifest `yaml:"policies,omitempty" json:"policies,omitempty"`
}

BucketManifest declares settings and policies for an existing bucket.

type CustomDomainManifest added in v0.0.5

type CustomDomainManifest struct {
	Domain string       `yaml:"domain" json:"domain"`
	TLS    *TLSManifest `yaml:"tls,omitempty" json:"tls,omitempty"`
}

CustomDomainManifest declares a frontend custom domain with BYOC TLS.

type DatabaseManifest added in v0.0.5

type DatabaseManifest struct {
	Name         string  `yaml:"name" json:"name"`
	Region       string  `yaml:"region" json:"region"`
	PgVersion    string  `yaml:"pg_version" json:"pg_version"`
	DatabaseType *string `yaml:"database_type,omitempty" json:"database_type,omitempty"`
}

DatabaseManifest asserts identity properties of an existing database.

type EmailTemplateManifest added in v0.0.5

type EmailTemplateManifest struct {
	Subject  *string `yaml:"subject,omitempty" json:"subject,omitempty"`
	HTMLBody *string `yaml:"html_body,omitempty" json:"html_body,omitempty"`
	TextBody *string `yaml:"text_body,omitempty" json:"text_body,omitempty"`
}

EmailTemplateManifest declares one email template.

type EmailTemplatesManifest added in v0.0.5

type EmailTemplatesManifest struct {
	Confirmation    *EmailTemplateManifest `yaml:"confirmation,omitempty" json:"confirmation,omitempty"`
	PasswordReset   *EmailTemplateManifest `yaml:"password_reset,omitempty" json:"password_reset,omitempty"`
	PasswordChanged *EmailTemplateManifest `yaml:"password_changed,omitempty" json:"password_changed,omitempty"`
	Welcome         *EmailTemplateManifest `yaml:"welcome,omitempty" json:"welcome,omitempty"`
}

EmailTemplatesManifest declares email templates keyed by type.

type FrontendManifest added in v0.0.5

type FrontendManifest struct {
	VariableScope *string               `yaml:"variable_scope,omitempty" json:"variable_scope,omitempty"`
	Variables     *[]string             `yaml:"variables,omitempty" json:"variables,omitempty"`
	Name          string                `yaml:"name" json:"name"`
	CustomDomain  *CustomDomainManifest `yaml:"custom_domain,omitempty" json:"custom_domain,omitempty"`
	// FunctionRoutes replaces the frontend's routes; nil preserves them and []
	// removes them.
	FunctionRoutes *[]FunctionRouteManifest `yaml:"function_routes,omitempty" json:"function_routes,omitempty"`
}

FrontendManifest declares configuration for one deployed frontend.

type FunctionDeployManifest added in v0.26.0

type FunctionDeployManifest struct {
	Declarations  map[string]FunctionVariableDeclaration
	DurableNames  map[string]bool
	StandardNames map[string]bool
	Visibility    map[string]string
	// Deprecations are the manifest's DeprecationWarnings.
	Deprecations []string
}

FunctionDeployManifest is what a function deploy needs from the manifest: each function's variable declaration, the names each collection is responsible for so neither deploy creates a function of the wrong kind, and the visibility each function declares. A deploy does not send that level; only config deploy applies it, so the deploy hints point there.

func ReadFunctionDeployManifest added in v0.26.0

func ReadFunctionDeployManifest(fileArg string) (FunctionDeployManifest, error)

ReadFunctionDeployManifest reads both of a deploy's manifest inputs in one pass, with the absence-versus-invalidity rule described on FunctionVariableDeclarations.

type FunctionManifest

type FunctionManifest struct {
	Name string `yaml:"name" json:"name"`
	// Kind is asserted rather than applied: a function's kind is fixed when it
	// is created, so the server compares this against the deployed function.
	// Empty means standard, which is what every manifest written before durable
	// functions existed declares.
	Kind *string `yaml:"kind,omitempty" json:"kind,omitempty"`
	// Visibility is private, authenticated, or public. Public is its deprecated
	// alias: true means public and false means authenticated. Validate refuses
	// an unknown level; the server judges a manifest that sets both.
	Visibility    *string   `yaml:"visibility,omitempty" json:"visibility,omitempty"`
	Public        *bool     `yaml:"public,omitempty" json:"public,omitempty"`
	VariableScope *string   `yaml:"variable_scope,omitempty" json:"variable_scope,omitempty"`
	Variables     *[]string `yaml:"variables,omitempty" json:"variables,omitempty"`
	// The invocation settings describe synchronous HTTP invocation, which a
	// durable function does not have; the server rejects them on one.
	InvocationMode *string              `yaml:"invocation_mode,omitempty" json:"invocation_mode,omitempty"`
	HTTPAuthMode   *string              `yaml:"http_auth_mode,omitempty" json:"http_auth_mode,omitempty"`
	OpenAPISpec    any                  `yaml:"openapi_spec,omitempty" json:"openapi_spec,omitempty"`
	Schedulers     *[]SchedulerManifest `yaml:"schedulers,omitempty" json:"schedulers,omitempty"`
}

FunctionManifest declares configuration for one deployed function.

type FunctionRouteManifest added in v0.37.0

type FunctionRouteManifest struct {
	Function    string `yaml:"function" json:"function"`
	PathPrefix  string `yaml:"path_prefix" json:"path_prefix"`
	StripPrefix *bool  `yaml:"strip_prefix,omitempty" json:"strip_prefix,omitempty"`
}

FunctionRouteManifest sends requests under PathPrefix on a frontend to a public HTTP-mode function.

type FunctionVariableDeclaration added in v0.24.0

type FunctionVariableDeclaration struct {
	VariableScope *string
	Variables     *[]string
}

FunctionVariableDeclaration is one function's variable scope declaration read from volcano-config.yaml. Both fields nil means the manifest declared nothing for that function.

type HostedPageManifest added in v0.0.5

type HostedPageManifest struct {
	HTML string  `yaml:"html" json:"html"`
	CSS  *string `yaml:"css,omitempty" json:"css,omitempty"`
}

HostedPageManifest declares one hosted auth page.

type HostedPagesManifest added in v0.0.5

type HostedPagesManifest struct {
	Login         *HostedPageManifest `yaml:"login,omitempty" json:"login,omitempty"`
	ResetPassword *HostedPageManifest `yaml:"reset_password,omitempty" json:"reset_password,omitempty"`
}

HostedPagesManifest declares hosted auth pages keyed by page type.

type Manifest

type Manifest struct {
	Version   int                 `yaml:"version" json:"version"`
	Project   *ProjectManifest    `yaml:"project,omitempty" json:"project,omitempty"`
	Databases *[]DatabaseManifest `yaml:"databases,omitempty" json:"databases,omitempty"`
	Variables *[]VariableManifest `yaml:"variables,omitempty" json:"variables,omitempty"`
	Buckets   *[]BucketManifest   `yaml:"buckets,omitempty" json:"buckets,omitempty"`
	Realtime  *RealtimeManifest   `yaml:"realtime,omitempty" json:"realtime,omitempty"`
	Auth      *AuthManifest       `yaml:"auth,omitempty" json:"auth,omitempty"`
	Functions *[]FunctionManifest `yaml:"functions,omitempty" json:"functions,omitempty"`
	Frontends *[]FrontendManifest `yaml:"frontends,omitempty" json:"frontends,omitempty"`
	Sandboxes *[]SandboxManifest  `yaml:"sandboxes,omitempty" json:"sandboxes,omitempty"`

	// SharedVariables replaces membership by name; nil preserves it and [] clears it.
	SharedVariables *[]string `yaml:"shared_variables,omitempty" json:"shared_variables,omitempty"`
	// FrontendSharedVariables replaces frontend membership by name;
	// nil preserves it and [] clears it.
	FrontendSharedVariables *[]string `yaml:"frontend_shared_variables,omitempty" json:"frontend_shared_variables,omitempty"`
	// contains filtered or unexported fields
}

Manifest is the on-disk shape of volcano-config.yaml. Field names mirror the server's canonical YAML rendering and the JSON tags match the ProjectConfig schema. The typed struct drives local decoding and validation; the apply request body is produced from the interpolated manifest as a generic shape (see uploadBody) rather than by marshaling this struct, so that omitted fields stay omitted and the server's required-field validation applies. A non-pointer field such as VariableManifest.Value would otherwise serialize an omitted value as its zero value ("") and, because empty variable values are valid, silently clear the variable instead of being rejected.

func Load

func Load(filePath string) (*Manifest, string, error)

Load reads, interpolates, parses, and validates a manifest from disk. The returned path is the absolute path that was actually opened.

func Parse added in v0.0.5

func Parse(data []byte, lookupEnv func(string) (string, bool)) (*Manifest, error)

Parse interpolates ${ENV} references through lookupEnv, decodes the manifest strictly (unknown fields are errors), and validates it.

func (*Manifest) DeprecationWarnings added in v0.42.0

func (m *Manifest) DeprecationWarnings() []string

DeprecationWarnings describes each use of a deprecated field, in declaration order. public: false reads as "not public" but now admits signed-in users, which is the surprise these warnings exist for.

func (*Manifest) DurableFunctionNames added in v0.26.0

func (m *Manifest) DurableFunctionNames() []string

DurableFunctionNames returns the functions the manifest declares durable, in declaration order.

A kind cannot be changed once a function exists, so deploying one of these through the standard collection would create the wrong kind of function permanently. The deploy commands use this to keep each name with its own collection.

func (*Manifest) StandardFunctionNames added in v0.32.0

func (m *Manifest) StandardFunctionNames() []string

StandardFunctionNames returns the functions the manifest declares without a durable kind, in declaration order. The counterpart of DurableFunctionNames: a durable deploy uses it to refuse a name the manifest keeps standard. A name the manifest does not mention at all is in neither list.

func (*Manifest) Validate

func (m *Manifest) Validate() error

Validate performs the minimal local checks: the schema version, the function kind and visibility, and the removed scheduler regions field. Other semantic validation is server-side.

func (*Manifest) VisibilityLevelFields added in v0.37.0

func (m *Manifest) VisibilityLevelFields() []string

VisibilityLevelFields names the fields this manifest declares that only a server with function visibility levels accepts.

type OAuthProviderManifest added in v0.0.5

type OAuthProviderManifest struct {
	Provider     string    `yaml:"provider" json:"provider"`
	Enabled      *bool     `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	ClientID     *string   `yaml:"client_id,omitempty" json:"client_id,omitempty"`
	ClientSecret *string   `yaml:"client_secret,omitempty" json:"client_secret,omitempty"`
	RedirectURL  *string   `yaml:"redirect_url,omitempty" json:"redirect_url,omitempty"`
	Scopes       *[]string `yaml:"scopes,omitempty" json:"scopes,omitempty"`
}

OAuthProviderManifest declares one OAuth provider configuration.

type PolicyManifest

type PolicyManifest struct {
	Name       string `yaml:"name" json:"name"`
	Operation  string `yaml:"operation" json:"operation"`
	Definition string `yaml:"definition" json:"definition"`
}

PolicyManifest declares one storage policy attached to a bucket.

type ProjectManifest added in v0.0.5

type ProjectManifest struct {
	Name            *string   `yaml:"name,omitempty" json:"name,omitempty"`
	AllRegions      *bool     `yaml:"all_regions,omitempty" json:"all_regions,omitempty"`
	SelectedRegions *[]string `yaml:"selected_regions,omitempty" json:"selected_regions,omitempty"`
}

ProjectManifest declares project-level settings.

type PullResult added in v0.28.0

type PullResult struct {
	Manifest []byte

	// StrippedVariablesSection reports that the response carried a top-level
	// variables section and it was removed before the manifest was returned.
	StrippedVariablesSection bool
}

PullResult is a downloaded manifest plus whether the CLI had to remove variable values the server should not have exported.

type RealtimeManifest added in v0.0.5

type RealtimeManifest struct {
	Enabled                *bool `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	BroadcastEnabled       *bool `yaml:"broadcast_enabled,omitempty" json:"broadcast_enabled,omitempty"`
	PresenceEnabled        *bool `yaml:"presence_enabled,omitempty" json:"presence_enabled,omitempty"`
	PostgresChangesEnabled *bool `yaml:"postgres_changes_enabled,omitempty" json:"postgres_changes_enabled,omitempty"`
}

RealtimeManifest declares realtime feature flags.

type SandboxManifest added in v0.43.0

type SandboxManifest struct {
	Name               string `yaml:"name" json:"name"`
	MemoryMB           *int   `yaml:"memory_mb,omitempty" json:"memory_mb,omitempty"`
	Ports              *[]int `yaml:"ports,omitempty" json:"ports,omitempty"`
	IdleTimeoutSeconds *int   `yaml:"idle_timeout_seconds,omitempty" json:"idle_timeout_seconds,omitempty"`
	TTLSeconds         *int   `yaml:"ttl_seconds,omitempty" json:"ttl_seconds,omitempty"`
}

SandboxManifest declares image assertions and default session settings for an existing Sandbox template. Nil fields preserve existing values; explicit zero idle timeout and empty ports remain present during round trips.

type SchedulerManifest added in v0.0.4

type SchedulerManifest struct {
	Name    string          `yaml:"name" json:"name"`
	Cron    string          `yaml:"cron" json:"cron"`
	Enabled *bool           `yaml:"enabled,omitempty" json:"enabled,omitempty"`
	Payload *map[string]any `yaml:"payload,omitempty" json:"payload,omitempty"`
	Regions *[]string       `yaml:"regions,omitempty" json:"-"`
}

SchedulerManifest declares one scheduler attached to a function. Regions is parsed only to reject manifests using the removed field with a clear error.

type Service

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

Service uploads and downloads declarative project configuration. All reconciliation happens server-side.

func NewService

func NewService(deps cliruntime.Deps) Service

NewService returns a projectconfig service.

func (Service) Deploy

func (s Service) Deploy(ctx context.Context, manifest *Manifest, dryRun bool) (*apiclient.ProjectConfigApplyResult, error)

Deploy uploads the manifest to the server, which validates and reconciles the project configuration. With dryRun the server only reports projected actions.

func (Service) Pull added in v0.0.5

func (s Service) Pull(ctx context.Context) (PullResult, error)

Pull downloads the project's current configuration as the server-rendered canonical YAML manifest, with variable values removed if the server included any (see sanitizePulledManifest).

type TLSManifest added in v0.0.5

type TLSManifest struct {
	Mode                string  `yaml:"mode" json:"mode"`
	CertificatePEM      string  `yaml:"certificate_pem" json:"certificate_pem"`
	PrivateKeyPEM       string  `yaml:"private_key_pem" json:"private_key_pem"`
	CertificateChainPEM *string `yaml:"certificate_chain_pem,omitempty" json:"certificate_chain_pem,omitempty"`
}

TLSManifest declares BYOC TLS material for a custom domain.

type VariableManifest added in v0.0.5

type VariableManifest struct {
	Name  string `yaml:"name" json:"name"`
	Value string `yaml:"value" json:"value"`
}

VariableManifest declares one project variable.

Jump to

Keyboard shortcuts

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