server

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateWorkspacesPath

func CreateWorkspacesPath() string

CreateWorkspacesPath returns the URL path to the workspaces service create HTTP endpoint.

func DecodeCreateRequest

func DecodeCreateRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*workspaces.CreateWorkspacePayload, error)

DecodeCreateRequest returns a decoder for requests sent to the workspaces create endpoint.

func DecodeDeleteRequest

func DecodeDeleteRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*workspaces.DeletePayload, error)

DecodeDeleteRequest returns a decoder for requests sent to the workspaces delete endpoint.

func DecodeGetRequest

func DecodeGetRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*workspaces.GetPayload, error)

DecodeGetRequest returns a decoder for requests sent to the workspaces get endpoint.

func DecodeListRequest

func DecodeListRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*workspaces.ListPayload, error)

DecodeListRequest returns a decoder for requests sent to the workspaces list endpoint.

func DecodeResetRequest added in v0.4.0

func DecodeResetRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*workspaces.ResetPayload, error)

DecodeResetRequest returns a decoder for requests sent to the workspaces reset endpoint.

func DecodeStartRequest

func DecodeStartRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*workspaces.StartPayload, error)

DecodeStartRequest returns a decoder for requests sent to the workspaces start endpoint.

func DecodeStopRequest

func DecodeStopRequest(mux goahttp.Muxer, decoder func(*http.Request) goahttp.Decoder) func(*http.Request) (*workspaces.StopPayload, error)

DecodeStopRequest returns a decoder for requests sent to the workspaces stop endpoint.

func DeleteWorkspacesPath

func DeleteWorkspacesPath(name string) string

DeleteWorkspacesPath returns the URL path to the workspaces service delete HTTP endpoint.

func EncodeCreateError

func EncodeCreateError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeCreateError returns an encoder for errors returned by the create workspaces endpoint.

func EncodeCreateResponse

func EncodeCreateResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeCreateResponse returns an encoder for responses returned by the workspaces create endpoint.

func EncodeDeleteError

func EncodeDeleteError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeDeleteError returns an encoder for errors returned by the delete workspaces endpoint.

func EncodeDeleteResponse

func EncodeDeleteResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeDeleteResponse returns an encoder for responses returned by the workspaces delete endpoint.

func EncodeGetError

func EncodeGetError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeGetError returns an encoder for errors returned by the get workspaces endpoint.

func EncodeGetResponse

func EncodeGetResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeGetResponse returns an encoder for responses returned by the workspaces get endpoint.

func EncodeListResponse

func EncodeListResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeListResponse returns an encoder for responses returned by the workspaces list endpoint.

func EncodeResetError added in v0.4.0

func EncodeResetError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeResetError returns an encoder for errors returned by the reset workspaces endpoint.

func EncodeResetResponse added in v0.4.0

func EncodeResetResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeResetResponse returns an encoder for responses returned by the workspaces reset endpoint.

func EncodeStartError

func EncodeStartError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeStartError returns an encoder for errors returned by the start workspaces endpoint.

func EncodeStartResponse

func EncodeStartResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeStartResponse returns an encoder for responses returned by the workspaces start endpoint.

func EncodeStopError

func EncodeStopError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error

EncodeStopError returns an encoder for errors returned by the stop workspaces endpoint.

func EncodeStopResponse

func EncodeStopResponse(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder) func(context.Context, http.ResponseWriter, any) error

EncodeStopResponse returns an encoder for responses returned by the workspaces stop endpoint.

func GetWorkspacesPath

func GetWorkspacesPath(name string) string

GetWorkspacesPath returns the URL path to the workspaces service get HTTP endpoint.

func ListWorkspacesPath

func ListWorkspacesPath() string

ListWorkspacesPath returns the URL path to the workspaces service list HTTP endpoint.

func Mount

func Mount(mux goahttp.Muxer, h *Server)

Mount configures the mux to serve the workspaces endpoints.

func MountCreateHandler

func MountCreateHandler(mux goahttp.Muxer, h http.Handler)

MountCreateHandler configures the mux to serve the "workspaces" service "create" endpoint.

func MountDeleteHandler

