version100

package
v1.2.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const JsonSchema100 = `` /* 41848-byte string literal not displayed */

Variables

View Source
var SupportedProjectTypes = []ProjectType{ProjectTypeGit}

Functions

This section is empty.

Types

type ApiVersion added in v1.2.2

type ApiVersion string

type Attributes added in v1.2.2

type Attributes map[string]string

----------- Devfile Schema ---------- //

type Command added in v1.2.2

type Command struct {

	// List of the actions of given command. Now the only one command must be
	// specified in list but there are plans to implement supporting multiple actions
	// commands.
	Actions []CommandAction `yaml:"actions" json:"actions"`

	// Additional command attributes
	Attributes Attributes `yaml:"attributes,omitempty" json:"attributes,omitempty"`

	// Describes the name of the command. Should be unique per commands set.
	Name string `yaml:"name"`

	// Preview url
	PreviewUrl CommandPreviewUrl `yaml:"previewUrl,omitempty" json:"previewUrl,omitempty"`
}

type CommandAction added in v1.2.2

type CommandAction struct {

	// The actual action command-line string
	Command string `yaml:"command,omitempty" json:"command,omitempty"`

	// Describes component to which given action relates
	Component string `yaml:"component,omitempty" json:"component,omitempty"`

	// the path relative to the location of the devfile to the configuration file
	// defining one or more actions in the editor-specific format
	Reference string `yaml:"reference,omitempty" json:"reference,omitempty"`

	// The content of the referenced configuration file that defines one or more
	// actions in the editor-specific format
	ReferenceContent string `yaml:"referenceContent,omitempty" json:"referenceContent,omitempty"`

	// Describes action type
	Type CommandType `yaml:"type,omitempty" json:"type,omitempty"`

	// Working directory where the command should be executed
	Workdir string `yaml:"workdir,omitempty" json:"workdir,omitempty"`
}

type CommandPreviewUrl added in v1.2.2

type CommandPreviewUrl struct {
	Port int32  `yaml:"port,omitempty" json:"port,omitempty"`
	Path string `yaml:"path,omitempty" json:"path,omitempty"`
}

type CommandType added in v1.2.2

type CommandType string

-------------- Supported devfile command types ------------ //

const (
	DevfileCommandTypeInit  CommandType = "init"
	DevfileCommandTypeBuild CommandType = "build"
	DevfileCommandTypeRun   CommandType = "run"
	DevfileCommandTypeDebug CommandType = "debug"
	DevfileCommandTypeExec  CommandType = "exec"
)

type Component added in v1.2.2

type Component struct {

	// The name using which other places of this devfile (like commands) can refer to
	// this component. This attribute is optional but must be unique in the devfile if
	// specified.
	Alias string `yaml:"alias,omitempty" json:"alias,omitempty"`

	// Describes whether projects sources should be mount to the component.
	// `CHE_PROJECTS_ROOT` environment variable should contains a path where projects
	// sources are mount
	MountSources bool `yaml:"mountSources,omitempty" json:"mountSources,omitempty"`

	// Describes type of the component, e.g. whether it is an plugin or editor or
	// other type
	Type ComponentType `yaml:"type" json:"type"`

	// for type ChePlugin
	ComponentChePlugin `yaml:",inline" json:",inline"`

	// for type=dockerfile
	ComponentDockerimage `yaml:",inline" json:",inline"`
}

type ComponentCheEditor added in v1.2.2

type ComponentCheEditor struct {
	Id          string `yaml:"id,omitempty" json:"id,omitempty"`
	Reference   string `yaml:"reference,omitempty" json:"reference,omitempty"`
	RegistryUrl string `yaml:"registryUrl,omitempty" json:"registryUrl,omitempty"`
}

type ComponentChePlugin added in v1.2.2

type ComponentChePlugin struct {
	Id          string `yaml:"id,omitempty" json:"id,omitempty"`
	Reference   string `yaml:"reference,omitempty" json:"reference,omitempty"`
	RegistryUrl string `yaml:"registryUrl,omitempty" json:"registryUrl,omitempty"`
}

