projects

package
v1.0.0-alpha-94 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrProjectNotFound happens when a project.json is not found
	ErrProjectNotFound = errors.New("Project not found")

	// ErrProjectAlreadyExists happens when a Project ID already exists
	ErrProjectAlreadyExists = errors.New("Project already exists")

	// ErrInvalidProjectID happens when a Project ID is invalid
	ErrInvalidProjectID = errors.New("Invalid project ID")

	// ErrEmptyProjectID happens when trying to access a project, but providing an empty ID
	ErrEmptyProjectID = errors.New("Can not get project: ID is empty")
)

Functions

func AddDomain

func AddDomain(ctx context.Context, projectID string, domain string) (err error)

AddDomain in project

func CreateFromJSON

func CreateFromJSON(ctx context.Context, filename string) error

CreateFromJSON a project on WeDeploy

func RemoveDomain

func RemoveDomain(ctx context.Context, projectID string, domain string) (err error)

RemoveDomain in project

func Restart

func Restart(ctx context.Context, id string) error

Restart restarts a project

func Unlink(ctx context.Context, projectID string) error

Unlink project

func Validate

func Validate(ctx context.Context, projectID string) (err error)

Validate project

func ValidateOrCreate

func ValidateOrCreate(id string) (fid string, err error)

ValidateOrCreate project

func ValidateOrCreateFromJSON

func ValidateOrCreateFromJSON(filename string) (created bool, err error)

ValidateOrCreateFromJSON project

Types

type Project

type Project struct {
	ID            string                `json:"id"`
	CustomDomains []string              `json:"customDomains,omitempty"`
	Health        string                `json:"health,omitempty"`
	HomeContainer string                `json:"homeContainer,omitempty"`
	Description   string                `json:"description,omitempty"`
	Containers    containers.Containers `json:"containers,omitempty"`
}

Project structure

func Create

func Create(ctx context.Context, id string) (project *Project, err error)

Create project. If id is empty, a random one is created by the backend

func Get

func Get(ctx context.Context, id string) (project Project, err error)

Get project by ID

func List

func List(ctx context.Context) (list []Project, err error)

List projects

func Read

func Read(path string) (*Project, error)

Read a project directory properties (defined by a project.json on it)

Jump to

Keyboard shortcuts

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