config

package
v0.6.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	AppName  string `json:"app" yaml:"app" toml:"app"`
	Provider string `json:"provider" yaml:"provider" toml:"provider"`

	// Format is what format the file was originally in so that when we output
	// to compiled, it keeps the same format.
	Format string `json:"-" yaml:"-" toml:"-"`

	Path   string `json:"path" yaml:"path" toml:"path"`
	OutDir string `json:"out_dir" yaml:"out_dir" toml:"out_dir"`

	Defaults       Defaults                  `json:"defaults" yaml:"defaults" toml:"defaults"`
	ExecutionUnits map[string]*ExecutionUnit `json:"execution_units,omitempty" yaml:"execution_units,omitempty" toml:"execution_units,omitempty"`
	StaticUnit     map[string]*StaticUnit    `json:"static_unit,omitempty" yaml:"static_unit,omitempty" toml:"static_unit,omitempty"`
	Exposed        map[string]*Expose        `json:"exposed,omitempty" yaml:"exposed,omitempty" toml:"exposed,omitempty"`
	Persisted      map[string]*Persist       `json:"persisted,omitempty" yaml:"persisted,omitempty" toml:"persisted,omitempty"`
	PubSub         map[string]*PubSub        `json:"pubsub,omitempty" yaml:"pubsub,omitempty" toml:"pubsub,omitempty"`
	Config         map[string]*Config        `json:"config,omitempty" yaml:"config,omitempty" toml:"config,omitempty"`
}

func ReadConfig

func ReadConfig(fpath string) (Application, error)

func (*Application) EnsureMapsExist added in v0.6.3

func (appCfg *Application) EnsureMapsExist()

func (Application) GetConfig added in v0.6.3

func (a Application) GetConfig(id string) Config

GetConfig returns the `Config` configuration for the resource specified by `id`

func (Application) GetExecutionUnit

func (a Application) GetExecutionUnit(id string) ExecutionUnit

GetExecutionUnit returns the `ExecutionUnit` config for the resource specified by `id` merged with the defaults.

func (Application) GetExposed

func (a Application) GetExposed(id string) Expose

GetExposed returns the `Expose` config for the resource specified by `id` merged with the defaults.

func (Application) GetPersisted

func (a Application) GetPersisted(id string, kind core.PersistKind) Persist

GetPersisted returns the `Persist` config for the resource specified by `id` merged with the defaults for `kind`.

func (Application) GetPubSub

func (a Application) GetPubSub(id string) PubSub

GetPubSub returns the `PubSub` config for the resource specified by `id`

func (Application) GetResourceType

func (a Application) GetResourceType(resource core.CloudResource) string

func (Application) GetStaticUnit

func (a Application) GetStaticUnit(id string) StaticUnit

GetStaticUnit returns the `StaticUnit` config for the resource specified by `id`

func (*Application) UpdateForResources

func (a *Application) UpdateForResources(res []core.CloudResource)

UpdateForResources mutates the Application config for all the resources, applying the defaults.

type Config added in v0.6.3

type Config struct {
	Type        string      `json:"type" yaml:"type" toml:"type"`
	InfraParams InfraParams `json:"pulumi_params,omitempty" yaml:"pulumi_params,omitempty" toml:"pulumi_params,omitempty"`
}

func (*Config) Merge added in v0.6.3

func (cfg *Config) Merge(other Config)

type ContentDeliveryNetwork

type ContentDeliveryNetwork struct {
	Id string `json:"id,omitempty" yaml:"id,omitempty" toml:"id,omitempty"`
}

func (*ContentDeliveryNetwork) Merge added in v0.6.3

type Defaults

type Defaults struct {
	ExecutionUnit KindDefaults        `json:"execution_unit" yaml:"execution_unit" toml:"execution_unit"`
	StaticUnit    KindDefaults        `json:"static_unit" yaml:"static_unit" toml:"static_unit"`
	Expose        ExposeDefaults      `json:"expose" yaml:"expose" toml:"expose"`
	Persist       PersistKindDefaults `json:"persist" yaml:"persist" toml:"persist"`
	PubSub        KindDefaults        `json:"pubsub" yaml:"pubsub" toml:"pubsub"`
	Config        KindDefaults        `json:"config" yaml:"config" toml:"config"`
}

func (*Defaults) Merge

func (cfg *Defaults) Merge(other Defaults)

type ExecutionUnit

type ExecutionUnit struct {
	Type                 string            `json:"type" yaml:"type" toml:"type"`
	NetworkPlacement     string            `json:"network_placement,omitempty" yaml:"network_placement,omitempty" toml:"network_placement,omitempty"`
	EnvironmentVariables map[string]string `json:"environment_variables,omitempty" yaml:"environment_variables,omitempty" toml:"environment_variables,omitempty"`
	HelmChartOptions     *HelmChartOptions `json:"helm_chart_options,omitempty" yaml:"helm_chart_options,omitempty" toml:"helm_chart_options,omitempty"`
	InfraParams          InfraParams       `json:"pulumi_params,omitempty" yaml:"pulumi_params,omitempty" toml:"pulumi_params,omitempty"`
}