func MountDeleteHandler(mux goahttp.Muxer, h http.Handler)

MountDeleteHandler configures the mux to serve the "workspaces" service "delete" endpoint.

func MountGetHandler

func MountGetHandler(mux goahttp.Muxer, h http.Handler)

MountGetHandler configures the mux to serve the "workspaces" service "get" endpoint.

func MountListHandler

func MountListHandler(mux goahttp.Muxer, h http.Handler)

MountListHandler configures the mux to serve the "workspaces" service "list" endpoint.

func MountResetHandler added in v0.4.0

func MountResetHandler(mux goahttp.Muxer, h http.Handler)

MountResetHandler configures the mux to serve the "workspaces" service "reset" endpoint.

func MountStartHandler

func MountStartHandler(mux goahttp.Muxer, h http.Handler)

MountStartHandler configures the mux to serve the "workspaces" service "start" endpoint.

func MountStopHandler

func MountStopHandler(mux goahttp.Muxer, h http.Handler)

MountStopHandler configures the mux to serve the "workspaces" service "stop" endpoint.

func NewCreateHandler

func NewCreateHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewCreateHandler creates a HTTP handler which loads the HTTP request and calls the "workspaces" service "create" endpoint.

func NewCreateWorkspacePayload

func NewCreateWorkspacePayload(body *CreateRequestBody) *workspaces.CreateWorkspacePayload

NewCreateWorkspacePayload builds a workspaces service create endpoint payload.

func NewDeleteHandler

func NewDeleteHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewDeleteHandler creates a HTTP handler which loads the HTTP request and calls the "workspaces" service "delete" endpoint.

func NewDeletePayload

func NewDeletePayload(name string, namespace string) *workspaces.DeletePayload

NewDeletePayload builds a workspaces service delete endpoint payload.

func NewGetHandler

func NewGetHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewGetHandler creates a HTTP handler which loads the HTTP request and calls the "workspaces" service "get" endpoint.

func NewGetPayload

func NewGetPayload(name string, namespace string) *workspaces.GetPayload

NewGetPayload builds a workspaces service get endpoint payload.

func NewListHandler

func NewListHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewListHandler creates a HTTP handler which loads the HTTP request and calls the "workspaces" service "list" endpoint.

func NewListPayload

func NewListPayload(namespace string) *workspaces.ListPayload

NewListPayload builds a workspaces service list endpoint payload.

func NewResetHandler added in v0.4.0

func NewResetHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewResetHandler creates a HTTP handler which loads the HTTP request and calls the "workspaces" service "reset" endpoint.

func NewResetPayload added in v0.4.0

func NewResetPayload(name string, namespace string) *workspaces.ResetPayload

NewResetPayload builds a workspaces service reset endpoint payload.

func NewStartHandler

func NewStartHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewStartHandler creates a HTTP handler which loads the HTTP request and calls the "workspaces" service "start" endpoint.

func NewStartPayload

func NewStartPayload(name string, namespace string) *workspaces.StartPayload

NewStartPayload builds a workspaces service start endpoint payload.

func NewStopHandler

func NewStopHandler(
	endpoint goa.Endpoint,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) http.Handler

NewStopHandler creates a HTTP handler which loads the HTTP request and calls the "workspaces" service "stop" endpoint.

func NewStopPayload

func NewStopPayload(name string, namespace string) *workspaces.StopPayload

NewStopPayload builds a workspaces service stop endpoint payload.

func ResetWorkspacesPath added in v0.4.0

func ResetWorkspacesPath(name string) string

ResetWorkspacesPath returns the URL path to the workspaces service reset HTTP endpoint.

func StartWorkspacesPath

func StartWorkspacesPath(name string) string

StartWorkspacesPath returns the URL path to the workspaces service start HTTP endpoint.

func StopWorkspacesPath

func StopWorkspacesPath(name string) string

StopWorkspacesPath returns the URL path to the workspaces service stop HTTP endpoint.

func ValidateCreateRequestBody

func ValidateCreateRequestBody(body *CreateRequestBody) (err error)

ValidateCreateRequestBody runs the validations defined on CreateRequestBody

