Documentation
¶
Index ¶
- func SetInitialEnvVars(ctx context.Context, ec *entityserver.Client, appName string, ...) (entity.Id, error)
- type Client
- func (c *Client) Create(ctx context.Context, name string) (*core_v1alpha.App, error)
- func (c *Client) Destroy(ctx context.Context, name string) error
- func (c *Client) GetById(ctx context.Context, id entity.Id) (*core_v1alpha.App, error)
- func (c *Client) GetByName(ctx context.Context, name string) (*core_v1alpha.App, error)
- func (c *Client) List(ctx context.Context) ([]*core_v1alpha.App, error)
- func (c *Client) SetActiveVersion(ctx context.Context, appName, versionID string) error
- func (c *Client) SetHost(ctx context.Context, appName, host string) error
- type DeleteResult
- type EnvVarInput
- type MutateResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetInitialEnvVars ¶ added in v0.8.0
func SetInitialEnvVars(ctx context.Context, ec *entityserver.Client, appName string, vars []EnvVarInput, service string) (entity.Id, error)
SetInitialEnvVars stages env vars on an app's initial ConfigVersion, before any AppVersion exists. Used during `miren init` to record secrets and other config that the first deploy will pick up. The app's initial_config field is updated to point at the new ConfigVersion; no AppVersion is created and active_version is left untouched.
Subsequent calls merge with the existing initial config rather than replacing it, mirroring the SetEnvVars behaviour for active versions.
The app update uses optimistic concurrency control via Replace+revision so that two parallel SetInitialEnvVars calls (or a deploy slipping in between the read and the write) cannot silently drop staged vars.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides a domain-specific client for App entities
func (*Client) SetActiveVersion ¶
SetActiveVersion updates the active version of an app
type DeleteResult ¶ added in v0.5.0
type DeleteResult struct {
MutateResult
DeletedSources []string
}
DeleteResult extends MutateResult with source tracking.
func DeleteEnvVars ¶ added in v0.5.0
func DeleteEnvVars(ctx context.Context, ec *entityserver.Client, appName string, baseVersion *core_v1alpha.AppVersion, keys []string, service string) (*DeleteResult, error)
DeleteEnvVars resolves the config from baseVersion (or current active if nil), removes the specified keys, creates a new ConfigVersion + AppVersion, and activates it. Returns the new version plus the source of each deleted var.
type EnvVarInput ¶ added in v0.5.0
EnvVarInput represents an env var to set.
type MutateResult ¶ added in v0.5.0
type MutateResult struct {
AppVersion *core_v1alpha.AppVersion
VersionID string
}
MutateResult holds the result of an env var mutation.
func SetEnvVars ¶ added in v0.5.0
func SetEnvVars(ctx context.Context, ec *entityserver.Client, appName string, baseVersion *core_v1alpha.AppVersion, vars []EnvVarInput, service string) (*MutateResult, error)
SetEnvVars resolves the config from baseVersion (or current active if nil), merges env vars (with service scope), creates a new ConfigVersion + AppVersion, and activates it. Returns the newly created AppVersion and its version string.