Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CompileResult ¶
type CompileResult struct{}
CompileResult is the structure containing compilation result values.
type Context ¶
type Context struct { // Action is the sub-action to take when being executed. // // ActionArgs is the list of arguments for this action. // // Both of these fields will only be set for the Execute call. Action string ActionArgs []string // Dir is the directory that the compilation is allowed to write to // for persistant storage of data. For other tasks, this will be the // directory that was already populated by compilation. Dir string // The infrastructure configuration itself from the Appfile. This includes // the flavor of the infrastructure we want to launch. Infra *appfile.Infrastructure }
Context is the context for operations on infrastructures. Some of the fields in this struct are only available for certain operations.
type Factory ¶
type Factory func() (Infrastructure, error)
Factory is a factory function for creating infrastructures.
func StructFactory ¶
func StructFactory(v Infrastructure) Factory
StructFactory returns a factory function for creating a newly instantiated copy of the type of v.
type Infrastructure ¶
type Infrastructure interface { // Creds is called when Otto determines that it needs credentials // for this infrastructure provider. The Infra should query the // user (or environment) for creds and return them. Otto will // handle encrypting, storing, and retrieving the credentials. Creds(*Context) (map[string]string, error) // VerifyCreds is called with the result of either prompting or // retrieving cached credentials. This gives Infrastructure // implementations a chance to check that credentials are good before // continuing to perform any operations. VerifyCreds(*Context) error Execute(*Context) error Compile(*Context) (*CompileResult, error) Flavors() []string }
Infrastructure is an interface that must be implemented by each infrastructure type with a method of creating it.
type Mock ¶
type Mock struct { CompileCalled bool CompileContext *Context CompileResult *CompileResult CompileErr error }
Mock is a mock implementation of the Infrastructure interface.
func (*Mock) VerifyCreds ¶
Click to show internal directories.
Click to hide internal directories.