func ValidateEnvVarRequestBody

func ValidateEnvVarRequestBody(body *EnvVarRequestBody) (err error)

ValidateEnvVarRequestBody runs the validations defined on EnvVarRequestBody

func ValidateTolerationRequestBody

func ValidateTolerationRequestBody(body *TolerationRequestBody) (err error)

ValidateTolerationRequestBody runs the validations defined on TolerationRequestBody

func ValidateVolumeMountRequestBody

func ValidateVolumeMountRequestBody(body *VolumeMountRequestBody) (err error)

ValidateVolumeMountRequestBody runs the validations defined on VolumeMountRequestBody

func ValidateWorkspaceContainerRequestBody

func ValidateWorkspaceContainerRequestBody(body *WorkspaceContainerRequestBody) (err error)

ValidateWorkspaceContainerRequestBody runs the validations defined on WorkspaceContainerRequestBody

Types

type ContainerStateResponse

type ContainerStateResponse struct {
	// Current state: running, waiting, terminated
	State *string `form:"state,omitempty" json:"state,omitempty" xml:"state,omitempty"`
	// Reason for the state
	Reason *string `form:"reason,omitempty" json:"reason,omitempty" xml:"reason,omitempty"`
	// Details about the state
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Time the container started
	StartedAt *string `form:"started_at,omitempty" json:"started_at,omitempty" xml:"started_at,omitempty"`
}

ContainerStateResponse is used to define fields on response body types.

type ContainerStateResponseBody

type ContainerStateResponseBody struct {
	// Current state: running, waiting, terminated
	State *string `form:"state,omitempty" json:"state,omitempty" xml:"state,omitempty"`
	// Reason for the state
	Reason *string `form:"reason,omitempty" json:"reason,omitempty" xml:"reason,omitempty"`
	// Details about the state
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Time the container started
	StartedAt *string `form:"started_at,omitempty" json:"started_at,omitempty" xml:"started_at,omitempty"`
}

ContainerStateResponseBody is used to define fields on response body types.

type CreateRequestBody

type CreateRequestBody struct {
	// Workspace name
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Target namespace
	Namespace *string `form:"namespace,omitempty" json:"namespace,omitempty" xml:"namespace,omitempty"`
	// Workspace type: 'container' (default, runs as a StatefulSet), 'vm' (KubeVirt
	// VirtualMachine booting a containerDisk image), or 'scratch' (plain
	// Deployment)
	Type *string `form:"type,omitempty" json:"type,omitempty" xml:"type,omitempty"`
	// Main container spec
	Container *WorkspaceContainerRequestBody `form:"container,omitempty" json:"container,omitempty" xml:"container,omitempty"`
	// Volumes to mount
	VolumeMounts []*VolumeMountRequestBody `form:"volume_mounts,omitempty" json:"volume_mounts,omitempty" xml:"volume_mounts,omitempty"`
	// Custom environment variables to inject into the workspace container
	Env []*EnvVarRequestBody `form:"env,omitempty" json:"env,omitempty" xml:"env,omitempty"`
	// Pod tolerations for scheduling
	Tolerations []*TolerationRequestBody `form:"tolerations,omitempty" json:"tolerations,omitempty" xml:"tolerations,omitempty"`
	// Node selector labels for scheduling
	NodeSelector map[string]string `form:"node_selector,omitempty" json:"node_selector,omitempty" xml:"node_selector,omitempty"`
	// Mount /dev/shm as an emptyDir with medium=Memory (required for Chrome, ML
	// frameworks)
	SharedMemory *bool `form:"shared_memory,omitempty" json:"shared_memory,omitempty" xml:"shared_memory,omitempty"`
	// Image pull policy for the workspace container (Always, IfNotPresent, Never)
	ImagePullPolicy *string `form:"image_pull_policy,omitempty" json:"image_pull_policy,omitempty" xml:"image_pull_policy,omitempty"`
}

CreateRequestBody is the type of the "workspaces" service "create" endpoint HTTP request body.

type CreateResponseBody

