samurai

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2017 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSkipDir = errors.New("Directory does not match build type, skip")
)

errors.

Functions

This section is empty.

Types

type BuildFunctions

type BuildFunctions struct {
	Dir  string
	Main BuildList
	Subs map[string]BuildList
}

BuildFunctions holds all build directives from processed packages.

func BuildPackage

func BuildPackage(vlog metrics.Metrics, events metrics.Metrics, dir string, cmdDir string, cuDir string, binaryPath string, skipBuild bool, removeFiles bool, dontCombineRoot bool, dontBuildSub bool, ctx build.Context) (BuildFunctions, error)

BuildPackage builds a shogun binarie commandline files for giving directory and 1 level directory.

type BuildList

type BuildList struct {
	Hash            string
	Path            string
	RelPath         string
	FromPackage     string
	FromPackageName string
	PkgPath         string
	BasePkgPath     string
	BinaryName      string
	CleanBinaryName string
	Desc            string
	ExecBinaryName  string
	List            []gen.WriteDirective
	Functions       []internals.PackageFunctions
}

BuildList holds a procssed package list of write directives.

func BuildPackageForDir

func BuildPackageForDir(vlog metrics.Metrics, events metrics.Metrics, dir string, cmd string, currentDir string, binaryPath string, skipBuild bool, remove bool, subs map[string]BuildList, ctx build.Context) (BuildList, error)

BuildPackageForDir generates needed package files for creating new function based executable binaries.

func (BuildList) Default

func (pn BuildList) Default() []internals.Function

Default returns the associated function set as default.

func (BuildList) HasFauxImports

func (pn BuildList) HasFauxImports() bool

HasFauxImports returns true/false if any part of the function uses faux context.

func (BuildList) HasGoogleImports

func (pn BuildList) HasGoogleImports() bool

HasGoogleImports returns true/false if any part of the function uses faux context.

type FunctionList

type FunctionList struct {
	Dir  string
	Main PackageFunctionList
	Subs map[string]PackageFunctionList
}

FunctionList holds a list of functions from a main package and all other subpackages retrieved.

func ListFunctions

func ListFunctions(vlog, events metrics.Metrics, targetDir string, ctx build.Context) (FunctionList, error)

ListFunctions returns all functions retrieved from the directory filtered by the build.Context.

type HashList

type HashList struct {
	Path     string            `json:"path"`
	RelPath  string            `json:"relpath,omitempty"`
	Hash     string            `json:"hash"`
	Package  string            `json:"package"`
	Packages map[string]string `json:"packages"`
}

HashList holds the list of processed functions from individual packages.

func HashPackages

func HashPackages(vlog, events metrics.Metrics, dir string, ctx build.Context) (HashList, error)

HashPackages iterates all directories and generates package hashes of all declared functions matching the shegun format.

type PackageFunctionList

type PackageFunctionList struct {
	Path    string
	RelPath string
	Hash    string
	Package string
	Name    string
	Desc    string
	List    []internals.PackageFunctions
}

PackageFunctionList holds the list of processed functions from individual packages.

func ListFunctionsForDir

func ListFunctionsForDir(vlog, events metrics.Metrics, dir string, ctx build.Context) (PackageFunctionList, error)

ListFunctionsForDir iterates all directories and retrieves functon list of all declared functions matching the shegun format.

type PackageHashList

type PackageHashList struct {
	Dir       string              `json:"dir"`
	SuperHash string              `json:"super_hash"`
	Main      HashList            `json:"main"`
	Subs      map[string]HashList `json:"subs"`
}

PackageHashList holds a list of hashes from a main package and all other subpackages retrieved.

func ListPackageHash

func ListPackageHash(vlog, events metrics.Metrics, targetDir string, ctx build.Context) (PackageHashList, error)

ListPackageHash returns all functions retrieved from the directory filtered by the build.Context.

Jump to

Keyboard shortcuts

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