detect

package
v0.0.0-...-b817d9f Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2015 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func App

func App(dir string, c *Config) (string, error)

App will detect the application type for the given directory.

Types

type Config

type Config struct {
	Detectors []*Detector
}

Config is the format of the configuration files

func Parse

func Parse(r io.Reader) (*Config, error)

Parse parses the detector config from the given io.Reader.

Due to current internal limitations, the entire contents of the io.Reader will be copied into memory first before parsing.

func ParseDir

func ParseDir(path string) (*Config, error)

ParseDir parses all the files ending in ".hcl" in a directory, sorted alphabetically.

func ParseFile

func ParseFile(path string) (*Config, error)

ParseFile parses the given path as a single detector config.

func (*Config) Merge

func (c *Config) Merge(c2 *Config) error

Merge merges another config into this one. This will modify this Config object. Detectors in c2 are tried after detectors in this Config. Conflicts are ignored as lower priority detectors, meaning that if two detectors are for type "go", both will be tried.

type Detector

type Detector struct {
	Type string
	File []string
}

Detector is something that detects a single type.

func (*Detector) Detect

func (d *Detector) Detect(dir string) (bool, error)

Detect will return true if this detector matches within the given directory.

func (*Detector) GoString

func (d *Detector) GoString() string

Directories

Path Synopsis
test-fixtures

Jump to

Keyboard shortcuts

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