type CreateResponseBody struct {
	// Workspace name
	Name string `form:"name" json:"name" xml:"name"`
	// Kubernetes namespace
	Namespace string `form:"namespace" json:"namespace" xml:"namespace"`
	// Workspace type: container, vm, or scratch
	Type string `form:"type" json:"type" xml:"type"`
	// Container image
	Image string `form:"image" json:"image" xml:"image"`
	// Container port
	Port *int `form:"port,omitempty" json:"port,omitempty" xml:"port,omitempty"`
	// CPU request
	CPURequest *string `form:"cpu_request,omitempty" json:"cpu_request,omitempty" xml:"cpu_request,omitempty"`
	// Memory request
	MemoryRequest *string `form:"memory_request,omitempty" json:"memory_request,omitempty" xml:"memory_request,omitempty"`
	// CPU limit
	CPULimit *string `form:"cpu_limit,omitempty" json:"cpu_limit,omitempty" xml:"cpu_limit,omitempty"`
	// Memory limit
	MemoryLimit *string `form:"memory_limit,omitempty" json:"memory_limit,omitempty" xml:"memory_limit,omitempty"`
	// Number of ready replicas
	ReadyReplicas int `form:"ready_replicas" json:"ready_replicas" xml:"ready_replicas"`
	// Container state
	ContainerState *ContainerStateResponseBody `form:"container_state,omitempty" json:"container_state,omitempty" xml:"container_state,omitempty"`
	// Workspace conditions
	Conditions []*WorkspaceConditionResponseBody `form:"conditions,omitempty" json:"conditions,omitempty" xml:"conditions,omitempty"`
	// Whether the workspace is stopped
	Stopped bool `form:"stopped" json:"stopped" xml:"stopped"`
	// Creation timestamp
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	// Attached volumes
	VolumeMounts []*VolumeMountResponseBody `form:"volume_mounts,omitempty" json:"volume_mounts,omitempty" xml:"volume_mounts,omitempty"`
}

CreateResponseBody is the type of the "workspaces" service "create" endpoint HTTP response body.

func NewCreateResponseBody

func NewCreateResponseBody(res *workspacesviews.WorkspaceView) *CreateResponseBody

NewCreateResponseBody builds the HTTP response body from the result of the "create" endpoint of the "workspaces" service.

type EnvVarRequestBody

type EnvVarRequestBody struct {
	// Environment variable name
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Environment variable value
	Value *string `form:"value,omitempty" json:"value,omitempty" xml:"value,omitempty"`
}

EnvVarRequestBody is used to define fields on request body types.

type GetResponseBody

type GetResponseBody struct {
	// Workspace name
	Name string `form:"name" json:"name" xml:"name"`
	// Kubernetes namespace
	Namespace string `form:"namespace" json:"namespace" xml:"namespace"`
	// Workspace type: container, vm, or scratch
	Type string `form:"type" json:"type" xml:"type"`
	// Container image
	Image string `form:"image" json:"image" xml:"image"`
	// Container port
	Port *int `form:"port,omitempty" json:"port,omitempty" xml:"port,omitempty"`
	// CPU request
	CPURequest *string `form:"cpu_request,omitempty" json:"cpu_request,omitempty" xml:"cpu_request,omitempty"`
	// Memory request
	MemoryRequest *string `form:"memory_request,omitempty" json:"memory_request,omitempty" xml:"memory_request,omitempty"`
	// CPU limit
	CPULimit *string `form:"cpu_limit,omitempty" json:"cpu_limit,omitempty" xml:"cpu_limit,omitempty"`
	// Memory limit
	MemoryLimit *string `form:"memory_limit,omitempty" json:"memory_limit,omitempty" xml:"memory_limit,omitempty"`
	// Number of ready replicas
	ReadyReplicas int `form:"ready_replicas" json:"ready_replicas" xml:"ready_replicas"`
	// Container state
	ContainerState *ContainerStateResponseBody `form:"container_state,omitempty" json:"container_state,omitempty" xml:"container_state,omitempty"`
	// Workspace conditions
	Conditions []*WorkspaceConditionResponseBody `form:"conditions,omitempty" json:"conditions,omitempty" xml:"conditions,omitempty"`
	// Whether the workspace is stopped
	Stopped bool `form:"stopped" json:"stopped" xml:"stopped"`
	// Creation timestamp
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	// Attached volumes
	VolumeMounts []*VolumeMountResponseBody `form:"volume_mounts,omitempty" json:"volume_mounts,omitempty" xml:"volume_mounts,omitempty"`
}

