config

package
v0.0.0-...-8e53b5f Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrInvalidSourceFile is thrown when the source file cannot be resolved
	ErrInvalidSourceFile = errors.New("source file must be specified")

	// ErrNoDefinitionsInSourceFile is thrown when the source directory does not contain any valid
	// ECS definitions.
	ErrNoDefinitionsInSourceFile = errors.New("source directory does not contain any valid ecs definitions")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	SourceFile string
	// contains filtered or unexported fields
}

Config holds the parameters needed for proper generation of Go code.

func NewEmptyConfig

func NewEmptyConfig() (*Config, error)

NewEmptyConfig is a constructor for an empty Config object.

func (*Config) Blacklist

func (c *Config) Blacklist() (FilterList, error)

Blacklist is used to generate a FilterList of ECS keys that should not be allowed inside the model and is populated from a given Config object.

func (*Config) CLIFlags

func (c *Config) CLIFlags() []cli.Flag

CLIFlags is a helper to automatically set fields within a Config object based on CLI flags using the github.com/urfave/cli framework.

func (*Config) Generators

func (c *Config) Generators() ([]generator.Generator, error)

Generators returns the set of enabled generators for the config.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates that the configuration has expected parameters.

func (*Config) Whitelist

func (c *Config) Whitelist() (FilterList, error)

Whitelist is used to generate a Whitelist from a given Config object.

type FilterList

type FilterList []*regexp.Regexp

FilterList is a type alias that is used to evaluate possible

func (FilterList) Empty

func (w FilterList) Empty() bool

Empty is a convienience function that is used to check if a FilterList is populated.

func (FilterList) Match

func (w FilterList) Match(val string) bool

Match is used to check an arbitrary string against a filter list.

Jump to

Keyboard shortcuts

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