Documentation ¶
Index ¶
- func GenerateSchema(ctx context.Context, filename string, pr *plugins.PluginRepository) (string, error)
- func LoadRefData(_ context.Context, node *yaml.Node, cwd string) (*yaml.Node, string, error)
- type ComponentConfig
- type ConfigOptions
- type Deployment
- type DeploymentType
- type FileSource
- type GlobalConfig
- type MachComposer
- type MachComposerCloud
- type MachConfig
- type MachPluginConfig
- type NotFoundError
- type SiteComponentConfig
- type SiteComponentConfigs
- type SiteConfig
- type SiteConfigs
- type Source
- type SourceType
- type SyntaxError
- type TerraformConfig
- type ValidationError
- type Value
- type Variables
- func (v *Variables) GetEncryptedSources(site string) []FileSource
- func (v *Variables) HasEncrypted(site string) bool
- func (v *Variables) InterpolateNode(node *yaml.Node) error
- func (v *Variables) InterpolateSiteNode(site string, node *yaml.Node) error
- func (v *Variables) Load(_ context.Context, filename, cwd string) error
- func (v *Variables) Set(key string, value string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSchema ¶
Types ¶
type ComponentConfig ¶
type ConfigOptions ¶
type ConfigOptions struct { VarFilenames []string Plugins *plugins.PluginRepository Validate bool NoResolveVars bool }
type Deployment ¶
type Deployment struct {
Type DeploymentType `yaml:"type" default:"site"`
}
type DeploymentType ¶
type DeploymentType string
const ( DeploymentSite DeploymentType = "site" DeploymentSiteComponent DeploymentType = "site-component" )
type FileSource ¶
type GlobalConfig ¶
type GlobalConfig struct { Environment string `yaml:"environment"` Cloud string `yaml:"cloud"` TerraformStateProvider string `yaml:"-"` TerraformConfig *TerraformConfig `yaml:"terraform_config"` }
type MachComposer ¶
type MachComposer struct { Version any `yaml:"version"` VariablesFile string `yaml:"variables_file"` Plugins map[string]MachPluginConfig `yaml:"plugins"` Cloud MachComposerCloud `yaml:"cloud"` Deployment Deployment `yaml:"deployment"` }
func (*MachComposer) CloudEnabled ¶
func (mc *MachComposer) CloudEnabled() bool
type MachComposerCloud ¶
type MachComposerCloud struct { Organization string `yaml:"organization"` Project string `yaml:"project"` Client *mccsdk.APIClient }
func (*MachComposerCloud) Empty ¶
func (mcc *MachComposerCloud) Empty() bool
type MachConfig ¶
type MachConfig struct { Filename string `yaml:"-"` MachComposer MachComposer `yaml:"mach_composer"` Global GlobalConfig `yaml:"global"` Sites SiteConfigs `yaml:"sites"` Components []ComponentConfig `yaml:"components"` StateRepository *state.Repository Plugins *plugins.PluginRepository `yaml:"-"` Variables *Variables `yaml:"-"` IsEncrypted bool `yaml:"-"` // contains filtered or unexported fields }
func Open ¶
func Open(ctx context.Context, filename string, opts *ConfigOptions) (*MachConfig, error)
Open is the main entrypoint for this module. It opens the given yaml filename and reads it to construct the MachConfig. Note that you need to close the MachConfig via the Close() method in order to clean up.
func (*MachConfig) Close ¶
func (c *MachConfig) Close()
func (*MachConfig) HasSite ¶
func (c *MachConfig) HasSite(ident string) bool
type MachPluginConfig ¶
type NotFoundError ¶
type NotFoundError struct { Name string Node *yaml.Node }
func (*NotFoundError) Error ¶
func (e *NotFoundError) Error() string
type SiteComponentConfig ¶
type SiteComponentConfig struct { Name string `yaml:"name"` Definition *ComponentConfig `yaml:"-"` Variables variable.VariablesMap `yaml:"variables"` Secrets variable.VariablesMap `yaml:"secrets"` Deployment *Deployment `yaml:"deployment"` DependsOn []string `yaml:"depends_on"` }
func (*SiteComponentConfig) HasCloudIntegration ¶
func (sc *SiteComponentConfig) HasCloudIntegration(g *GlobalConfig) bool
type SiteComponentConfigs ¶
type SiteComponentConfigs []SiteComponentConfig
func (*SiteComponentConfigs) Get ¶
func (s *SiteComponentConfigs) Get(name string) (*SiteComponentConfig, error)
type SiteConfig ¶
type SiteConfig struct { Name string `yaml:"name"` Identifier string `yaml:"identifier"` Deployment *Deployment `yaml:"deployment"` RawEndpoints map[string]any `yaml:"endpoints"` Components SiteComponentConfigs `yaml:"components"` }
SiteConfig contains all configuration needed for a site.
type SiteConfigs ¶
type SiteConfigs []SiteConfig
func (*SiteConfigs) Get ¶
func (s *SiteConfigs) Get(identifier string) (*SiteConfig, error)
type Source ¶
type Source string
func (*Source) IsType ¶
func (s *Source) IsType(t SourceType) bool
func (*Source) Type ¶
func (s *Source) Type() (SourceType, error)
type SourceType ¶
type SourceType string
const ( SourceTypeLocal SourceType = "local" SourceTypeGit SourceType = "git" SourceTypeGithub SourceType = "github" SourceTypeBitbucket SourceType = "bitbucket" SourceTypeMercurial SourceType = "mercurial" SourceTypeHttp SourceType = "http" SourceTypeS3 SourceType = "s3" SourceTypeGCS SourceType = "gcs" )
type SyntaxError ¶
type SyntaxError struct {
// contains filtered or unexported fields
}
func (*SyntaxError) Error ¶
func (e *SyntaxError) Error() string
type TerraformConfig ¶
type ValidationError ¶
type ValidationError struct {
// contains filtered or unexported fields
}
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
type Variables ¶
type Variables struct {
// contains filtered or unexported fields
}
func NewVariables ¶
func NewVariables() *Variables
func (*Variables) GetEncryptedSources ¶
func (v *Variables) GetEncryptedSources(site string) []FileSource
func (*Variables) HasEncrypted ¶
func (*Variables) InterpolateNode ¶
func (*Variables) InterpolateSiteNode ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.