GetResponseBody is the type of the "workspaces" service "get" endpoint HTTP response body.

func NewGetResponseBody

func NewGetResponseBody(res *workspacesviews.WorkspaceView) *GetResponseBody

NewGetResponseBody builds the HTTP response body from the result of the "get" endpoint of the "workspaces" service.

type ListResponseBody

type ListResponseBody []*WorkspaceResponse

ListResponseBody is the type of the "workspaces" service "list" endpoint HTTP response body.

func NewListResponseBody

func NewListResponseBody(res []*workspaces.Workspace) ListResponseBody

NewListResponseBody builds the HTTP response body from the result of the "list" endpoint of the "workspaces" service.

type MountPoint

type MountPoint struct {
	// Method is the name of the service method served by the mounted HTTP handler.
	Method string
	// Verb is the HTTP method used to match requests to the mounted handler.
	Verb string
	// Pattern is the HTTP request path pattern used to match requests to the
	// mounted handler.
	Pattern string
}

MountPoint holds information about the mounted endpoints.

type ResetResponseBody added in v0.4.0

type ResetResponseBody struct {
	// Workspace name
	Name string `form:"name" json:"name" xml:"name"`
	// Kubernetes namespace
	Namespace string `form:"namespace" json:"namespace" xml:"namespace"`
	// Workspace type: container, vm, or scratch
	Type string `form:"type" json:"type" xml:"type"`
	// Container image
	Image string `form:"image" json:"image" xml:"image"`
	// Container port
	Port *int `form:"port,omitempty" json:"port,omitempty" xml:"port,omitempty"`
	// CPU request
	CPURequest *string `form:"cpu_request,omitempty" json:"cpu_request,omitempty" xml:"cpu_request,omitempty"`
	// Memory request
	MemoryRequest *string `form:"memory_request,omitempty" json:"memory_request,omitempty" xml:"memory_request,omitempty"`
	// CPU limit
	CPULimit *string `form:"cpu_limit,omitempty" json:"cpu_limit,omitempty" xml:"cpu_limit,omitempty"`
	// Memory limit
	MemoryLimit *string `form:"memory_limit,omitempty" json:"memory_limit,omitempty" xml:"memory_limit,omitempty"`
	// Number of ready replicas
	ReadyReplicas int `form:"ready_replicas" json:"ready_replicas" xml:"ready_replicas"`
	// Container state
	ContainerState *ContainerStateResponseBody `form:"container_state,omitempty" json:"container_state,omitempty" xml:"container_state,omitempty"`
	// Workspace conditions
	Conditions []*WorkspaceConditionResponseBody `form:"conditions,omitempty" json:"conditions,omitempty" xml:"conditions,omitempty"`
	// Whether the workspace is stopped
	Stopped bool `form:"stopped" json:"stopped" xml:"stopped"`
	// Creation timestamp
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	// Attached volumes
	VolumeMounts []*VolumeMountResponseBody `form:"volume_mounts,omitempty" json:"volume_mounts,omitempty" xml:"volume_mounts,omitempty"`
}

ResetResponseBody is the type of the "workspaces" service "reset" endpoint HTTP response body.

func NewResetResponseBody added in v0.4.0

func NewResetResponseBody(res *workspacesviews.WorkspaceView) *ResetResponseBody

NewResetResponseBody builds the HTTP response body from the result of the "reset" endpoint of the "workspaces" service.

type Server

type Server struct {
	Mounts []*MountPoint
	List   http.Handler
	Get    http.Handler
	Create http.Handler
	Delete http.Handler
	Start  http.Handler
	Stop   http.Handler
	Reset  http.Handler
}

Server lists the workspaces service endpoint HTTP handlers.

func New

