Documentation ¶
Index ¶
- Constants
- Variables
- func Analyze(ctx context.Context, ana Analyzer) hcl.Diagnostics
- func AnalyzeString(ctx *AnalysisContext, x hcl.Expression) (s string, ok bool)
- func IsValidName(name string) bool
- func MangleName(name string) string
- func NewRenameWarning(originalName, newName string, subject *hcl.Range) *hcl.Diagnostic
- func NewUnsupportedFeatureWarning(featureName, explanation string, subject *hcl.Range) *hcl.Diagnostic
- func RewriteComponent(re Rewrite, c *Component) *hclgen.Block
- func RewriteComponents(re Rewrite, cs *ComponentSet) *hclgen.Block
- func RewriteEnvironment(re Rewrite, env *Environment) *hclgen.Block
- func RewriteManifest(re Rewrite, m *Manifest) *hclgen.File
- func RewriteSecrets(re Rewrite, s *Secrets) *hclgen.Block
- func Validate(ctx *AnalysisContext, m *Manifest)
- func ValidateName(name string) error
- type AnalysisContext
- type Analyzer
- type AppendSecrets
- type Builder
- type Component
- type ComponentSet
- type Environment
- type Expand
- type FormatVersion
- type Importer
- type Manifest
- type Normalize
- type RemoveSecrets
- type Rewrite
- type RewriteBase
- func (_ RewriteBase) RewriteComponent(re Rewrite, c *Component) *hclgen.Block
- func (_ RewriteBase) RewriteComponents(re Rewrite, cs *ComponentSet) *hclgen.Block
- func (_ RewriteBase) RewriteEnvironment(re Rewrite, env *Environment) *hclgen.Block
- func (_ RewriteBase) RewriteManifest(re Rewrite, m *Manifest) *hclgen.File
- func (_ RewriteBase) RewriteSecrets(re Rewrite, s *Secrets) *hclgen.Block
- type Secrets
Constants ¶
View Source
const LatestMajor = 0
View Source
const LatestMinor = 1
Variables ¶
View Source
var Latest = fmt.Sprintf("%d.%d", LatestMajor, LatestMinor)
View Source
var Starter = fmt.Sprintf(`# See https://docs.deref.io/exo for details. exo = "%s" `, Latest)
Functions ¶
func AnalyzeString ¶
func AnalyzeString(ctx *AnalysisContext, x hcl.Expression) (s string, ok bool)
func IsValidName ¶
Names are restricted to be valid domain names.
func MangleName ¶
func NewRenameWarning ¶
func NewRenameWarning(originalName, newName string, subject *hcl.Range) *hcl.Diagnostic
func NewUnsupportedFeatureWarning ¶
func NewUnsupportedFeatureWarning(featureName, explanation string, subject *hcl.Range) *hcl.Diagnostic
func RewriteComponents ¶
func RewriteComponents(re Rewrite, cs *ComponentSet) *hclgen.Block
func RewriteEnvironment ¶
func RewriteEnvironment(re Rewrite, env *Environment) *hclgen.Block
func Validate ¶
func Validate(ctx *AnalysisContext, m *Manifest)
Validate deeply analyzes the manifest, collecting all diagnostics eagerly.
func ValidateName ¶
Types ¶
type AnalysisContext ¶
func (*AnalysisContext) AppendDiags ¶
func (ctx *AnalysisContext) AppendDiags(diags ...*hcl.Diagnostic)
type Analyzer ¶
type Analyzer interface {
Analyze(*AnalysisContext)
}
type AppendSecrets ¶
type AppendSecrets struct { context.Context RewriteBase Source string }
func (AppendSecrets) RewriteEnvironment ¶
func (args AppendSecrets) RewriteEnvironment(re Rewrite, env *Environment) *hclgen.Block
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
If provided, src is the original source code used to build a new Exo manifest file. The actual format of the source code doesn't matter, since diagnostics will be reported in terms of this source code when available, not the constructed manifest file.
func (*Builder) AddComponentBlock ¶
func (*Builder) EnsureComponentBlock ¶
type Component ¶
type Component struct { Source *hclsyntax.Block Expansion *hclsyntax.Block Type string Name string Spec string DependsOn []string }
func NewComponent ¶
func (*Component) Analyze ¶
func (c *Component) Analyze(ctx *AnalysisContext)
type ComponentSet ¶
type ComponentSet struct { // Analysis inputs. Blocks hcl.Blocks // Analysis outputs. Components []*Component }
func NewComponentSet ¶
func NewComponentSet(m *Manifest) *ComponentSet
func (*ComponentSet) Analyze ¶
func (cs *ComponentSet) Analyze(ctx *AnalysisContext)
type Environment ¶
type Environment struct { // Analysis inputs. Blocks hcl.Blocks // Analysis outputs. Attributes []*hclgen.Attribute Variables map[string]string Secrets []*Secrets // TODO: Should analysis be lazier here? }
func NewEnvironment ¶
func NewEnvironment(m *Manifest) *Environment
func (*Environment) Analyze ¶
func (env *Environment) Analyze(ctx *AnalysisContext)
func (*Environment) EnvironmentSource ¶
func (env *Environment) EnvironmentSource() string
func (*Environment) ExtendEnvironment ¶
func (env *Environment) ExtendEnvironment(b environment.Builder) error
type Expand ¶
type Expand struct { context.Context RewriteBase }
type FormatVersion ¶
type FormatVersion struct { // Analysis inputs. Attribute *hcl.Attribute // Analysis outputs. Major int Minor int }
func NewFormatVersion ¶
func NewFormatVersion(m *Manifest) *FormatVersion
func (*FormatVersion) Analyze ¶
func (ver *FormatVersion) Analyze(ctx *AnalysisContext)
type Importer ¶
type Importer struct {
Filename string
}
func (*Importer) Import ¶
func (imp *Importer) Import(ctx *AnalysisContext, bs []byte) *hcl.File
type Manifest ¶
type Manifest struct { // Analysis inputs. Filename string File *hcl.File // Analysis outputs. Content *hcl.BodyContent FormatVersion *FormatVersion Environment hcl.Blocks Components hcl.Blocks }
func NewManifest ¶
func (*Manifest) Analyze ¶
func (m *Manifest) Analyze(ctx *AnalysisContext)
type Normalize ¶
type Normalize struct { context.Context RewriteBase }
Normalize lifts RewriteBase to fully satisfy the Rewrite interface.
type RemoveSecrets ¶
type RemoveSecrets struct { context.Context RewriteBase Source string }
func (RemoveSecrets) RewriteSecrets ¶
func (args RemoveSecrets) RewriteSecrets(re Rewrite, s *Secrets) *hclgen.Block
type Rewrite ¶
type Rewrite interface { context.Context RewriteManifest(Rewrite, *Manifest) *hclgen.File RewriteEnvironment(Rewrite, *Environment) *hclgen.Block RewriteSecrets(Rewrite, *Secrets) *hclgen.Block RewriteComponents(Rewrite, *ComponentSet) *hclgen.Block RewriteComponent(Rewrite, *Component) *hclgen.Block }
type RewriteBase ¶
type RewriteBase struct{}
RewriteBase is intended embedded in Rewrite implementations to provide default method implementations. The default implementations rewrite structures in to normal form.
func (RewriteBase) RewriteComponent ¶
func (_ RewriteBase) RewriteComponent(re Rewrite, c *Component) *hclgen.Block
func (RewriteBase) RewriteComponents ¶
func (_ RewriteBase) RewriteComponents(re Rewrite, cs *ComponentSet) *hclgen.Block
func (RewriteBase) RewriteEnvironment ¶
func (_ RewriteBase) RewriteEnvironment(re Rewrite, env *Environment) *hclgen.Block
func (RewriteBase) RewriteManifest ¶
func (_ RewriteBase) RewriteManifest(re Rewrite, m *Manifest) *hclgen.File
func (RewriteBase) RewriteSecrets ¶
func (_ RewriteBase) RewriteSecrets(re Rewrite, s *Secrets) *hclgen.Block
Source Files ¶
Click to show internal directories.
Click to hide internal directories.