func (*ExecutionUnit) Merge

func (cfg *ExecutionUnit) Merge(other ExecutionUnit)

type Expose

type Expose struct {
	Type                   string                 `json:"type" yaml:"type" toml:"type"`
	ApiType                string                 `json:"api_type" yaml:"api_type" toml:"api_type"`
	ContentDeliveryNetwork ContentDeliveryNetwork `json:"content_delivery_network,omitempty" yaml:"content_delivery_network,omitempty" toml:"content_delivery_network,omitempty"`
	InfraParams            InfraParams            `json:"pulumi_params,omitempty" yaml:"pulumi_params,omitempty" toml:"pulumi_params,omitempty"`
}

func (*Expose) Merge

func (cfg *Expose) Merge(other Expose)

type ExposeDefaults added in v0.6.3

type ExposeDefaults struct {
	KindDefaults
	ApiType                string                 `json:"api_type" yaml:"api_type" toml:"api_type"`
	ContentDeliveryNetwork ContentDeliveryNetwork `json:"content_delivery_network,omitempty" yaml:"content_delivery_network,omitempty" toml:"content_delivery_network,omitempty"`
}

func (*ExposeDefaults) Merge added in v0.6.3

func (cfg *ExposeDefaults) Merge(other ExposeDefaults)

type HelmChartOptions

type HelmChartOptions struct {
	Directory   string   `json:"directory,omitempty" yaml:"directory,omitempty" toml:"directory,omitempty"` // Directory signals the directory which will contain the helm chart outputs
	Install     bool     `json:"install,omitempty" yaml:"install,omitempty" toml:"install,omitempty"`
	ValuesFiles []string `json:"values_files,omitempty" yaml:"values_files,omitempty" toml:"values_files,omitempty"`
}

A HelmChartOptions represents configuration for execution units attempting to generate helm charts

type InfraParams

type InfraParams map[string]interface{}

InfraParams are passed as-is to the generated IaC

func (*InfraParams) Merge

func (cfg *InfraParams) Merge(other InfraParams)

type KindDefaults

type KindDefaults struct {
	Type              string                 `json:"type" yaml:"type" toml:"type"`
	InfraParamsByType map[string]InfraParams `json:"pulumi_params_by_type,omitempty" yaml:"pulumi_params_by_type,omitempty" toml:"pulumi_params_by_type,omitempty"`
}

func (*KindDefaults) Merge

func (cfg *KindDefaults) Merge(other KindDefaults)

type Persist

type Persist struct {
	Type        string      `json:"type" yaml:"type" toml:"type"`
	InfraParams InfraParams `json:"pulumi_params,omitempty" yaml:"pulumi_params,omitempty" toml:"pulumi_params,omitempty"`
}

func (*Persist) GetPersistDefaults

func (cfg *Persist) GetPersistDefaults(other PersistKindDefaults, persistType core.PersistKind) Persist

func (*Persist) Merge

func (cfg *Persist) Merge(other Persist)

type PersistKindDefaults

type PersistKindDefaults struct {
	KV           KindDefaults `json:"kv" yaml:"kv" toml:"kv"`
	FS           KindDefaults `json:"fs" yaml:"fs" toml:"fs"`
	Secret       KindDefaults `json:"secret" yaml:"secret" toml:"secret"`
	ORM          KindDefaults `json:"orm" yaml:"orm" toml:"orm"`
	RedisNode    KindDefaults `json:"redis_node" yaml:"redis_node" toml:"redis_node"`
	RedisCluster KindDefaults `json:"redis_cluster" yaml:"redis_cluster" toml:"redis_cluster"`
}

func (*PersistKindDefaults) Merge

func (cfg *PersistKindDefaults) Merge(other PersistKindDefaults)

type PubSub

type PubSub struct {
	Type        string      `json:"type" yaml:"type" toml:"type"`
	InfraParams InfraParams `json:"pulumi_params,omitempty" yaml:"pulumi_params,omitempty" toml:"pulumi_params,omitempty"`
}

func (*PubSub) Merge

func (cfg *PubSub) Merge(other PubSub)

type StaticUnit

type StaticUnit struct {
	Type                   string                 `json:"type" yaml:"type" toml:"type"`
	InfraParams            InfraParams            `json:"pulumi_params,omitempty" yaml:"pulumi_params,omitempty" toml:"pulumi_params,omitempty"`
	ContentDeliveryNetwork ContentDeliveryNetwork `json:"content_delivery_network,omitempty" yaml:"content_delivery_network,omitempty" toml:"content_delivery_network,omitempty"`
}

func (*StaticUnit) Merge

func (cfg *StaticUnit) Merge(other StaticUnit)

Jump to

Keyboard shortcuts

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