func New(
	e *workspaces.Endpoints,
	mux goahttp.Muxer,
	decoder func(*http.Request) goahttp.Decoder,
	encoder func(context.Context, http.ResponseWriter) goahttp.Encoder,
	errhandler func(context.Context, http.ResponseWriter, error),
	formatter func(ctx context.Context, err error) goahttp.Statuser,
) *Server

New instantiates HTTP handlers for all the workspaces service endpoints using the provided encoder and decoder. The handlers are mounted on the given mux using the HTTP verb and path defined in the design. errhandler is called whenever a response fails to be encoded. formatter is used to format errors returned by the service methods prior to encoding. Both errhandler and formatter are optional and can be nil.

func (*Server) MethodNames

func (s *Server) MethodNames() []string

MethodNames returns the methods served.

func (*Server) Mount

func (s *Server) Mount(mux goahttp.Muxer)

Mount configures the mux to serve the workspaces endpoints.

func (*Server) Service

func (s *Server) Service() string

Service returns the name of the service served.

func (*Server) Use

func (s *Server) Use(m func(http.Handler) http.Handler)

Use wraps the server handlers with the given middleware.

type StartResponseBody

type StartResponseBody struct {
	// Workspace name
	Name string `form:"name" json:"name" xml:"name"`
	// Kubernetes namespace
	Namespace string `form:"namespace" json:"namespace" xml:"namespace"`
	// Workspace type: container, vm, or scratch
	Type string `form:"type" json:"type" xml:"type"`
	// Container image
	Image string `form:"image" json:"image" xml:"image"`
	// Container port
	Port *int `form:"port,omitempty" json:"port,omitempty" xml:"port,omitempty"`
	// CPU request
	CPURequest *string `form:"cpu_request,omitempty" json:"cpu_request,omitempty" xml:"cpu_request,omitempty"`
	// Memory request
	MemoryRequest *string `form:"memory_request,omitempty" json:"memory_request,omitempty" xml:"memory_request,omitempty"`
	// CPU limit
	CPULimit *string `form:"cpu_limit,omitempty" json:"cpu_limit,omitempty" xml:"cpu_limit,omitempty"`
	// Memory limit
	MemoryLimit *string `form:"memory_limit,omitempty" json:"memory_limit,omitempty" xml:"memory_limit,omitempty"`
	// Number of ready replicas
	ReadyReplicas int `form:"ready_replicas" json:"ready_replicas" xml:"ready_replicas"`
	// Container state
	ContainerState *ContainerStateResponseBody `form:"container_state,omitempty" json:"container_state,omitempty" xml:"container_state,omitempty"`
	// Workspace conditions
	Conditions []*WorkspaceConditionResponseBody `form:"conditions,omitempty" json:"conditions,omitempty" xml:"conditions,omitempty"`
	// Whether the workspace is stopped
	Stopped bool `form:"stopped" json:"stopped" xml:"stopped"`
	// Creation timestamp
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	// Attached volumes
	VolumeMounts []*VolumeMountResponseBody `form:"volume_mounts,omitempty" json:"volume_mounts,omitempty" xml:"volume_mounts,omitempty"`
}

StartResponseBody is the type of the "workspaces" service "start" endpoint HTTP response body.

func NewStartResponseBody

func NewStartResponseBody(res *workspacesviews.WorkspaceView) *StartResponseBody

NewStartResponseBody builds the HTTP response body from the result of the "start" endpoint of the "workspaces" service.

type StopResponseBody

