Documentation ¶
Index ¶
- type App
- func (app App) GetDependencies() Dependencies
- func (e App) IsEquivalent(other App) (isEquivalent bool)
- func (e App) ProtoValue() (*terrariumpb.App, error)
- func (e *App) Scan(value interface{}) error
- func (e *App) ScanProto(m *terrariumpb.App)
- func (app *App) SetDefaults()
- func (e App) ToFileBytes() ([]byte, error)
- func (app *App) Validate() error
- func (e App) Value() (driver.Value, error)
- func (e App) WrapProtoMessage() (message *anypb.Any, err error)
- type Apps
- type Dependencies
- type Dependency
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { // ID is a required identifier for the app in the project, which must start with // an alphabet character, can only contain alphanumeric characters, // and must not be longer than 20 characters. ID string `yaml:"id"` // Name describes the human-friendly name for the application. Name string `yaml:"name"` // EnvPrefix is the prefix used for the environment variables in this app. // If not set, defaults to an empty string. EnvPrefix string `yaml:"env_prefix"` // Compute denotes a specific dependency that best classifies the app itself, // it can only be of the type `compute/*`. // id of this dependency is automatically set to app id. // it is used to setup deployment pipeline in Code Pipes and allow other // apps to use this app as dependency. Compute Dependency `yaml:"compute"` // Dependencies lists the required services, databases, and other components that the application relies on. Dependencies Dependencies `yaml:"dependencies"` }
App represents the main application configuration.
func (App) GetDependencies ¶
func (app App) GetDependencies() Dependencies
GetDependencies returns the dependencies for the app including it's deployment dependency.
func (App) IsEquivalent ¶
IsEquivalent returns if this and the other app generate the same infrastructure.
func (App) ProtoValue ¶
func (e App) ProtoValue() (*terrariumpb.App, error)
func (*App) ScanProto ¶
func (e *App) ScanProto(m *terrariumpb.App)
func (*App) SetDefaults ¶
func (app *App) SetDefaults()
Sets the default values for the optional fields in the App and its Dependencies.
func (App) ToFileBytes ¶
type Apps ¶
type Apps []App
App multiple apps configuration
func (Apps) GetAppByID ¶
GetAppByID returns the first app found with the given ID, or nil if no such app exists.
func (Apps) GetDependenciesByAppID ¶
func (apps Apps) GetDependenciesByAppID(appID string) Dependencies
GetDependenciesByAppID returns the dependencies for the app with the given ID, or nil if the app does not exist.
func (Apps) GetDependenciesByType ¶
func (apps Apps) GetDependenciesByType(depType string) Dependencies
GetDependenciesByType returns all dependencies of a given type across all apps.
func (Apps) GetUniqueDependencyTypes ¶
GetUniqueDependencyTypes returns a list of unique dependency types across all apps.
func (*Apps) SetDefaults ¶
func (apps *Apps) SetDefaults()
Sets the default values for the optional fields in the Apps and its Dependencies.
type Dependencies ¶
type Dependencies []Dependency
func (Dependencies) GetDependenciesToProvision ¶
func (allDeps Dependencies) GetDependenciesToProvision() Dependencies
GetDependencies returns the dependencies for the app that needs to be provisioned including it's deployment dependency.
func (Dependencies) GetInputs ¶
func (allDeps Dependencies) GetInputs() map[string]interface{}
GetInputs returns a map of all inputs keyed by dependency identifier
func (Dependencies) ProtoValue ¶
func (e Dependencies) ProtoValue() (values []*terrariumpb.AppDependency, err error)
func (*Dependencies) ScanProto ¶
func (e *Dependencies) ScanProto(m []*terrariumpb.AppDependency)
type Dependency ¶
type Dependency struct { // ID is a required identifier for the dependency in the project, which must start with // an alphabet character, can only contain alphanumeric characters, // and must not be longer than 20 characters. ID string `yaml:"id"` // Use indicates the specific dependency interface ID that is used to provision an app dependency. Use string `yaml:"use"` // EnvPrefix is used to prefix the output env vars in order to avoid collision // Defaults to dependency id upper case. EnvPrefix string `yaml:"env_prefix"` // Inputs represents customization options for the selected dependency interface. Inputs map[string]interface{} `yaml:"inputs"` // Outputs maps environment variables to dependency outputs. Keys are app env name (without prefix) and // values are Mustache templates using dependency outputs. // The default env var name format is `<app_env_prefix>_<dependency_env_prefix>_<dependency_output_name_to_upper>`. Outputs map[string]string `yaml:"outputs"` // NoProvision indicates whether the dependency is provisioned in another app. // If true, this dependency is shared and its inputs are set in another app // and its outputs are made available here. NoProvision bool `yaml:"no_provision"` }
Dependency represents a single dependency of the application, which could be a database, another service, cache, etc.
func (Dependency) IsEquivalent ¶
func (e Dependency) IsEquivalent(other Dependency) bool
IsEquivalent returns if this and the other dependency generate the same infrastructure.
func (Dependency) ProtoValue ¶
func (e Dependency) ProtoValue() (*terrariumpb.AppDependency, error)
func (*Dependency) ScanProto ¶
func (e *Dependency) ScanProto(m *terrariumpb.AppDependency)
func (*Dependency) SetDefaults ¶
func (dep *Dependency) SetDefaults()
func (*Dependency) Validate ¶
func (dep *Dependency) Validate() error
Validate if the dependency ID is set