Documentation
¶
Index ¶
- Constants
- Variables
- type AWSInstanceIdentityToken
- type Client
- func (c *Client) AuthWorkspaceAWSInstanceIdentity(ctx context.Context) (WorkspaceAgentAuthenticateResponse, error)
- func (c *Client) AuthWorkspaceGoogleInstanceIdentity(ctx context.Context, serviceAccount string, gcpClient *metadata.Client) (WorkspaceAgentAuthenticateResponse, error)
- func (c *Client) CancelProjectVersion(ctx context.Context, version uuid.UUID) error
- func (c *Client) CancelWorkspaceBuild(ctx context.Context, id uuid.UUID) error
- func (c *Client) CreateAPIKey(ctx context.Context, userID uuid.UUID) (*GenerateAPIKeyResponse, error)
- func (c *Client) CreateFirstUser(ctx context.Context, req CreateFirstUserRequest) (CreateFirstUserResponse, error)
- func (c *Client) CreateOrganization(ctx context.Context, userID uuid.UUID, req CreateOrganizationRequest) (Organization, error)
- func (c *Client) CreateParameter(ctx context.Context, scope ParameterScope, id uuid.UUID, ...) (Parameter, error)
- func (c *Client) CreateProject(ctx context.Context, organizationID uuid.UUID, request CreateProjectRequest) (Project, error)
- func (c *Client) CreateProjectVersion(ctx context.Context, organizationID uuid.UUID, req CreateProjectVersionRequest) (ProjectVersion, error)
- func (c *Client) CreateUser(ctx context.Context, req CreateUserRequest) (User, error)
- func (c *Client) CreateWorkspace(ctx context.Context, userID uuid.UUID, request CreateWorkspaceRequest) (Workspace, error)
- func (c *Client) CreateWorkspaceBuild(ctx context.Context, workspace uuid.UUID, request CreateWorkspaceBuildRequest) (WorkspaceBuild, error)
- func (c *Client) DeleteParameter(ctx context.Context, scope ParameterScope, id uuid.UUID, name string) error
- func (c *Client) DeleteProject(ctx context.Context, project uuid.UUID) error
- func (c *Client) DialWorkspaceAgent(ctx context.Context, resource uuid.UUID, iceServers []webrtc.ICEServer, ...) (*agent.Conn, error)
- func (c *Client) Download(ctx context.Context, hash string) ([]byte, string, error)
- func (c *Client) HasFirstUser(ctx context.Context) (bool, error)
- func (c *Client) ListenProvisionerDaemon(ctx context.Context) (proto.DRPCProvisionerDaemonClient, error)
- func (c *Client) ListenWorkspaceAgent(ctx context.Context, opts *peer.ConnOptions) (*peerbroker.Listener, error)
- func (c *Client) LoginWithPassword(ctx context.Context, req LoginWithPasswordRequest) (LoginWithPasswordResponse, error)
- func (c *Client) Logout(ctx context.Context) error
- func (c *Client) Organization(ctx context.Context, id uuid.UUID) (Organization, error)
- func (c *Client) OrganizationByName(ctx context.Context, userID uuid.UUID, name string) (Organization, error)
- func (c *Client) OrganizationsByUser(ctx context.Context, userID uuid.UUID) ([]Organization, error)
- func (c *Client) Parameters(ctx context.Context, scope ParameterScope, id uuid.UUID) ([]Parameter, error)
- func (c *Client) Project(ctx context.Context, project uuid.UUID) (Project, error)
- func (c *Client) ProjectByName(ctx context.Context, organizationID uuid.UUID, name string) (Project, error)
- func (c *Client) ProjectVersion(ctx context.Context, id uuid.UUID) (ProjectVersion, error)
- func (c *Client) ProjectVersionByName(ctx context.Context, project uuid.UUID, name string) (ProjectVersion, error)
- func (c *Client) ProjectVersionLogsAfter(ctx context.Context, version uuid.UUID, after time.Time) (<-chan ProvisionerJobLog, error)
- func (c *Client) ProjectVersionLogsBefore(ctx context.Context, version uuid.UUID, before time.Time) ([]ProvisionerJobLog, error)
- func (c *Client) ProjectVersionParameters(ctx context.Context, version uuid.UUID) ([]ProjectVersionParameter, error)
- func (c *Client) ProjectVersionResources(ctx context.Context, version uuid.UUID) ([]WorkspaceResource, error)
- func (c *Client) ProjectVersionSchema(ctx context.Context, version uuid.UUID) ([]ProjectVersionParameterSchema, error)
- func (c *Client) ProjectVersionsByProject(ctx context.Context, project uuid.UUID) ([]ProjectVersion, error)
- func (c *Client) ProjectsByOrganization(ctx context.Context, organizationID uuid.UUID) ([]Project, error)
- func (c *Client) ProvisionerDaemonsByOrganization(ctx context.Context, organizationID uuid.UUID) ([]ProvisionerDaemon, error)
- func (c *Client) UpdateActiveProjectVersion(ctx context.Context, project uuid.UUID, req UpdateActiveProjectVersion) error
- func (c *Client) Upload(ctx context.Context, contentType string, content []byte) (UploadResponse, error)
- func (c *Client) User(ctx context.Context, id uuid.UUID) (User, error)
- func (c *Client) Workspace(ctx context.Context, id uuid.UUID) (Workspace, error)
- func (c *Client) WorkspaceBuild(ctx context.Context, id uuid.UUID) (WorkspaceBuild, error)
- func (c *Client) WorkspaceBuildByName(ctx context.Context, workspace uuid.UUID, name string) (WorkspaceBuild, error)
- func (c *Client) WorkspaceBuildLogsAfter(ctx context.Context, build uuid.UUID, after time.Time) (<-chan ProvisionerJobLog, error)
- func (c *Client) WorkspaceBuildLogsBefore(ctx context.Context, build uuid.UUID, before time.Time) ([]ProvisionerJobLog, error)
- func (c *Client) WorkspaceBuilds(ctx context.Context, workspace uuid.UUID) ([]WorkspaceBuild, error)
- func (c *Client) WorkspaceByName(ctx context.Context, userID uuid.UUID, name string) (Workspace, error)
- func (c *Client) WorkspaceResource(ctx context.Context, id uuid.UUID) (WorkspaceResource, error)
- func (c *Client) WorkspaceResourcesByBuild(ctx context.Context, build uuid.UUID) ([]WorkspaceResource, error)
- func (c *Client) WorkspacesByUser(ctx context.Context, userID uuid.UUID) ([]Workspace, error)
- type CreateFirstUserRequest
- type CreateFirstUserResponse
- type CreateOrganizationRequest
- type CreateParameterRequest
- type CreateProjectRequest
- type CreateProjectVersionRequest
- type CreateUserRequest
- type CreateWorkspaceBuildRequest
- type CreateWorkspaceRequest
- type Error
- type GenerateAPIKeyResponse
- type GoogleInstanceIdentityToken
- type LoginWithPasswordRequest
- type LoginWithPasswordResponse
- type Organization
- type Parameter
- type ParameterScope
- type Project
- type ProjectVersion
- type ProjectVersionParameter
- type ProjectVersionParameterSchema
- type ProvisionerDaemon
- type ProvisionerJob
- type ProvisionerJobLog
- type ProvisionerJobStatus
- type UpdateActiveProjectVersion
- type UploadResponse
- type User
- type Workspace
- type WorkspaceAgent
- type WorkspaceAgentAuthenticateResponse
- type WorkspaceAgentInstanceMetadata
- type WorkspaceAgentResourceMetadata
- type WorkspaceAgentStatus
- type WorkspaceBuild
- type WorkspaceResource
Constants ¶
const (
ContentTypeTar = "application/x-tar"
)
Variables ¶
var Me = uuid.Nil
Me is used as a replacement for your own ID.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client is an HTTP caller for methods to the Coder API.
func (*Client) AuthWorkspaceAWSInstanceIdentity ¶
func (c *Client) AuthWorkspaceAWSInstanceIdentity(ctx context.Context) (WorkspaceAgentAuthenticateResponse, error)
AuthWorkspaceAWSInstanceIdentity uses the Amazon Metadata API to fetch a signed payload, and exchange it for a session token for a workspace agent.
The requesting instance must be registered as a resource in the latest history for a workspace.
func (*Client) AuthWorkspaceGoogleInstanceIdentity ¶
func (c *Client) AuthWorkspaceGoogleInstanceIdentity(ctx context.Context, serviceAccount string, gcpClient *metadata.Client) (WorkspaceAgentAuthenticateResponse, error)
AuthWorkspaceGoogleInstanceIdentity uses the Google Compute Engine Metadata API to fetch a signed JWT, and exchange it for a session token for a workspace agent.
The requesting instance must be registered as a resource in the latest history for a workspace.
func (*Client) CancelProjectVersion ¶
CancelProjectVersion marks a project version job as canceled.
func (*Client) CancelWorkspaceBuild ¶
CancelWorkspaceBuild marks a workspace build job as canceled.
func (*Client) CreateAPIKey ¶
func (c *Client) CreateAPIKey(ctx context.Context, userID uuid.UUID) (*GenerateAPIKeyResponse, error)
CreateAPIKey generates an API key for the user ID provided.
func (*Client) CreateFirstUser ¶
func (c *Client) CreateFirstUser(ctx context.Context, req CreateFirstUserRequest) (CreateFirstUserResponse, error)
CreateFirstUser attempts to create the first user on a Coder deployment. This initial user has superadmin privileges. If >0 users exist, this request will fail.
func (*Client) CreateOrganization ¶
func (c *Client) CreateOrganization(ctx context.Context, userID uuid.UUID, req CreateOrganizationRequest) (Organization, error)
CreateOrganization creates an organization and adds the provided user as an admin.
func (*Client) CreateParameter ¶
func (c *Client) CreateParameter(ctx context.Context, scope ParameterScope, id uuid.UUID, req CreateParameterRequest) (Parameter, error)
func (*Client) CreateProject ¶
func (c *Client) CreateProject(ctx context.Context, organizationID uuid.UUID, request CreateProjectRequest) (Project, error)
CreateProject creates a new project inside an organization.
func (*Client) CreateProjectVersion ¶
func (c *Client) CreateProjectVersion(ctx context.Context, organizationID uuid.UUID, req CreateProjectVersionRequest) (ProjectVersion, error)
CreateProjectVersion processes source-code and optionally associates the version with a project. Executing without a project is useful for validating source-code.
func (*Client) CreateUser ¶
CreateUser creates a new user.
func (*Client) CreateWorkspace ¶
func (c *Client) CreateWorkspace(ctx context.Context, userID uuid.UUID, request CreateWorkspaceRequest) (Workspace, error)
CreateWorkspace creates a new workspace for the project specified.
func (*Client) CreateWorkspaceBuild ¶
func (c *Client) CreateWorkspaceBuild(ctx context.Context, workspace uuid.UUID, request CreateWorkspaceBuildRequest) (WorkspaceBuild, error)
CreateWorkspaceBuild queues a new build to occur for a workspace.
func (*Client) DeleteParameter ¶
func (*Client) DeleteProject ¶
func (*Client) DialWorkspaceAgent ¶
func (c *Client) DialWorkspaceAgent(ctx context.Context, resource uuid.UUID, iceServers []webrtc.ICEServer, opts *peer.ConnOptions) (*agent.Conn, error)
DialWorkspaceAgent creates a connection to the specified resource.
func (*Client) HasFirstUser ¶
HasFirstUser returns whether the first user has been created.
func (*Client) ListenProvisionerDaemon ¶
func (c *Client) ListenProvisionerDaemon(ctx context.Context) (proto.DRPCProvisionerDaemonClient, error)
ListenProvisionerDaemon returns the gRPC service for a provisioner daemon implementation.
func (*Client) ListenWorkspaceAgent ¶
func (c *Client) ListenWorkspaceAgent(ctx context.Context, opts *peer.ConnOptions) (*peerbroker.Listener, error)
ListenWorkspaceAgent connects as a workspace agent. It obtains the agent ID based off the session token.
func (*Client) LoginWithPassword ¶
func (c *Client) LoginWithPassword(ctx context.Context, req LoginWithPasswordRequest) (LoginWithPasswordResponse, error)
LoginWithPassword creates a session token authenticating with an email and password. Call `SetSessionToken()` to apply the newly acquired token to the client.
func (*Client) Logout ¶
Logout calls the /logout API Call `ClearSessionToken()` to clear the session token of the client.
func (*Client) Organization ¶
func (*Client) OrganizationByName ¶
func (*Client) OrganizationsByUser ¶
OrganizationsByUser returns all organizations the user is a member of.
func (*Client) Parameters ¶
func (*Client) ProjectByName ¶
func (c *Client) ProjectByName(ctx context.Context, organizationID uuid.UUID, name string) (Project, error)
ProjectByName finds a project inside the organization provided with a case-insensitive name.
func (*Client) ProjectVersion ¶
ProjectVersion returns a project version by ID.
func (*Client) ProjectVersionByName ¶
func (c *Client) ProjectVersionByName(ctx context.Context, project uuid.UUID, name string) (ProjectVersion, error)
ProjectVersionByName returns a project version by it's friendly name. This is used for path-based routing. Like: /projects/example/versions/helloworld
func (*Client) ProjectVersionLogsAfter ¶
func (c *Client) ProjectVersionLogsAfter(ctx context.Context, version uuid.UUID, after time.Time) (<-chan ProvisionerJobLog, error)
ProjectVersionLogsAfter streams logs for a project version that occurred after a specific time.
func (*Client) ProjectVersionLogsBefore ¶
func (c *Client) ProjectVersionLogsBefore(ctx context.Context, version uuid.UUID, before time.Time) ([]ProvisionerJobLog, error)
ProjectVersionLogsBefore returns logs that occurred before a specific time.
func (*Client) ProjectVersionParameters ¶
func (c *Client) ProjectVersionParameters(ctx context.Context, version uuid.UUID) ([]ProjectVersionParameter, error)
ProjectVersionParameters returns computed parameters for a project version.
func (*Client) ProjectVersionResources ¶
func (c *Client) ProjectVersionResources(ctx context.Context, version uuid.UUID) ([]WorkspaceResource, error)
ProjectVersionResources returns resources a project version declares.
func (*Client) ProjectVersionSchema ¶
func (c *Client) ProjectVersionSchema(ctx context.Context, version uuid.UUID) ([]ProjectVersionParameterSchema, error)
ProjectVersionSchema returns schemas for a project version by ID.
func (*Client) ProjectVersionsByProject ¶
func (c *Client) ProjectVersionsByProject(ctx context.Context, project uuid.UUID) ([]ProjectVersion, error)
ProjectVersionsByProject lists versions associated with a project.
func (*Client) ProjectsByOrganization ¶
func (c *Client) ProjectsByOrganization(ctx context.Context, organizationID uuid.UUID) ([]Project, error)
ProjectsByOrganization lists all projects inside of an organization.
func (*Client) ProvisionerDaemonsByOrganization ¶
func (c *Client) ProvisionerDaemonsByOrganization(ctx context.Context, organizationID uuid.UUID) ([]ProvisionerDaemon, error)
ProvisionerDaemonsByOrganization returns provisioner daemons available for an organization.
func (*Client) UpdateActiveProjectVersion ¶
func (c *Client) UpdateActiveProjectVersion(ctx context.Context, project uuid.UUID, req UpdateActiveProjectVersion) error
UpdateActiveProjectVersion updates the active project version to the ID provided. The project version must be attached to the project.
func (*Client) Upload ¶
func (c *Client) Upload(ctx context.Context, contentType string, content []byte) (UploadResponse, error)
Upload uploads an arbitrary file with the content type provided. This is used to upload a source-code archive.
func (*Client) User ¶
User returns a user for the ID provided. If the uuid is nil, the current user will be returned.
func (*Client) WorkspaceBuild ¶
WorkspaceBuild returns a single workspace build for a workspace. If history is "", the latest version is returned.
func (*Client) WorkspaceBuildByName ¶
func (*Client) WorkspaceBuildLogsAfter ¶
func (c *Client) WorkspaceBuildLogsAfter(ctx context.Context, build uuid.UUID, after time.Time) (<-chan ProvisionerJobLog, error)
WorkspaceBuildLogsAfter streams logs for a workspace build that occurred after a specific time.
func (*Client) WorkspaceBuildLogsBefore ¶
func (c *Client) WorkspaceBuildLogsBefore(ctx context.Context, build uuid.UUID, before time.Time) ([]ProvisionerJobLog, error)
WorkspaceBuildLogsBefore returns logs that occurred before a specific time.
func (*Client) WorkspaceBuilds ¶
func (*Client) WorkspaceByName ¶
func (*Client) WorkspaceResource ¶
func (*Client) WorkspaceResourcesByBuild ¶
func (c *Client) WorkspaceResourcesByBuild(ctx context.Context, build uuid.UUID) ([]WorkspaceResource, error)
WorkspaceResourcesByBuild returns resources for a workspace build.
type CreateFirstUserRequest ¶
type CreateFirstUserResponse ¶
type CreateFirstUserResponse struct {
UserID uuid.UUID `json:"user_id"`
OrganizationID uuid.UUID `json:"organization_id"`
}
CreateFirstUserResponse contains IDs for newly created user info.
type CreateOrganizationRequest ¶
type CreateOrganizationRequest struct {
Name string `json:"name" validate:"required,username"`
}
type CreateParameterRequest ¶
type CreateParameterRequest struct {
Name string `json:"name" validate:"required"`
SourceValue string `json:"source_value" validate:"required"`
SourceScheme database.ParameterSourceScheme `json:"source_scheme" validate:"oneof=data,required"`
DestinationScheme database.ParameterDestinationScheme `json:"destination_scheme" validate:"oneof=environment_variable provisioner_variable,required"`
}
CreateParameterRequest is used to create a new parameter value for a scope.
type CreateProjectRequest ¶
type CreateProjectRequest struct {
Name string `json:"name" validate:"username,required"`
// VersionID is an in-progress or completed job to use as
// an initial version of the project.
//
// This is required on creation to enable a user-flow of validating a
// project works. There is no reason the data-model cannot support
// empty projects, but it doesn't make sense for users.
VersionID uuid.UUID `json:"project_version_id" validate:"required"`
ParameterValues []CreateParameterRequest `json:"parameter_values"`
}
CreateProjectRequest provides options when creating a project.
type CreateProjectVersionRequest ¶
type CreateProjectVersionRequest struct {
// ProjectID optionally associates a version with a project.
ProjectID uuid.UUID `json:"project_id"`
StorageMethod database.ProvisionerStorageMethod `json:"storage_method" validate:"oneof=file,required"`
StorageSource string `json:"storage_source" validate:"required"`
Provisioner database.ProvisionerType `json:"provisioner" validate:"oneof=terraform echo,required"`
// ParameterValues allows for additional parameters to be provided
// during the dry-run provision stage.
ParameterValues []CreateParameterRequest `json:"parameter_values"`
}
CreateProjectVersionRequest enables callers to create a new Project Version.
type CreateUserRequest ¶
type CreateWorkspaceBuildRequest ¶
type CreateWorkspaceBuildRequest struct {
ProjectVersionID uuid.UUID `json:"project_version_id"`
Transition database.WorkspaceTransition `json:"transition" validate:"oneof=create start stop delete,required"`
DryRun bool `json:"dry_run"`
}
CreateWorkspaceBuildRequest provides options to update the latest workspace build.
type CreateWorkspaceRequest ¶
type CreateWorkspaceRequest struct {
ProjectID uuid.UUID `json:"project_id" validate:"required"`
Name string `json:"name" validate:"username,required"`
// ParameterValues allows for additional parameters to be provided
// during the initial provision.
ParameterValues []CreateParameterRequest `json:"parameter_values"`
}
CreateWorkspaceRequest provides options for creating a new workspace.
type Error ¶
Error represents an unaccepted or invalid request to the API.
func (*Error) StatusCode ¶
type GenerateAPIKeyResponse ¶
type GenerateAPIKeyResponse struct {
Key string `json:"key"`
}
GenerateAPIKeyResponse contains an API key for a user.
type GoogleInstanceIdentityToken ¶
type GoogleInstanceIdentityToken struct {
JSONWebToken string `json:"json_web_token" validate:"required"`
}
type LoginWithPasswordRequest ¶
type LoginWithPasswordRequest struct {
Email string `json:"email" validate:"required,email"`
Password string `json:"password" validate:"required"`
}
LoginWithPasswordRequest enables callers to authenticate with email and password.
type LoginWithPasswordResponse ¶
type LoginWithPasswordResponse struct {
SessionToken string `json:"session_token" validate:"required"`
}
LoginWithPasswordResponse contains a session token for the newly authenticated user.
type Organization ¶
type Organization struct {
ID uuid.UUID `json:"id" validate:"required"`
Name string `json:"name" validate:"required"`
CreatedAt time.Time `json:"created_at" validate:"required"`
UpdatedAt time.Time `json:"updated_at" validate:"required"`
}
Organization is the JSON representation of a Coder organization.
type Parameter ¶
type Parameter struct {
ID uuid.UUID `db:"id" json:"id"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
Scope ParameterScope `db:"scope" json:"scope"`
ScopeID uuid.UUID `db:"scope_id" json:"scope_id"`
Name string `db:"name" json:"name"`
SourceScheme database.ParameterSourceScheme `db:"source_scheme" json:"source_scheme"`
DestinationScheme database.ParameterDestinationScheme `db:"destination_scheme" json:"destination_scheme"`
}
Parameter represents a set value for the scope.
type ParameterScope ¶
type ParameterScope string
const ( ParameterOrganization ParameterScope = "organization" ParameterProject ParameterScope = "project" ParameterUser ParameterScope = "user" ParameterWorkspace ParameterScope = "workspace" )
type Project ¶
type Project struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
OrganizationID uuid.UUID `json:"organization_id"`
Name string `json:"name"`
Provisioner database.ProvisionerType `json:"provisioner"`
ActiveVersionID uuid.UUID `json:"active_version_id"`
WorkspaceOwnerCount uint32 `json:"workspace_owner_count"`
}
Project is the JSON representation of a Coder project. This type matches the database object for now, but is abstracted for ease of change later on.
type ProjectVersion ¶
type ProjectVersion struct {
ID uuid.UUID `json:"id"`
ProjectID *uuid.UUID `json:"project_id,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Name string `json:"name"`
Job ProvisionerJob `json:"job"`
}
ProjectVersion represents a single version of a project.
type ProjectVersionParameter ¶
type ProjectVersionParameter parameter.ComputedValue
ProjectVersionParameter represents a computed parameter value.
type ProjectVersionParameterSchema ¶
type ProjectVersionParameterSchema database.ParameterSchema
ProjectVersionParameterSchema represents a parameter parsed from project version source.
type ProvisionerDaemon ¶
type ProvisionerDaemon database.ProvisionerDaemon
type ProvisionerJob ¶
type ProvisionerJob struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
Error string `json:"error,omitempty"`
Status ProvisionerJobStatus `json:"status"`
WorkerID *uuid.UUID `json:"worker_id,omitempty"`
}
type ProvisionerJobLog ¶
type ProvisionerJobStatus ¶
type ProvisionerJobStatus string
ProvisionerJobStaus represents the at-time state of a job.
const ( ProvisionerJobPending ProvisionerJobStatus = "pending" ProvisionerJobRunning ProvisionerJobStatus = "running" ProvisionerJobSucceeded ProvisionerJobStatus = "succeeded" ProvisionerJobCanceling ProvisionerJobStatus = "canceling" ProvisionerJobCanceled ProvisionerJobStatus = "canceled" ProvisionerJobFailed ProvisionerJobStatus = "failed" )
type UploadResponse ¶
type UploadResponse struct {
Hash string `json:"hash"`
}
UploadResponse contains the hash to reference the uploaded file.
type User ¶
type User struct {
ID uuid.UUID `json:"id" validate:"required"`
Email string `json:"email" validate:"required"`
CreatedAt time.Time `json:"created_at" validate:"required"`
Username string `json:"username" validate:"required"`
}
User represents a user in Coder.
type Workspace ¶
type Workspace struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
OwnerID uuid.UUID `json:"owner_id"`
ProjectID uuid.UUID `json:"project_id"`
ProjectName string `json:"project_name"`
LatestBuild WorkspaceBuild `json:"latest_build"`
Outdated bool `json:"outdated"`
Name string `json:"name"`
}
Workspace is a per-user deployment of a project. It tracks project versions, and can be updated.
type WorkspaceAgent ¶
type WorkspaceAgent struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
FirstConnectedAt *time.Time `json:"first_connected_at,omitempty"`
LastConnectedAt *time.Time `json:"last_connected_at,omitempty"`
DisconnectedAt *time.Time `json:"disconnected_at,omitempty"`
Status WorkspaceAgentStatus `json:"status"`
ResourceID uuid.UUID `json:"resource_id"`
InstanceID string `json:"instance_id,omitempty"`
EnvironmentVariables map[string]string `json:"environment_variables"`
StartupScript string `json:"startup_script,omitempty"`
}
type WorkspaceAgentAuthenticateResponse ¶
type WorkspaceAgentAuthenticateResponse struct {
SessionToken string `json:"session_token"`
}
WorkspaceAgentAuthenticateResponse is returned when an instance ID has been exchanged for a session token.
type WorkspaceAgentInstanceMetadata ¶
type WorkspaceAgentInstanceMetadata struct {
JailOrchestrator string `json:"jail_orchestrator"`
OperatingSystem string `json:"operating_system"`
Platform string `json:"platform"`
PlatformFamily string `json:"platform_family"`
KernelVersion string `json:"kernel_version"`
KernelArchitecture string `json:"kernel_architecture"`
Cloud string `json:"cloud"`
Jail string `json:"jail"`
VNC bool `json:"vnc"`
}
type WorkspaceAgentStatus ¶
type WorkspaceAgentStatus string
const ( WorkspaceAgentWaiting WorkspaceAgentStatus = "waiting" WorkspaceAgentConnected WorkspaceAgentStatus = "connected" WorkspaceAgentDisconnected WorkspaceAgentStatus = "disconnected" )
type WorkspaceBuild ¶
type WorkspaceBuild struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
WorkspaceID uuid.UUID `json:"workspace_id"`
ProjectVersionID uuid.UUID `json:"project_version_id"`
BeforeID uuid.UUID `json:"before_id"`
AfterID uuid.UUID `json:"after_id"`
Name string `json:"name"`
Transition database.WorkspaceTransition `json:"transition"`
InitiatorID uuid.UUID `json:"initiator_id"`
Job ProvisionerJob `json:"job"`
}
WorkspaceBuild is an at-point representation of a workspace state. Iterate on before/after to determine a chronological history.
type WorkspaceResource ¶
type WorkspaceResource struct {
ID uuid.UUID `json:"id"`
CreatedAt time.Time `json:"created_at"`
JobID uuid.UUID `json:"job_id"`
Transition database.WorkspaceTransition `json:"workspace_transition"`
Address string `json:"address"`
Type string `json:"type"`
Name string `json:"name"`
Agent *WorkspaceAgent `json:"agent,omitempty"`
}