pulumi/pkg/compiler/opts.go
joeduffy 2a2c93f8ab Add a Backend interface, and dispatch to it
This change adds a Backend Phase to the compiler, implemented by each of the
cloud/scheduler implementations.  It also reorganizes some of the modules to
ensure we can do everything we need without cycles, including introducing the
mu/pkg/compiler/backends package, under which the clouds/ and schedulers/
sub-packages now reside.  The backends.New(Arch) factory function acts as the
entrypoint into the entire thing so callers can easily create new Backend instances.
2016-11-18 12:40:15 -08:00

24 lines
707 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.
Target string // a named target to generate outputs against.
}
// DefaultOpts returns the default set of compiler options.
func DefaultOpts(pwd string) Options {
return Options{
Diag: diag.DefaultSink(pwd),
}
}