projectconfig

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: Apache-2.0 Imports: 12 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
)

Variables

This section is empty.

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 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.

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"`
}

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 {
	Name         string                `yaml:"name" json:"name"`
	CustomDomain *CustomDomainManifest `yaml:"custom_domain,omitempty" json:"custom_domain,omitempty"`
}

FrontendManifest declares configuration for one deployed frontend.

type FunctionManifest

type FunctionManifest struct {
	Name       string               `yaml:"name" json:"name"`
	Public     *bool                `yaml:"public,omitempty" json:"public,omitempty"`
	Schedulers *[]SchedulerManifest `yaml:"schedulers,omitempty" json:"schedulers,omitempty"`
}

FunctionManifest declares configuration for one deployed 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"`
	// 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) Validate

func (m *Manifest) Validate() error

Validate performs the minimal local checks: the schema version and the removed scheduler regions field. All semantic validation is server-side.

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 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 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) ([]byte, error)

Pull downloads the project's current configuration as the server-rendered canonical YAML manifest.

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