project

package
v0.0.0-...-0704e8f Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//DeplyomentModeCompose compose deployment mode
	DeplyomentModeCompose = "compose"
	//DeplyomentModeSwarm swarm deployment mode
	DeplyomentModeSwarm = "swarm"
	//DeplyomentModeFunction function deployment mode
	DeplyomentModeFunction = "function"
	//DeplyomentModeContainer single container deployment mode
	DeplyomentModeContainer = "container"
)
View Source
const VERSION = "1"

VERSION default project version

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	WorkDir  string
	FullPath string
}

Context definition

type Project

type Project struct {
	Name     string
	Version  string
	Services map[string]*Service
	// contains filtered or unexported fields
}

Project definition

func NewProject

func NewProject() *Project

NewProject initialize a new project

func NewProjectFromFile

func NewProjectFromFile(file string) (*Project, error)

NewProjectFromFile initialize a new project from a configuration file

func (*Project) Parse

func (p *Project) Parse(source []byte) error

Parse parse a project content

func (*Project) Start

func (p *Project) Start(opt options.Start) error

Start a project

func (*Project) Status

func (p *Project) Status(opt opts.Status) (string, error)

Status of a project

func (*Project) Stop

func (p *Project) Stop(opt options.Stop) error

Stop a project

type Service

type Service struct {
	Context *Context

	Name        string
	Tags        map[string]Tag
	File        string
	FileContent []byte
	Mode        string
	// contains filtered or unexported fields
}

Service definition

func NewService

func NewService(project *Project) *Service

NewService initialize a new service

func (*Service) GetComposeFileContent

func (s *Service) GetComposeFileContent() ([]byte, error)

GetComposeFileContent read the compose yml file

func (*Service) GetComposeProject

func (s *Service) GetComposeProject() (*prj.Project, error)

GetComposeProject return a project instance, loading if needed

func (*Service) LoadComposeFile

func (s *Service) LoadComposeFile() (*prj.Project, error)

LoadComposeFile read a compose yml file project

func (*Service) Start

func (s *Service) Start(opt *options.Start) error

Start a project

func (*Service) Status

func (s *Service) Status(opt *opts.Status) (string, error)

Status of a service

func (*Service) Stop

func (s *Service) Stop(opt *options.Stop) error

Stop a project

type Tag

type Tag struct {
	Name  string
	Value string
}

Tag definition

type YamlProject

type YamlProject struct {
	Name     string                 `yaml:"name"`
	Version  string                 `yaml:"version"`
	Services map[string]YamlService `yaml:"services"`
}

YamlProject yaml model

type YamlService

type YamlService struct {
	Tags    map[string]string      `yaml:"tags"`
	File    string                 `yaml:"file"`
	Mode    string                 `yaml:"mode"`
	Service map[string]interface{} `yaml:"service"`
}

YamlService yaml model

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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