config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDir  = ".dev-env"
	ConfigFile = "dev-env.json"
	DockerFile = "Dockerfile"
)

Variables

This section is empty.

Functions

func GetConfigDir

func GetConfigDir() (string, error)

func GetProjectRoot added in v0.0.3

func GetProjectRoot(path string) string

func WriteConfigFileIfNotExist

func WriteConfigFileIfNotExist(dir, filename string, content []byte) error

Types

type Config

type Config struct {
	Version string          `json:"version"`
	Envs    map[string]*Env `json:"envs"`
}

func NewConfig

func NewConfig() (Config, error)

func (*Config) EnvFor

func (c *Config) EnvFor(envName string) (*Env, error)

func (*Config) Read

func (c *Config) Read() error

func (*Config) Write

func (c *Config) Write() error

func (*Config) WriteIfNotExist

func (c *Config) WriteIfNotExist() error

type Env

type Env struct {
	ContainerArgs []string `json:"containerArgs"`
	Name          string   `json:"name"`
	// contains filtered or unexported fields
}

func (*Env) ContainerName

func (e *Env) ContainerName() string

func (*Env) DockerBuildDir added in v0.0.2

func (e *Env) DockerBuildDir() (string, error)

func (*Env) ImageNameAndTag

func (e *Env) ImageNameAndTag() string

func (*Env) WithContainerArgs

func (e *Env) WithContainerArgs(containerArgs []string) *Env

func (*Env) WithName

func (e *Env) WithName(name string) *Env

Jump to

Keyboard shortcuts

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