type StopResponseBody struct {
	// Workspace name
	Name string `form:"name" json:"name" xml:"name"`
	// Kubernetes namespace
	Namespace string `form:"namespace" json:"namespace" xml:"namespace"`
	// Workspace type: container, vm, or scratch
	Type string `form:"type" json:"type" xml:"type"`
	// Container image
	Image string `form:"image" json:"image" xml:"image"`
	// Container port
	Port *int `form:"port,omitempty" json:"port,omitempty" xml:"port,omitempty"`
	// CPU request
	CPURequest *string `form:"cpu_request,omitempty" json:"cpu_request,omitempty" xml:"cpu_request,omitempty"`
	// Memory request
	MemoryRequest *string `form:"memory_request,omitempty" json:"memory_request,omitempty" xml:"memory_request,omitempty"`
	// CPU limit
	CPULimit *string `form:"cpu_limit,omitempty" json:"cpu_limit,omitempty" xml:"cpu_limit,omitempty"`
	// Memory limit
	MemoryLimit *string `form:"memory_limit,omitempty" json:"memory_limit,omitempty" xml:"memory_limit,omitempty"`
	// Number of ready replicas
	ReadyReplicas int `form:"ready_replicas" json:"ready_replicas" xml:"ready_replicas"`
	// Container state
	ContainerState *ContainerStateResponseBody `form:"container_state,omitempty" json:"container_state,omitempty" xml:"container_state,omitempty"`
	// Workspace conditions
	Conditions []*WorkspaceConditionResponseBody `form:"conditions,omitempty" json:"conditions,omitempty" xml:"conditions,omitempty"`
	// Whether the workspace is stopped
	Stopped bool `form:"stopped" json:"stopped" xml:"stopped"`
	// Creation timestamp
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	// Attached volumes
	VolumeMounts []*VolumeMountResponseBody `form:"volume_mounts,omitempty" json:"volume_mounts,omitempty" xml:"volume_mounts,omitempty"`
}

StopResponseBody is the type of the "workspaces" service "stop" endpoint HTTP response body.

func NewStopResponseBody

func NewStopResponseBody(res *workspacesviews.WorkspaceView) *StopResponseBody

NewStopResponseBody builds the HTTP response body from the result of the "stop" endpoint of the "workspaces" service.

type TolerationRequestBody

type TolerationRequestBody struct {
	// Toleration key
	Key *string `form:"key,omitempty" json:"key,omitempty" xml:"key,omitempty"`
	// Operator: Exists or Equal
	Operator *string `form:"operator,omitempty" json:"operator,omitempty" xml:"operator,omitempty"`
	// Toleration value
	Value *string `form:"value,omitempty" json:"value,omitempty" xml:"value,omitempty"`
	// Taint effect: NoSchedule, PreferNoSchedule, or NoExecute
	Effect *string `form:"effect,omitempty" json:"effect,omitempty" xml:"effect,omitempty"`
}

TolerationRequestBody is used to define fields on request body types.

type VolumeMountRequestBody

type VolumeMountRequestBody struct {
	// Volume/PVC name
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Mount path in container
	MountPath *string `form:"mount_path,omitempty" json:"mount_path,omitempty" xml:"mount_path,omitempty"`
}

VolumeMountRequestBody is used to define fields on request body types.

type VolumeMountResponse

type VolumeMountResponse struct {
	// Volume/PVC name
	Name string `form:"name" json:"name" xml:"name"`
	// Mount path in container
	MountPath string `form:"mount_path" json:"mount_path" xml:"mount_path"`
}

VolumeMountResponse is used to define fields on response body types.

type VolumeMountResponseBody

type VolumeMountResponseBody struct {
	// Volume/PVC name
	Name string `form:"name" json:"name" xml:"name"`
	// Mount path in container
	MountPath string `form:"mount_path" json:"mount_path" xml:"mount_path"`
}

VolumeMountResponseBody is used to define fields on response body types.

type WorkspaceConditionResponse

type WorkspaceConditionResponse struct {
	// Condition type
	Type *string `form:"type,omitempty" json:"type,omitempty" xml:"type,omitempty"`
	// Condition status
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// Brief reason
	Reason *string `form:"reason,omitempty" json:"reason,omitempty" xml:"reason,omitempty"`
	// Detailed message
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Last transition time
	LastTransitionTime *string `form:"last_transition_time,omitempty" json:"last_transition_time,omitempty" xml:"last_transition_time,omitempty"`
}

WorkspaceConditionResponse is used to define fields on response body types.

type WorkspaceConditionResponseBody

type WorkspaceConditionResponseBody struct {
	// Condition type
	Type *string `form:"type,omitempty" json:"type,omitempty" xml:"type,omitempty"`
	// Condition status
	Status *string `form:"status,omitempty" json:"status,omitempty" xml:"status,omitempty"`
	// Brief reason
	Reason *string `form:"reason,omitempty" json:"reason,omitempty" xml:"reason,omitempty"`
	// Detailed message
	Message *string `form:"message,omitempty" json:"message,omitempty" xml:"message,omitempty"`
	// Last transition time
	LastTransitionTime *string `form:"last_transition_time,omitempty" json:"last_transition_time,omitempty" xml:"last_transition_time,omitempty"`
}

