github.com/leowmjw/otto@v0.2.1-0.20160126165905-6400716cf085/builtin/app/scriptpack/meta.go (about)

     1  package scriptpackapp
     2  
     3  import (
     4  	"github.com/hashicorp/otto/app"
     5  	"github.com/hashicorp/otto/appfile/detect"
     6  )
     7  
     8  // Meta is the metadata for this app type
     9  var Meta = &app.Meta{
    10  	Tuples:    Tuples,
    11  	Detectors: Detectors,
    12  }
    13  
    14  // Tuples is the list of tuples that this built-in app implementation knows
    15  // that it can support.
    16  var Tuples = app.TupleSlice([]app.Tuple{
    17  	{"scriptpack", "*", "*"},
    18  })
    19  
    20  // Detectors is the list of detectors that trigger this app to be used.
    21  var Detectors = []*detect.Detector{
    22  	&detect.Detector{
    23  		Type: "scriptpack",
    24  		Contents: map[string]string{
    25  			"main.go": `^var ScriptPack =`,
    26  		},
    27  
    28  		// High priority for ScriptPacks since it is a very specific
    29  		// dev environment type.
    30  		Priority: 10,
    31  	},
    32  }
    33  
    34  // AppFactory is the factory for this app
    35  func AppFactory() app.App {
    36  	return &App{}
    37  }