project

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 8, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMainService = "app"
)

Default config values

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Name           string
	Summary        string
	Description    string
	RunInContainer bool
	HelpFile       string
}

Command represents a custom sub-command

type Config

type Config struct {
	// ProjectName is used for `docker-compose` in order to distinguish projects in other locations
	ProjectName string `json:"project_name" valid:"required"`

	// MainService is a service name in `docker-compose.yml`, in which container commands given to rid are executed.
	// Default is "app"
	MainService string `json:"main_service"`
}

Config is a configuration object which parameters are loaded from yaml file

func NewConfig

func NewConfig(file string) (*Config, error)

NewConfig creates a new Config instance from a file and validates its parameters

type Context

type Context struct {
	RootDir    string
	BaseDir    string
	ConfigFile string
	Command    map[string]*Command
	IP         string
}

Context represents a world where the command is executed

func NewContext

func NewContext(path string) (*Context, error)

NewContext retrieves contextual information for a working directory, and creates a Context instance

Jump to

Keyboard shortcuts

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