type ComponentDockerimage added in v1.2.2

type ComponentDockerimage struct {
	Image       string                `yaml:"image,omitempty" json:"image,omitempty"`
	MemoryLimit string                `yaml:"memoryLimit,omitempty" json:"memoryLimit,omitempty"`
	Command     []string              `yaml:"command,omitempty" json:"command,omitempty"`
	Args        []string              `yaml:"args,omitempty" json:"args,omitempty"`
	Volumes     []DockerimageVolume   `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	Env         []DockerimageEnv      `yaml:"env,omitempty" json:"env,omitempty"`
	Endpoints   []DockerimageEndpoint `yaml:"endpoints,omitempty" json:"endpoints,omitempty"`
}

type ComponentKubernetes added in v1.2.2

type ComponentKubernetes struct {
	Reference        string `yaml:"reference,omitempty" json:"reference,omitempty"`
	ReferenceContent string `yaml:"referenceContent,omitempty" json:"referenceContent,omitempty"`
	Selector         string `yaml:"selector,omitempty" json:"selector,omitempty"`
	EntryPoints      string `yaml:"entryPoints,omitempty" json:"entryPoints,omitempty"`
	MemoryLimit      string `yaml:"memoryLimit,omitempty" json:"memoryLimit,omitempty"`
}

type ComponentOpenshift added in v1.2.2

type ComponentOpenshift struct {
	Reference        string `yaml:"reference,omitempty" json:"reference,omitempty"`
	ReferenceContent string `yaml:"referenceContent,omitempty" json:"referenceContent,omitempty"`
	Selector         string `yaml:"selector,omitempty" json:"selector,omitempty"`
	EntryPoints      string `yaml:"entryPoints,omitempty" json:"entryPoints,omitempty"`
	MemoryLimit      string `yaml:"memoryLimit,omitempty" json:"memoryLimit,omitempty"`
}

type ComponentType added in v1.2.2

type ComponentType string

-------------- Supported devfile component types ------------ // DevfileComponentType stores valid devfile component types

const (
	DevfileComponentTypeCheEditor   ComponentType = "cheEditor"
	DevfileComponentTypeChePlugin   ComponentType = "chePlugin"
	DevfileComponentTypeDockerimage ComponentType = "dockerimage"
	DevfileComponentTypeKubernetes  ComponentType = "kubernetes"
	DevfileComponentTypeOpenshift   ComponentType = "openshift"
)

type Devfile100

type Devfile100 struct {

	// Devfile section "apiVersion"
	ApiVersion ApiVersion `yaml:"apiVersion" json:"apiVersion"`

	// Devfile section "metadata"
	Metadata Metadata `yaml:"metadata" json:"metadata"`

	// Devfile section projects
	Projects []Project `yaml:"projects,omitempty" json:"projects,omitempty"`

	Attributes Attributes `yaml:"attributes,omitempty" json:"attributes,omitempty"`

	// Description of the workspace components, such as editor and plugins
	Components []Component `yaml:"components,omitempty" json:"components,omitempty"`

	// Description of the predefined commands to be available in workspace
	Commands []Command `yaml:"commands,omitempty" json:"commands,omitempty"`
}

Devfile100 struct maps to devfile 1.0.0 version schema

func (*Devfile100) GetAliasedComponents

func (d *Devfile100) GetAliasedComponents() []common.DevfileComponent

GetAliasedComponents returns the slice of DevfileComponent objects that each have an alias

func (*Devfile100) GetCommands

func (d *Devfile100) GetCommands() []common.DevfileCommand

GetCommands returns the slice of DevfileCommand objects parsed from the Devfile

func (*Devfile100) GetComponents

func (d *Devfile100) GetComponents() []common.DevfileComponent

/ GetComponents returns the slice of DevfileComponent objects parsed from the Devfile

func (*Devfile100) GetEvents added in v1.2.2

func (d *Devfile100) GetEvents() common.DevfileEvents

func (*Devfile100) GetMetadata added in v1.2.2

func (d *Devfile100) GetMetadata() common.DevfileMetadata

GetMetadata returns the struct of DevfileMetadata objects parsed from the Devfile

func (*Devfile100) GetParent added in v1.2.2

func (d *Devfile100) GetParent() common.DevfileParent

func (*Devfile100) GetProjects

func (d *Devfile100) GetProjects() []common.DevfileProject

GetProjects returns the slice of DevfileProject objects parsed from the Devfile

type DockerimageEndpoint added in v1.2.2

type DockerimageEndpoint struct {
	Name string `yaml:"name,omitempty" json:"name,omitempty"`
	Port int32  `yaml:"port,omitempty" json:"port,omitempty"`
}

type DockerimageEnv added in v1.2.2

type DockerimageEnv struct {
	Name  string `yaml:"name,omitempty" json:"name,omitempty"`
	Value string `yaml:"value,omitempty" json:"value,omitempty"`
}

type DockerimageVolume added in v1.2.2

type DockerimageVolume struct {
	Name          string `yaml:"name,omitempty" json:"name,omitempty"`
	ContainerPath string `yaml:"containerPath,omitempty" json:"containerPath,omitempty"`
}

type Metadata added in v1.2.2

type Metadata struct {

	// Workspaces created from devfile, will use it as base and append random suffix.
	// It's used when name is not defined.
	GenerateName string `yaml:"generateName,omitempty" json:"generateName,omitempty"`

	// The name of the devfile. Workspaces created from devfile, will inherit this
	// name
	Name string `yaml:"name,omitempty" json:"name,omitempty"`
}

type Project added in v1.2.2

type Project struct {

	// The path relative to the root of the projects to which this project should be cloned into. This is a unix-style relative path (i.e. uses forward slashes). The path is invalid if it is absolute or tries to escape the project root through the usage of '..'. If not specified, defaults to the project name."
	ClonePath string `yaml:"clonePath,omitempty" json:"clonePath,omitempty"`

	// The Project Name
	Name string `yaml:"name" json:"name"`

	// Describes the project's source - type and location
	Source ProjectSource `yaml:"source" json:"source"`
}

Description of the projects, containing names and sources locations

type ProjectSource added in v1.2.2

type ProjectSource struct {
	Type ProjectType `yaml:"type" json:"type"`

	// Project's source location address. Should be URL for git and github located projects"
	Location string `yaml:"location" json:"location"`

	// The name of the of the branch to check out after obtaining the source from the location.
	//  The branch has to already exist in the source otherwise the default branch is used.
	//  In case of git, this is also the name of the remote branch to push to.
	Branch string `yaml:"branch,omitempty" json:"branch,omitempty"`

	// The id of the commit to reset the checked out branch to.
	//  Note that this is equivalent to 'startPoint' and provided for convenience.
	CommitId string `yaml:"commitId,omitempty" json:"commitId,omitempty"`

	// Part of project to populate in the working directory.
	SparseCheckoutDir string `yaml:"sparseCheckoutDir,omitempty" json:"sparseCheckoutDir,omitempty"`

	// The tag or commit id to reset the checked out branch to.
	StartPoint string `yaml:"startPoint,omitempty" json:"startPoint,omitempty"`

	// The name of the tag to reset the checked out branch to.
	//  Note that this is equivalent to 'startPoint' and provided for convenience.
	Tag string `yaml:"tag,omitempty" json:"tag,omitempty"`
}

type ProjectType added in v1.2.2

type ProjectType string

-------------- Supported devfile project types ------------ // DevfileProjectType store valid devfile project types

const (
	ProjectTypeGit    ProjectType = "git"
	ProjectTypeGitHub ProjectType = "github"
	ProjectTypeZip    ProjectType = "zip"
)

Jump to

Keyboard shortcuts

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