che

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2017 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type StarterClient

type StarterClient struct {
	// contains filtered or unexported fields
}

StarterClient describes the REST interface between Platform and Che Starter

func NewStarterClient

func NewStarterClient(cheStarterURL, openshiftMasterURL string, namespace string) *StarterClient

NewStarterClient is a helper function to create a new CheStarter client Uses http.DefaultClient

func (*StarterClient) CreateWorkspace

func (cs *StarterClient) CreateWorkspace(ctx context.Context, workspace WorkspaceRequest) (*WorkspaceResponse, error)

CreateWorkspace creates a new Che Workspace based on a repository

func (*StarterClient) ListWorkspaces

func (cs *StarterClient) ListWorkspaces(ctx context.Context, repository string) ([]*WorkspaceResponse, error)

ListWorkspaces lists the available workspaces for a given user

func (*StarterClient) StartExistingWorkspace

func (cs *StarterClient) StartExistingWorkspace(ctx context.Context, workspaceName string) (*WorkspaceResponse, error)

StartExistingWorkspace starts an existing Che Workspace based on a repository

type WorkspaceConfig

type WorkspaceConfig struct {
	Name string `json:"name"`
}

WorkspaceConfig represents the workspace config

type WorkspaceError

type WorkspaceError struct {
	Status    int    `json:"status"`
	ErrorMsg  string `json:"error"`
	Message   string `json:"message"`
	Timestamp string `json:"timeStamp"`
	Trace     string `json:"trace"`
}

WorkspaceError represent an error comming from the che-starter service

func (*WorkspaceError) Error

func (err *WorkspaceError) Error() string

func (*WorkspaceError) String

func (err *WorkspaceError) String() string
type WorkspaceLink struct {
	HRef   string `json:"href"`
	Method string `json:"method"`
	Rel    string `json:"rel"`
}

WorkspaceLink represents a URL for the location of a workspace

type WorkspaceRequest

type WorkspaceRequest struct {
	//ID          string `json:"id,omitempty"`
	Branch      string `json:"branch,omitempty"`
	Description string `json:"description,omitempty"`
	Name        string `json:"config.name,omitempty"`
	Repository  string `json:"repo,omitempty"`
	StackID     string `json:"stackId,omitempty"`
}

WorkspaceRequest represents a create workspace request body

type WorkspaceResponse

type WorkspaceResponse struct {
	//ID string `json:"id,omitempty"`
	//	Branch          string `json:"branch"`
	Description string `json:"description,omitempty"`
	//	Location        string `json:"location"`
	//	Login           string `json:"login"`
	Config WorkspaceConfig `json:"config,omitempty"`
	//	Repository      string `json:"repository"`
	Status string `json:"status,omitempty"`
	//	WorkspaceIDEURL string `json:"workspaceIdeUrl"`
	Links []WorkspaceLink `json:"links,omitempty"`
}

WorkspaceResponse represents a create workspace response body

func (WorkspaceResponse) GetIDEURL

func (w WorkspaceResponse) GetIDEURL() string

GetIDEURL return the link with rel for ide url

Jump to

Keyboard shortcuts

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