v0.2.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Jan 6, 2016 License: MPL-2.0 Imports: 8 Imported by: 10




This section is empty.


This section is empty.


This section is empty.


type Loader

type Loader struct {
	// Detector is the detector configuration. If this is nil then
	// no type detection will be done.
	Detector *detect.Config

	// Compiler is the appfile compiler that we're using. This is used
	// to do a minimal compile (MinCompile) to realize imports of
	// Appfiles prior to implicit loading.
	Compiler *appfile.Compiler

	// Apps will be used to load the proper app implementation for
	// implicit loading.
	Apps map[app.Tuple]app.Factory

Loader is used to load an Appfile.

This logic used to live in the "compile" command directly but was extracted so it could be tested in isolation better and in case there is any interest in reusability.

The purpose of the loader is to do the multi-step Appfile load outlined below. As input, we have the "real" Appfile, which is the real physical Appfile if it exists (or nil if it doesn't).

1.) Detect the type, known as the "detected" Appfile

2.) Merge with the detected Appfile with the real Appfile. If
    the "detect" setting is set to "false", then we're done. Otherwise,

3.) Instantiate the proper plugin for the app type and call the Implicit
    API to get an Appfile known as the "implicit" Appfile.

4.) Merge in the order: detected, implicit, real. Return the real

func (*Loader) Load

func (l *Loader) Load(f *appfile.File, dir string) (*appfile.File, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL