b408c3ce2a
In some cases, we want to specialize template generation based on the options passed to the compiler. This change flows them through so that they can be accessed as {{if .Options.SomeSetting}} ... {{end}}
25 lines
805 B
Go
25 lines
805 B
Go
// Copyright 2016 Marapongo, Inc. All rights reserved.
|
|
|
|
package compiler
|
|
|
|
import (
|
|
"github.com/marapongo/mu/pkg/compiler/backends"
|
|
"github.com/marapongo/mu/pkg/diag"
|
|
)
|
|
|
|
// Options contains all of the settings a user can use to control the compiler's behavior.
|
|
type Options struct {
|
|
Diag diag.Sink // a sink to use for all diagnostics.
|
|
SkipCodegen bool // if true, no code-generation phases run.
|
|
Arch backends.Arch // a target cloud architecture.
|
|
Cluster string // a named cluster with predefined settings to target.
|
|
Args map[string]string // optional arguments passed at the CLI.
|
|
}
|
|
|
|
// DefaultOpts returns the default set of compiler options.
|
|
func DefaultOpts(pwd string) *Options {
|
|
return &Options{
|
|
Diag: diag.DefaultSink(pwd),
|
|
}
|
|
}
|