Documentation
¶
Index ¶
- Constants
- Variables
- func ResolveStack(ctx context.Context, stack *openapi.Stack, resolver Resolver) error
- func Validate(sf *Stackfile) error
- type AddonConnectionConfig
- type BuildConfig
- type PortDef
- type PostgresAddonConfig
- type Resolver
- type Resource
- type SecretMapping
- type Stackfile
- type VolumeDef
- type VolumeMountDef
Constants ¶
View Source
const MaxStackfileSize = 1 << 20 // 1MB
View Source
const (
PostgresAddonType = "postgres"
)
Variables ¶
View Source
var SchemaJSON []byte
SchemaJSON is the JSON Schema (draft-07) for stackfile documents.
Functions ¶
func ResolveStack ¶
Types ¶
type AddonConnectionConfig ¶
type AddonConnectionConfig struct {
Type string `yaml:"type"`
// Env vars templated from the addon's outputs. Output names are bare —
// no addon prefix (the block already names the addon):
// env:
// POSTGRES_HOST: "{{ host }}"
// POSTGRES_URI: "postgres://{{ username }}:{{ password }}@{{ host }}:{{ port }}/{{ database }}"
Env map[string]string `yaml:"env"`
Postgres *PostgresAddonConfig `yaml:"-"`
// contains filtered or unexported fields
}
func (*AddonConnectionConfig) UnmarshalYAML ¶
func (a *AddonConnectionConfig) UnmarshalYAML(node *yaml.Node) error
type BuildConfig ¶
type BuildConfig struct {
Repo string `yaml:"repo,omitempty"`
Branch string `yaml:"branch,omitempty"`
Tag string `yaml:"tag,omitempty"`
Commit string `yaml:"commit,omitempty"`
Dockerfile string `yaml:"dockerfile,omitempty"`
Context string `yaml:"context,omitempty"`
GitSecret string `yaml:"git_secret,omitempty"`
}
type PostgresAddonConfig ¶
type Resource ¶
type Resource struct {
Image string `yaml:"image,omitempty"`
Build *BuildConfig `yaml:"build,omitempty"`
Command []string `yaml:"command,omitempty"`
Args []string `yaml:"args,omitempty"`
Ports []PortDef `yaml:"ports,omitempty"`
Env map[string]string `yaml:"env,omitempty"`
// Secret Name -> Mapping of secret keys to env var names
Secrets map[string]SecretMapping `yaml:"secrets,omitempty"`
// Addon Name -> Connection Config
Addons map[string]AddonConnectionConfig `yaml:"addons,omitempty"`
Volumes []VolumeMountDef `yaml:"volumes,omitempty"`
DependsOn []string `yaml:"depends_on,omitempty"`
WorkloadType string `yaml:"workload_type,omitempty"`
Schedule string `yaml:"schedule,omitempty"`
Replicas *int32 `yaml:"replicas,omitempty"`
}
type SecretMapping ¶
SecretMapping maps secret keys to env var names. Key = env var name, Value = secret key
type Stackfile ¶
type Stackfile struct {
Name string `yaml:"name"`
Resources map[string]Resource `yaml:"resources"`
Volumes map[string]VolumeDef `yaml:"volumes,omitempty"`
}
func FromStack ¶
FromStack converts an API Stack document back into a Stackfile.
It covers exactly the subset a stackfile can express. Constructs outside that subset (init containers, file targets, build-artifact connections, volume sources, registry credentials, ...) fail with an error naming the construct — never silently dropped. Connections must carry name-based node refs; id-only refs (a stack fetched after secret/addon resolution) need the names restored first.
type VolumeMountDef ¶
Click to show internal directories.
Click to hide internal directories.