config

package
v0.0.0-...-a1e3159 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigFile = "wingman.yaml"

Variables

This section is empty.

Functions

func NewConfigFromFile

func NewConfigFromFile(filePath string) error

func Path

func Path(configFilePath string) string

Types

type Config

type Config struct {
	Version       float64                  `yaml:"version"`
	Module        string                   `yaml:"module"`
	Env           map[string]string        `yaml:"env,omitempty"`
	BuildDir      string                   `yaml:"build_dir"`
	Watchers      Watchers                 `yaml:"watchers"`
	Services      map[string]ServiceConfig `yaml:"services"`
	Proxy         Proxy                    `yaml:"proxy"`
	ServiceGroups map[string][]string      `yaml:"service_groups"`
}

func Get

func Get() *Config

func NewConfig

func NewConfig() *Config

func (*Config) Create

func (c *Config) Create() error

type Proxy

type Proxy struct {
	Enabled     bool         `yaml:"enabled"`
	Port        int          `yaml:"port"`
	Address     string       `yaml:"address"`
	APIPrefix   string       `yaml:"api_prefix"`
	LogRequests bool         `yaml:"log_requests"`
	Storage     ProxyStorage `yaml:"storage,omitempty"`
	SPA         ProxySPA     `yaml:"spa,omitempty"`
	Static      ProxyStatic  `yaml:"static,omitempty"`
}

type ProxySPA

type ProxySPA struct {
	Enabled bool   `yaml:"enabled"`
	Address string `yaml:"address"`
	Port    int    `yaml:"port"`
}

type ProxyStatic

type ProxyStatic struct {
	Enabled bool   `yaml:"enabled"`
	Dir     string `yaml:"dir"`
	Index   string `yaml:"index"`
}

type ProxyStorage

type ProxyStorage struct {
	Enabled bool   `yaml:"enabled"`
	Prefix  string `yaml:"prefix"`
	Bucket  string `yaml:"bucket"`
	Service string `yaml:"service"`
	Address string `yaml:"address"`
	Port    int    `yaml:"port"`
}

type ServiceConfig

type ServiceConfig struct {
	Entrypoint   string            `yaml:"entrypoint"`
	Executable   string            `yaml:"executable"`
	Env          map[string]string `yaml:"env"`
	ProxyHandle  string            `yaml:"proxy_handle"`
	ProxyAddress string            `yaml:"proxy_address"`
	ProxyPort    int               `yaml:"proxy_port"`
	LDFlags      map[string]string `yaml:"ldflags"`
}

type Watchers

type Watchers struct {
	IncludeDirs  []string `yaml:"include_dirs"`
	ExcludeDirs  []string `yaml:"exclude_dirs"`
	IncludeFiles []string `yaml:"include_files"`
	ExcludeFiles []string `yaml:"exclude_files"`
}

Jump to

Keyboard shortcuts

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