entity

package
v0.6.65 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	WorkspaceRunningStatus  = "RUNNING"
	WorkspaceStartingStatus = "STARTING"
	WorkspaceStoppingStatus = "STOPPING"
	WorkspaceDeletingStatus = "DELETING"
)

Variables

This section is empty.

Functions

func CleanSubdomain added in v0.6.60

func CleanSubdomain(in string) string

lowercase, replace whitespace with '-', remove all [^a-z0-9-], trim '-' front and back

func GetFirstKeyMap added in v0.6.60

func GetFirstKeyMap(strMap map[string][]Workspace) (string, bool)

Types

type Application

type Application struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Port         int    `json:"port"`
	StartCommand string `json:"startCommand"`
	Version      string `json:"version"`
}

type AuthTokens

type AuthTokens struct {
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
}

type IdeConfig added in v0.6.64

type IdeConfig struct {
	VsCode VsCode `json:"vscode"`
}

type OnboardingStatus added in v0.6.55

type OnboardingStatus struct {
	Editor  string `json:"editor"`
	SSH     bool   `json:"ssh"`
	UsedCLI bool   `json:"usedCli"`
}

type Organization

type Organization struct {
	ID            string `json:"id"`
	Name          string `json:"name"`
	UserNetworkID string `json:"userNetworkId"`
}

type RequestCreateWorkspace

type RequestCreateWorkspace struct {
	Name                 string        `json:"name"`
	WorkspaceGroupID     string        `json:"workspaceGroupId"`
	WorkspaceClassID     string        `json:"workspaceClassId"`
	GitRepo              string        `json:"gitRepo"`
	IsStoppable          bool          `json:"isStoppable"`
	WorkspaceTemplateID  string        `json:"workspaceTemplateId"`
	PrimaryApplicationID string        `json:"primaryApplicationId"`
	Applications         []Application `json:"applications"`
}

type UpdateUser added in v0.5.0

type UpdateUser struct {
	Username          string                 `json:"username,omitempty"`
	Name              string                 `json:"name,omitempty"`
	Email             string                 `json:"email,omitempty"`
	BaseWorkspaceRepo string                 `json:"baseWorkspaceRepo,omitempty"`
	OnboardingStatus  map[string]interface{} `json:"onboardingData,omitempty"` // todo fix inconsitency
	IdeConfig         IdeConfig              `json:"ideConfig,omitempty"`
}

type User

type User struct {
	ID                string                 `json:"id"`
	PublicKey         string                 `json:"publicKey,omitempty"`
	Username          string                 `json:"username"`
	Name              string                 `json:"name"`
	Email             string                 `json:"email"`
	WorkspacePassword string                 `json:"workspacePassword"`
	BaseWorkspaceRepo string                 `json:"baseWorkspaceRepo"`
	GlobalUserType    string                 `json:"globalUserType"`
	IdeConfig         IdeConfig              `json:"IdeConfig,omitempty"`
	OnboardingStatus  map[string]interface{} `json:"onboardingData"` // todo fix inconsitency
}

func (User) GetOnboardingStatus added in v0.6.55

func (u User) GetOnboardingStatus() (*OnboardingStatus, error)

type UserKeys

type UserKeys struct {
	PrivateKey      string               `json:"privateKey"`
	PublicKey       string               `json:"publicKey"`
	WorkspaceGroups []WorkspaceGroupKeys `json:"workspaceGroups"`
}

func (UserKeys) GetWorkspaceGroupKeysByGroupID

func (u UserKeys) GetWorkspaceGroupKeysByGroupID(groupID string) (*WorkspaceGroupKeys, error)

type VSCodeExtensionMetadata added in v0.6.64

type VSCodeExtensionMetadata struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
	Version     string `json:"version"`
	Publisher   string `json:"publisher"`
	Description string `json:"description"`
	Repository  string `json:"repository"`
}

type VirtualProject added in v0.6.60

type VirtualProject struct {
	Name             string
	GitURL           string
	WorkspacesByUser map[string][]Workspace
}

func NewVirtualProjects added in v0.6.60

func NewVirtualProjects(workspaces []Workspace) []VirtualProject

func (VirtualProject) GetUniqueUserCount added in v0.6.60

func (v VirtualProject) GetUniqueUserCount() int

func (VirtualProject) GetUserWorkspaces added in v0.6.60

func (v VirtualProject) GetUserWorkspaces(userID string) []Workspace

type VsCode added in v0.6.64

type VsCode struct {
	Extensions []VSCodeExtensionMetadata `json:"extensions"`
}

type Workspace

type Workspace struct {
	ID               string `json:"id"`
	Name             string `json:"name"`
	WorkspaceGroupID string `json:"workspaceGroupId"`
	OrganizationID   string `json:"organizationId"`
	// WorkspaceClassID is resources, like "2x8"
	WorkspaceClassID  string            `json:"workspaceClassId"`
	CreatedByUserID   string            `json:"createdByUserId"`
	DNS               string            `json:"dns"`
	Status            string            `json:"status"`
	Password          string            `json:"password"`
	GitRepo           string            `json:"gitRepo"`
	Version           string            `json:"version"`
	WorkspaceTemplate WorkspaceTemplate `json:"workspaceTemplate"`
	NetworkID         string            `json:"networkId"`
}

func WorkspacesWithMetaToWorkspaces added in v0.6.6

func WorkspacesWithMetaToWorkspaces(wms []WorkspaceWithMeta) []Workspace

func (Workspace) GetID

func (w Workspace) GetID() string

func (Workspace) GetLocalIdentifier added in v0.5.0

func (w Workspace) GetLocalIdentifier() WorkspaceLocalID

func (Workspace) GetNodeIdentifierForVPN added in v0.6.22

func (w Workspace) GetNodeIdentifierForVPN() string

func (Workspace) GetProjectFolderPath added in v0.6.63

func (w Workspace) GetProjectFolderPath() string

func (Workspace) GetSSHURL added in v0.6.0

func (w Workspace) GetSSHURL() string

type WorkspaceGroupKeys

type WorkspaceGroupKeys struct {
	GroupID string `json:"groupId"`
	Cert    string `json:"cert"`
	CA      string `json:"ca"`
	APIURL  string `json:"apiUrl"`
}

type WorkspaceLocalID added in v0.5.0

type WorkspaceLocalID string

type WorkspaceMetaData

type WorkspaceMetaData struct {
	PodName       string `json:"podName"`
	NamespaceName string `json:"namespaceName"`
}

func (WorkspaceMetaData) GetNamespaceName

func (w WorkspaceMetaData) GetNamespaceName() string

func (WorkspaceMetaData) GetPodName

func (w WorkspaceMetaData) GetPodName() string

type WorkspaceTemplate added in v0.6.0

type WorkspaceTemplate struct {
	ID          string `json:"id"`
	Type        string `json:"type"`
	Name        string `json:"name"`
	RegistryURI string `json:"registryUri"`
	Image       string `json:"image"`
	Public      bool   `json:"public"`
	Port        int    `json:"port"`
}

type WorkspaceWithMeta

type WorkspaceWithMeta struct {
	WorkspaceMetaData
	Workspace
}

Jump to

Keyboard shortcuts

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