configuration

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlatformWindows = "windows"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfiguration

type BuildConfiguration struct {
	Name             string `toml:"build_name"`
	RelDir           string `toml:"relative_build_dir"`
	RelSrcDir        string `toml:"relative_source_dir"`
	ExecutionCommand string `toml:"execution_command"`
	Command          string `toml:"build_command"`
	EventBufferTime  int
	KillDelay        int
	Port             int `toml:"port"`
}

type ColorConfiguration

type ColorConfiguration struct {
	Main      string `toml:"main"`
	Detection string `toml:"detection"`
	Build     string `toml:"build"`
	Run       string `toml:"run"`
	Sync      string `toml:"sync"`
	App       string `toml:"app"`
}

type Configuration

type Configuration struct {
	Root   string
	Reload bool
	Sync   bool
	Build  *BuildConfiguration  `toml:"build"`
	Log    *LogConfiguration    `toml:"log"`
	Color  *ColorConfiguration  `toml:"color"`
	Filter *FilterConfiguration `toml:"filter"`
}

Configuration is a in-memory representation of the expected configuration file

func DefaultConfiguration

func DefaultConfiguration() *Configuration

DefaultConfiguration is the default configuration if none is provided

func ParsedConfiguration

func ParsedConfiguration(path string) (*Configuration, error)

ParsedConfiguration is a parsed configuration merged with the default configuration and adapted to the OS

func TestConfiguration

func TestConfiguration() (*Configuration, error)

TestConfiguration is the configuration used for internal tests

func (*Configuration) Binary

func (c *Configuration) Binary() (string, error)

Binary is the current absolute binary path

func (*Configuration) BufferTime

func (c *Configuration) BufferTime() time.Duration

BufferTime is the event buffer time in milliseconds

func (*Configuration) BuildDir

func (c *Configuration) BuildDir() (string, error)

BuildDir is the current absolute build directory path

func (*Configuration) BuildLog

func (c *Configuration) BuildLog() (string, error)

Log is the current absolute log path

func (*Configuration) BuildLogDir

func (c *Configuration) BuildLogDir() (string, error)

BuildLogDir is the current absolute log directory path

func (*Configuration) Colors

func (c *Configuration) Colors() map[string]*color.Color

func (*Configuration) SrcDir

func (c *Configuration) SrcDir() (string, error)

SrcDir is the current absolute source directory path

type FilterConfiguration

type FilterConfiguration struct {
	IncludeExts  []string `toml:"include_exts"`
	ExcludeDirs  []string `toml:"exclude_relative_dirs"`
	IncludeDirs  []string `toml:"include_relative_dirs"`
	ExcludeFiles []string `toml:"exclude_relative_files"`
}

type LogConfiguration

type LogConfiguration struct {
	BuildLog       string `toml:"build_log_name"`
	RelBuildLogDir string `toml:"relative_build_log_dir"`
	Time           bool   `toml:"time"`
	Main           bool   `toml:"main"`
	Detection      bool   `toml:"detection"`
	Build          bool   `toml:"build"`
	Run            bool   `toml:"run"`
	Sync           bool   `toml:"sync"`
	App            bool   `toml:"app"`
}

Jump to

Keyboard shortcuts

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