binder

package
v2.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckModFileExists added in v2.2.2

func CheckModFileExists(d string) bool

CheckModFileExists makes sure that a go.mod file exists in the supplied directory

func LocateFacilityConfig

func LocateFacilityConfig(log logging.Logger) (string, error)

LocateFacilityConfig determines where on your filesystem you have checked out Granitic. This is used when code needs access to the configuration for Granitic's built-in facility components which is stored under resource/facility-config

func SerialiseBuiltinConfig

func SerialiseBuiltinConfig(log logging.Logger) string

SerialiseBuiltinConfig takes the configuration files for Granitic's internal components (facilities) found in resource/facility-config and serialises them into a single string that will be embedded into your application's executable.

Types

type Binder

type Binder struct {
	Loader   DefinitionLoader
	ToolName string
	Log      logging.Logger
	// contains filtered or unexported fields
}

Binder translates the components defined in component definition files into Go source code.

func (*Binder) Bind

func (b *Binder) Bind(s Settings)

Bind loads component definitions files from disk/network, merges those files into a single view of components and then converts the merged view into Go source code.

func (*Binder) Failed

func (b *Binder) Failed() bool

Failed returns true if errors were encountered during the bind process

type DefinitionLoader

type DefinitionLoader interface {
	LoadAndMerge(files []string, log logging.Logger) (map[string]interface{}, error)
	WriteMerged(data map[string]interface{}, path string, log logging.Logger) error
}

A DefinitionLoader handles the loading of component definition files from a sequence of file paths and can write a merged version of those files to a location on a filesystem.

type ModFile added in v2.2.2

type ModFile struct {
}

ModFile represents a mod file on disk

func ParseModFile added in v2.2.2

func ParseModFile(d string, l logging.Logger) (*ModFile, error)

ParseModFile tries to parse the mod file in the supplied directory and returns an error if parsing failed

type Settings

type Settings struct {
	CompDefLocation *string
	BindingsFile    *string
	MergedDebugFile *string
	LogLevelLabel   *string
	LogLevel        logging.LogLevel
}

Settings contains output/input file locations and other variables for controlling the behaviour of this tool

func SettingsFromArgs

func SettingsFromArgs() (Settings, error)

SettingsFromArgs uses CLI parameters to populate a Settings object

Jump to

Keyboard shortcuts

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