WorkspaceConditionResponseBody is used to define fields on response body types.

type WorkspaceContainerRequestBody

type WorkspaceContainerRequestBody struct {
	// Container name
	Name *string `form:"name,omitempty" json:"name,omitempty" xml:"name,omitempty"`
	// Container image
	Image *string `form:"image,omitempty" json:"image,omitempty" xml:"image,omitempty"`
	// Container port
	Port *int `form:"port,omitempty" json:"port,omitempty" xml:"port,omitempty"`
	// CPU request
	CPURequest *string `form:"cpu_request,omitempty" json:"cpu_request,omitempty" xml:"cpu_request,omitempty"`
	// Memory request
	MemoryRequest *string `form:"memory_request,omitempty" json:"memory_request,omitempty" xml:"memory_request,omitempty"`
	// CPU limit
	CPULimit *string `form:"cpu_limit,omitempty" json:"cpu_limit,omitempty" xml:"cpu_limit,omitempty"`
	// Memory limit
	MemoryLimit *string `form:"memory_limit,omitempty" json:"memory_limit,omitempty" xml:"memory_limit,omitempty"`
	// GPU resource request count (e.g. "1")
	GpuRequest *string `form:"gpu_request,omitempty" json:"gpu_request,omitempty" xml:"gpu_request,omitempty"`
	// GPU vendor resource name (e.g. nvidia.com/gpu, amd.com/gpu)
	GpuVendor *string `form:"gpu_vendor,omitempty" json:"gpu_vendor,omitempty" xml:"gpu_vendor,omitempty"`
}

WorkspaceContainerRequestBody is used to define fields on request body types.

type WorkspaceResponse

type WorkspaceResponse struct {
	// Workspace name
	Name string `form:"name" json:"name" xml:"name"`
	// Kubernetes namespace
	Namespace string `form:"namespace" json:"namespace" xml:"namespace"`
	// Workspace type: container, vm, or scratch
	Type string `form:"type" json:"type" xml:"type"`
	// Container image
	Image string `form:"image" json:"image" xml:"image"`
	// Container port
	Port *int `form:"port,omitempty" json:"port,omitempty" xml:"port,omitempty"`
	// CPU request
	CPURequest *string `form:"cpu_request,omitempty" json:"cpu_request,omitempty" xml:"cpu_request,omitempty"`
	// Memory request
	MemoryRequest *string `form:"memory_request,omitempty" json:"memory_request,omitempty" xml:"memory_request,omitempty"`
	// CPU limit
	CPULimit *string `form:"cpu_limit,omitempty" json:"cpu_limit,omitempty" xml:"cpu_limit,omitempty"`
	// Memory limit
	MemoryLimit *string `form:"memory_limit,omitempty" json:"memory_limit,omitempty" xml:"memory_limit,omitempty"`
	// Number of ready replicas
	ReadyReplicas int `form:"ready_replicas" json:"ready_replicas" xml:"ready_replicas"`
	// Container state
	ContainerState *ContainerStateResponse `form:"container_state,omitempty" json:"container_state,omitempty" xml:"container_state,omitempty"`
	// Workspace conditions
	Conditions []*WorkspaceConditionResponse `form:"conditions,omitempty" json:"conditions,omitempty" xml:"conditions,omitempty"`
	// Whether the workspace is stopped
	Stopped bool `form:"stopped" json:"stopped" xml:"stopped"`
	// Creation timestamp
	CreatedAt *string `form:"created_at,omitempty" json:"created_at,omitempty" xml:"created_at,omitempty"`
	// Attached volumes
	VolumeMounts []*VolumeMountResponse `form:"volume_mounts,omitempty" json:"volume_mounts,omitempty" xml:"volume_mounts,omitempty"`
}

WorkspaceResponse is used to define fields on response body types.

Jump to

Keyboard shortcuts

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