config

package
v0.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// RootDir contains the name of the directory where gebug internals files and configurations are stored
	RootDir = ".gebug"

	// Path contains the name of gebug's configuration file
	Path = "config.yaml"

	// DockerfileName contains the name of the dockerfile that is used for building and running the project
	DockerfileName = "Dockerfile"

	// DockerComposeFileName contains the name of the docker-compose configuration that is used to configure the container
	DockerComposeFileName = "docker-compose.yml"
)

Variables

View Source
var AppFs = afero.NewOsFs()

AppFs hold the file-system abstraction for this package

Functions

func FilePath

func FilePath(workDir string, fileName string) string

FilePath returns the path of a file inside gebug's directory

Types

type Config

type Config struct {
	Name             string   `yaml:"name"`
	OutputBinaryPath string   `yaml:"output_binary"`
	BuildCommand     string   `yaml:"build_command"`
	RunCommand       string   `yaml:"run_command"`
	RuntimeImage     string   `yaml:"runtime_image"`
	DebuggerEnabled  bool     `yaml:"debugger_enabled"`
	DebuggerPort     int      `yaml:"debugger_port"`
	ExposePorts      []string `yaml:"expose_ports"`
	Networks         []string `yaml:"networks"`
	Environment      []string `yaml:"environment"`
}

Config contains the fields of gebug configuration

func Load

func Load(input []byte) (*Config, error)

Load loads a configuration to a Config struct

func (*Config) Generate

func (c *Config) Generate(workDir string) error

Generate generates the required files to run the docker

func (*Config) RenderDockerComposeFile

func (c *Config) RenderDockerComposeFile(writer io.Writer) error

RenderDockerComposeFile writes the docker-compose.yml configuration to writer

func (*Config) RenderDockerfile

func (c *Config) RenderDockerfile(writer io.Writer) error

RenderDockerfile writes the Dockerfile to writer

func (Config) Write

func (c Config) Write(writer io.Writer) error

Jump to

Keyboard shortcuts

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