space

package
v0.0.0-...-758a821 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BeforeRunScriptFormat = `
		Running %s action
		$ wo run %s
	`
	ScriptShowFormat = "$ %s"
)
View Source
const (
	ErrFormatAlreadyExists     = "dir already exists: %s"
	ErrFormatFolderDoesntExist = "folder doesn't exist: %s"
)

Variables

View Source
var Licenses = []License{
	{Name: "Academic Free License 3.0 ", Identifier: "AFL-3.0"},
	{Name: "Adaptive Public License", Identifier: "APL-1.0"},
	{Name: "Apache License 2.0", Identifier: "Apache-2.0"},
	{Name: "Apple Public Source License 2.0 ", Identifier: "APSL-2.0"},
	{Name: "Artistic License 2.0", Identifier: "Artistic-2.0"},
	{Name: "BSD Zero Clause License", Identifier: "0BSD"},
	{Name: "BSD 1-Clause License", Identifier: "BSD-1-Clause"},
	{Name: "BSD 2-Clause License", Identifier: "BSD-2-Clause"},
	{Name: "BSD 3-Clause License", Identifier: "BSD-3-Clause"},
	{Name: "Educational Community License 2.0", Identifier: "ECL-2.0"},
	{Name: "Eclipse Public License 2.0", Identifier: "EPL-2.0"},
	{Name: "GNU Affero General Public License 3.0", Identifier: "AGPL-3.0"},
	{Name: "GNU General Public License 2.0", Identifier: "GPL-2.0-only"},
	{Name: "GNU General Public License 3.0", Identifier: "GPL-3.0-only"},
	{Name: "GNU Lesser General Public License 2.1", Identifier: "LGPL-2.1-only"},
	{Name: "GNU Lesser General Public License 3.0", Identifier: "LGPL-3.0-only"},
	{Name: "IBM Public License 1.0", Identifier: "IPL-1.0"},
	{Name: "ISC License", Identifier: "ISC"},
	{Name: "Microsoft Public License", Identifier: "MS-PL"},
	{Name: "MIT License", Identifier: "MIT"},
	{Name: "Mozilla Public License 2.0", Identifier: "MPL-2.0"},
	{Name: "Open Software License 3.0", Identifier: "OSL-3.0"},
	{Name: "University of Illinois/NCSA Open Source License", Identifier: "	NCSA"},
	{Name: "The Unlicense", Identifier: "Unlicense"},
	{Name: "zLib License", Identifier: "ZLib"},
}
View Source
var WorkspaceNameValidationRules = []validation.Rule{validation.Required, validation.Length(2, 64), is.PrintableASCII}

Functions

func CreateWorkspace

func CreateWorkspace(w Workspace, opts Options) error

func InitWorkspace

func InitWorkspace(w Workspace, opts Options) error

func MoveWorkspace

func MoveWorkspace(w map[string]string, newpath string) error

func PrintTinyStat

func PrintTinyStat(w Workspace)

func RemoveWorkspace

func RemoveWorkspace(path string, force bool) error

func RunAction

func RunAction(script Action, quiet bool) error

Types

type Action

type Action struct {
	Name       string   `json:"name"`
	Env        []string `json:"env"`
	Args       []string `json:"args"`
	Run        string   `json:"run"`
	Workingdir string   `json:"working_dir"`
}

func (*Action) Map

func (a *Action) Map() map[string]interface{}

type Flows

type Flows struct {
	Name       string   `json:"name"`
	Env        string   `json:"env"`
	WorkingDir string   `json:"working_dir"`
	Steps      []Action `json:"steps"`
}

func (*Flows) Map

func (f *Flows) Map() map[string]interface{}

type License

type License struct {
	Name       string
	Identifier string
}

type Options

type Options struct {
	Readme        string `json:"readme"`
	CodeOfConduct string `json:"code_of_conduct"`
	Contributing  string `json:"contributing"`
	License       string `json:"license"`
	Git           string `json:"git"`
	Gitignore     string `json:"gitignore"`
	Editor        string `json:"editor"`
}

func (*Options) Map

func (o *Options) Map() map[string]interface{}

type Space

type Space struct {
	ID          string               `json:"id"`
	Description string               `json:"description"`
	TempDir     string               `json:"temp_dir"`
	RootDir     string               `json:"root_dir"`
	Defaults    Options              `json:"defaults"`
	CreatedAt   int64                `json:"created_at"`
	Workspaces  map[string]Workspace `json:"workspaces"`
}

func (*Space) Map

func (s *Space) Map() map[string]interface{}

func (*Space) MapForConfig

func (s *Space) MapForConfig() map[string]interface{}

func (*Space) MapWithoutWorkspaces

func (s *Space) MapWithoutWorkspaces() map[string]interface{}

type Workspace

type Workspace struct {
	ID          string   `json:"id"`
	Name        string   `json:"name"`
	Path        string   `json:"path"`
	Description string   `json:"description"`
	Run         string   `json:"run"`
	Actions     []Action `json:"actions"`
	Flows       []Flows  `json:"flows"`
	CreatedAt   int64    `json:"created_at"`
}

func (*Workspace) Map

func (ws *Workspace) Map() map[string]interface{}

func (*Workspace) MapForConfig

func (ws *Workspace) MapForConfig() map[string]interface{}

func (*Workspace) MapForRC

func (ws *Workspace) MapForRC() map[string]interface{}

Jump to

Keyboard shortcuts

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