Movatterモバイル変換


[0]ホーム

URL:


Alert GO-2024-3228: Coder vulnerable to post-auth URL redirection to untrusted site ('Open Redirect') in github.com/coder/coder
Notice  The highest tagged major version isv2.

database

package
v0.27.3Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License:AGPL-3.0Imports:19Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Overview

Package database connects to external services for stateful storage.

Query functions are generated using sqlc.

To modify the database schema:1. Add a new migration using "create_migration.sh" in database/migrations/2. Run "make coderd/database/generate" in the root to generate models.3. Add/Edit queries in "query.sql" and run "make coderd/database/generate" to create Go code.

Code generated by gen/enum. DO NOT EDIT.

Index

Constants

View Source
const AllUsersGroup = "Everyone"
View Source
const (LockIDDeploymentSetup)

Well-known lock IDs for lock functions in the database. These should notchange. If locks are deprecated, they should be kept in this list to avoidreusing the same ID.

Variables

This section is empty.

Functions

funcGenLockIDadded inv0.25.0

func GenLockID(namestring)int64

GenLockID generates a unique and consistent lock ID from a given string.

funcIsQueryCanceledErroradded inv0.18.0

func IsQueryCanceledError(errerror)bool

IsQueryCanceledError checks if the error is due to a query being canceled.

funcIsSerializedErroradded inv0.20.1

func IsSerializedError(errerror)bool

funcIsStartupLogsLimitErroradded inv0.21.0

func IsStartupLogsLimitError(errerror)bool

funcIsUniqueViolationadded inv0.8.7

func IsUniqueViolation(errerror, uniqueConstraints ...UniqueConstraint)bool

IsUniqueViolation checks if the error is due to a unique violation.If one or more specific unique constraints are given as arguments,the error must be caused by one of them. If no constraints are given,this function returns true for any unique violation.

funcNow

func Now()time.Time

Now returns a standardized timezone used for database resources.

funcTimeadded inv0.8.12

func Time(ttime.Time)time.Time

Time returns a time compatible with Postgres. Postgres only stores dates withmicrosecond precision.

Types

typeAPIKey

type APIKey struct {IDstring `db:"id" json:"id"`// hashed_secret contains a SHA256 hash of the key secret. This is considered a secret and MUST NOT be returned from the API as it is used for API key encryption in app proxying code.HashedSecret    []byte      `db:"hashed_secret" json:"hashed_secret"`UserIDuuid.UUID   `db:"user_id" json:"user_id"`LastUsedtime.Time   `db:"last_used" json:"last_used"`ExpiresAttime.Time   `db:"expires_at" json:"expires_at"`CreatedAttime.Time   `db:"created_at" json:"created_at"`UpdatedAttime.Time   `db:"updated_at" json:"updated_at"`LoginTypeLoginType   `db:"login_type" json:"login_type"`LifetimeSecondsint64       `db:"lifetime_seconds" json:"lifetime_seconds"`IPAddresspqtype.Inet `db:"ip_address" json:"ip_address"`ScopeAPIKeyScope `db:"scope" json:"scope"`TokenNamestring      `db:"token_name" json:"token_name"`}

func (APIKey)RBACObjectadded inv0.15.1

func (kAPIKey) RBACObject()rbac.Object

typeAPIKeyScopeadded inv0.9.0

type APIKeyScopestring
const (APIKeyScopeAllAPIKeyScope = "all"APIKeyScopeApplicationConnectAPIKeyScope = "application_connect")

funcAllAPIKeyScopeValuesadded inv0.15.2

func AllAPIKeyScopeValues() []APIKeyScope

func (*APIKeyScope)Scanadded inv0.9.0

func (e *APIKeyScope) Scan(src interface{})error

func (APIKeyScope)ToRBACadded inv0.9.0

func (sAPIKeyScope) ToRBAC()rbac.ScopeName

func (APIKeyScope)Validadded inv0.15.2

func (eAPIKeyScope) Valid()bool

typeAcquireProvisionerJobParams

type AcquireProvisionerJobParams struct {StartedAtsql.NullTime      `db:"started_at" json:"started_at"`WorkerIDuuid.NullUUID     `db:"worker_id" json:"worker_id"`Types     []ProvisionerType `db:"types" json:"types"`Tagsjson.RawMessage   `db:"tags" json:"tags"`}

typeActionsadded inv0.9.9

type Actions []rbac.Action

func (*Actions)Scanadded inv0.9.9

func (a *Actions) Scan(src interface{})error

func (*Actions)Valueadded inv0.9.9

func (a *Actions) Value() (driver.Value,error)

typeAppSharingLeveladded inv0.10.0

type AppSharingLevelstring
const (AppSharingLevelOwnerAppSharingLevel = "owner"AppSharingLevelAuthenticatedAppSharingLevel = "authenticated"AppSharingLevelPublicAppSharingLevel = "public")

funcAllAppSharingLevelValuesadded inv0.15.2

func AllAppSharingLevelValues() []AppSharingLevel

func (*AppSharingLevel)Scanadded inv0.10.0

func (e *AppSharingLevel) Scan(src interface{})error

func (AppSharingLevel)Validadded inv0.15.2

func (eAppSharingLevel) Valid()bool

typeAuditActionadded inv0.5.3

type AuditActionstring
const (AuditActionCreateAuditAction = "create"AuditActionWriteAuditAction = "write"AuditActionDeleteAuditAction = "delete"AuditActionStartAuditAction = "start"AuditActionStopAuditAction = "stop"AuditActionLoginAuditAction = "login"AuditActionLogoutAuditAction = "logout"AuditActionRegisterAuditAction = "register")

funcAllAuditActionValuesadded inv0.15.2

func AllAuditActionValues() []AuditAction

func (*AuditAction)Scanadded inv0.5.3

func (e *AuditAction) Scan(src interface{})error

func (AuditAction)Validadded inv0.15.2

func (eAuditAction) Valid()bool

typeAuditLogadded inv0.5.3

type AuditLog struct {IDuuid.UUID       `db:"id" json:"id"`Timetime.Time       `db:"time" json:"time"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Ippqtype.Inet     `db:"ip" json:"ip"`UserAgentsql.NullString  `db:"user_agent" json:"user_agent"`ResourceTypeResourceType    `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID       `db:"resource_id" json:"resource_id"`ResourceTargetstring          `db:"resource_target" json:"resource_target"`ActionAuditAction     `db:"action" json:"action"`Diffjson.RawMessage `db:"diff" json:"diff"`StatusCodeint32           `db:"status_code" json:"status_code"`AdditionalFieldsjson.RawMessage `db:"additional_fields" json:"additional_fields"`RequestIDuuid.UUID       `db:"request_id" json:"request_id"`ResourceIconstring          `db:"resource_icon" json:"resource_icon"`}

typeAuditOAuthConvertStateadded inv0.25.0

type AuditOAuthConvertState struct {CreatedAttime.Time `db:"created_at" json:"created_at"`// The time at which the state string expires, a merge request times out if the user does not perform it quick enough.ExpiresAttime.Time `db:"expires_at" json:"expires_at"`FromLoginTypeLoginType `db:"from_login_type" json:"from_login_type"`// The login type the user is converting to. Should be github or oidc.ToLoginTypeLoginType `db:"to_login_type" json:"to_login_type"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

AuditOAuthConvertState is never stored in the database. It is stored in a cookieclientside as a JWT. This type is provided for audit logging purposes.

typeAuditableGroupadded inv0.15.0

type AuditableGroup struct {GroupMembers []GroupMember `json:"members"`}

typeBuildReasonadded inv0.7.2

type BuildReasonstring
const (BuildReasonInitiatorBuildReason = "initiator"BuildReasonAutostartBuildReason = "autostart"BuildReasonAutostopBuildReason = "autostop"BuildReasonAutolockBuildReason = "autolock"BuildReasonFailedstopBuildReason = "failedstop"BuildReasonAutodeleteBuildReason = "autodelete")

funcAllBuildReasonValuesadded inv0.15.2

func AllBuildReasonValues() []BuildReason

func (*BuildReason)Scanadded inv0.7.2

func (e *BuildReason) Scan(src interface{})error

func (BuildReason)Validadded inv0.15.2

func (eBuildReason) Valid()bool

typeDBTX

type DBTX interface {ExecContext(context.Context,string, ...interface{}) (sql.Result,error)PrepareContext(context.Context,string) (*sql.Stmt,error)QueryContext(context.Context,string, ...interface{}) (*sql.Rows,error)QueryRowContext(context.Context,string, ...interface{}) *sql.RowSelectContext(ctxcontext.Context, dest interface{}, querystring, args ...interface{})errorGetContext(ctxcontext.Context, dest interface{}, querystring, args ...interface{})error}

DBTX represents a database connection or transaction.

typeDeleteGroupMemberFromGroupParamsadded inv0.16.0

type DeleteGroupMemberFromGroupParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`GroupIDuuid.UUID `db:"group_id" json:"group_id"`}

typeDeleteGroupMembersByOrgAndUserParamsadded inv0.17.0

type DeleteGroupMembersByOrgAndUserParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`}

typeDeleteTailnetAgentParamsadded inv0.25.0

type DeleteTailnetAgentParams struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetAgentRowadded inv0.25.0

type DeleteTailnetAgentRow struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetClientParamsadded inv0.25.0

type DeleteTailnetClientParams struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeDeleteTailnetClientRowadded inv0.25.0

type DeleteTailnetClientRow struct {IDuuid.UUID `db:"id" json:"id"`CoordinatorIDuuid.UUID `db:"coordinator_id" json:"coordinator_id"`}

typeFile

type File struct {Hashstring    `db:"hash" json:"hash"`CreatedAttime.Time `db:"created_at" json:"created_at"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`Mimetypestring    `db:"mimetype" json:"mimetype"`Data      []byte    `db:"data" json:"data"`IDuuid.UUID `db:"id" json:"id"`}

func (File)RBACObjectadded inv0.6.1

func (fFile) RBACObject()rbac.Object

typeGetAPIKeyByNameParamsadded inv0.19.0

type GetAPIKeyByNameParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`TokenNamestring    `db:"token_name" json:"token_name"`}

typeGetAPIKeysByUserIDParamsadded inv0.18.0

type GetAPIKeysByUserIDParams struct {LoginTypeLoginType `db:"login_type" json:"login_type"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeGetAuditLogsOffsetParamsadded inv0.8.14

type GetAuditLogsOffsetParams struct {Limitint32     `db:"limit" json:"limit"`Offsetint32     `db:"offset" json:"offset"`ResourceTypestring    `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID `db:"resource_id" json:"resource_id"`ResourceTargetstring    `db:"resource_target" json:"resource_target"`Actionstring    `db:"action" json:"action"`UserIDuuid.UUID `db:"user_id" json:"user_id"`Usernamestring    `db:"username" json:"username"`Emailstring    `db:"email" json:"email"`DateFromtime.Time `db:"date_from" json:"date_from"`DateTotime.Time `db:"date_to" json:"date_to"`BuildReasonstring    `db:"build_reason" json:"build_reason"`}

typeGetAuditLogsOffsetRowadded inv0.8.14

type GetAuditLogsOffsetRow struct {IDuuid.UUID       `db:"id" json:"id"`Timetime.Time       `db:"time" json:"time"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Ippqtype.Inet     `db:"ip" json:"ip"`UserAgentsql.NullString  `db:"user_agent" json:"user_agent"`ResourceTypeResourceType    `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID       `db:"resource_id" json:"resource_id"`ResourceTargetstring          `db:"resource_target" json:"resource_target"`ActionAuditAction     `db:"action" json:"action"`Diffjson.RawMessage `db:"diff" json:"diff"`StatusCodeint32           `db:"status_code" json:"status_code"`AdditionalFieldsjson.RawMessage `db:"additional_fields" json:"additional_fields"`RequestIDuuid.UUID       `db:"request_id" json:"request_id"`ResourceIconstring          `db:"resource_icon" json:"resource_icon"`UserUsernamesql.NullString  `db:"user_username" json:"user_username"`UserEmailsql.NullString  `db:"user_email" json:"user_email"`UserCreatedAtsql.NullTime    `db:"user_created_at" json:"user_created_at"`UserStatusNullUserStatus  `db:"user_status" json:"user_status"`UserRolespq.StringArray  `db:"user_roles" json:"user_roles"`UserAvatarUrlsql.NullString  `db:"user_avatar_url" json:"user_avatar_url"`Countint64           `db:"count" json:"count"`}

typeGetAuthorizationUserRolesRowadded inv0.6.1

type GetAuthorizationUserRolesRow struct {IDuuid.UUID  `db:"id" json:"id"`Usernamestring     `db:"username" json:"username"`StatusUserStatus `db:"status" json:"status"`Roles    []string   `db:"roles" json:"roles"`Groups   []string   `db:"groups" json:"groups"`}

typeGetDefaultProxyConfigRowadded inv0.24.0

type GetDefaultProxyConfigRow struct {DisplayNamestring `db:"display_name" json:"display_name"`IconUrlstring `db:"icon_url" json:"icon_url"`}

typeGetDeploymentDAUsRowadded inv0.15.3

type GetDeploymentDAUsRow struct {Datetime.Time `db:"date" json:"date"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeGetDeploymentWorkspaceAgentStatsRowadded inv0.19.0

type GetDeploymentWorkspaceAgentStatsRow struct {WorkspaceRxBytesint64   `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64   `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`SessionCountVSCodeint64   `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64   `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64   `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64   `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}

typeGetDeploymentWorkspaceStatsRowadded inv0.19.0

type GetDeploymentWorkspaceStatsRow struct {PendingWorkspacesint64 `db:"pending_workspaces" json:"pending_workspaces"`BuildingWorkspacesint64 `db:"building_workspaces" json:"building_workspaces"`RunningWorkspacesint64 `db:"running_workspaces" json:"running_workspaces"`FailedWorkspacesint64 `db:"failed_workspaces" json:"failed_workspaces"`StoppedWorkspacesint64 `db:"stopped_workspaces" json:"stopped_workspaces"`}

typeGetFileByHashAndCreatorParamsadded inv0.10.0

type GetFileByHashAndCreatorParams struct {Hashstring    `db:"hash" json:"hash"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`}

typeGetFileTemplatesRowadded inv0.21.0

type GetFileTemplatesRow struct {FileIDuuid.UUID   `db:"file_id" json:"file_id"`FileCreatedByuuid.UUID   `db:"file_created_by" json:"file_created_by"`TemplateIDuuid.UUID   `db:"template_id" json:"template_id"`TemplateOrganizationIDuuid.UUID   `db:"template_organization_id" json:"template_organization_id"`TemplateCreatedByuuid.UUID   `db:"template_created_by" json:"template_created_by"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`GroupACLTemplateACL `db:"group_acl" json:"group_acl"`}

func (GetFileTemplatesRow)RBACObjectadded inv0.21.0

func (tGetFileTemplatesRow) RBACObject()rbac.Object

typeGetGitAuthLinkParamsadded inv0.11.0

type GetGitAuthLinkParams struct {ProviderIDstring    `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeGetGroupByOrgAndNameParamsadded inv0.9.9

type GetGroupByOrgAndNameParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Namestring    `db:"name" json:"name"`}

typeGetOrganizationIDsByMemberIDsRowadded inv0.5.1

type GetOrganizationIDsByMemberIDsRow struct {UserIDuuid.UUID   `db:"user_id" json:"user_id"`OrganizationIDs []uuid.UUID `db:"organization_IDs" json:"organization_IDs"`}

func (GetOrganizationIDsByMemberIDsRow)RBACObjectadded inv0.17.2

typeGetOrganizationMemberByUserIDParams

type GetOrganizationMemberByUserIDParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeGetPreviousTemplateVersionParamsadded inv0.13.2

type GetPreviousTemplateVersionParams struct {OrganizationIDuuid.UUID     `db:"organization_id" json:"organization_id"`Namestring        `db:"name" json:"name"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`}

typeGetProvisionerJobsByIDsWithQueuePositionRowadded inv0.25.0

type GetProvisionerJobsByIDsWithQueuePositionRow struct {ProvisionerJobProvisionerJob `db:"provisioner_job" json:"provisioner_job"`QueuePositionint64          `db:"queue_position" json:"queue_position"`QueueSizeint64          `db:"queue_size" json:"queue_size"`}

typeGetProvisionerLogsAfterIDParamsadded inv0.21.0

type GetProvisionerLogsAfterIDParams struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`CreatedAfterint64     `db:"created_after" json:"created_after"`}

typeGetTemplateAverageBuildTimeParamsadded inv0.10.0

type GetTemplateAverageBuildTimeParams struct {TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`StartTimesql.NullTime  `db:"start_time" json:"start_time"`}

typeGetTemplateAverageBuildTimeRowadded inv0.10.0

type GetTemplateAverageBuildTimeRow struct {Start50float64 `db:"start_50" json:"start_50"`Stop50float64 `db:"stop_50" json:"stop_50"`Delete50float64 `db:"delete_50" json:"delete_50"`Start95float64 `db:"start_95" json:"start_95"`Stop95float64 `db:"stop_95" json:"stop_95"`Delete95float64 `db:"delete_95" json:"delete_95"`}

typeGetTemplateByOrganizationAndNameParamsadded inv0.4.0

type GetTemplateByOrganizationAndNameParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`Deletedbool      `db:"deleted" json:"deleted"`Namestring    `db:"name" json:"name"`}

typeGetTemplateDAUsParamsadded inv0.24.0

type GetTemplateDAUsParams struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`TzOffsetint32     `db:"tz_offset" json:"tz_offset"`}

typeGetTemplateDAUsRowadded inv0.8.12

type GetTemplateDAUsRow struct {Datetime.Time `db:"date" json:"date"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeGetTemplateDailyInsightsParamsadded inv0.27.1

type GetTemplateDailyInsightsParams struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`}

typeGetTemplateDailyInsightsRowadded inv0.27.1

type GetTemplateDailyInsightsRow struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`ActiveUsersint64       `db:"active_users" json:"active_users"`}

typeGetTemplateInsightsParamsadded inv0.27.1

type GetTemplateInsightsParams struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`}

typeGetTemplateInsightsRowadded inv0.27.1

type GetTemplateInsightsRow struct {TemplateIDs                 []uuid.UUID `db:"template_ids" json:"template_ids"`ActiveUsersint64       `db:"active_users" json:"active_users"`UsageVscodeSecondsint64       `db:"usage_vscode_seconds" json:"usage_vscode_seconds"`UsageJetbrainsSecondsint64       `db:"usage_jetbrains_seconds" json:"usage_jetbrains_seconds"`UsageReconnectingPtySecondsint64       `db:"usage_reconnecting_pty_seconds" json:"usage_reconnecting_pty_seconds"`UsageSshSecondsint64       `db:"usage_ssh_seconds" json:"usage_ssh_seconds"`}

typeGetTemplateVersionByTemplateIDAndNameParamsadded inv0.4.0

type GetTemplateVersionByTemplateIDAndNameParams struct {TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`Namestring        `db:"name" json:"name"`}

typeGetTemplateVersionsByTemplateIDParamsadded inv0.5.6

type GetTemplateVersionsByTemplateIDParams struct {TemplateIDuuid.UUID `db:"template_id" json:"template_id"`AfterIDuuid.UUID `db:"after_id" json:"after_id"`OffsetOptint32     `db:"offset_opt" json:"offset_opt"`LimitOptint32     `db:"limit_opt" json:"limit_opt"`}

typeGetTemplatesWithFilterParamsadded inv0.7.0

type GetTemplatesWithFilterParams struct {Deletedbool        `db:"deleted" json:"deleted"`OrganizationIDuuid.UUID   `db:"organization_id" json:"organization_id"`ExactNamestring      `db:"exact_name" json:"exact_name"`IDs            []uuid.UUID `db:"ids" json:"ids"`}

typeGetUserByEmailOrUsernameParams

type GetUserByEmailOrUsernameParams struct {Usernamestring `db:"username" json:"username"`Emailstring `db:"email" json:"email"`}

typeGetUserLatencyInsightsParamsadded inv0.27.1

type GetUserLatencyInsightsParams struct {StartTimetime.Time   `db:"start_time" json:"start_time"`EndTimetime.Time   `db:"end_time" json:"end_time"`TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"`}

typeGetUserLatencyInsightsRowadded inv0.27.1

type GetUserLatencyInsightsRow struct {UserIDuuid.UUID   `db:"user_id" json:"user_id"`Usernamestring      `db:"username" json:"username"`TemplateIDs                  []uuid.UUID `db:"template_ids" json:"template_ids"`WorkspaceConnectionLatency50float64     `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64     `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`}

typeGetUserLinkByUserIDLoginTypeParamsadded inv0.8.6

type GetUserLinkByUserIDLoginTypeParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`}

typeGetUsersParamsadded inv0.4.4

type GetUsersParams struct {AfterIDuuid.UUID    `db:"after_id" json:"after_id"`Searchstring       `db:"search" json:"search"`Status         []UserStatus `db:"status" json:"status"`RbacRole       []string     `db:"rbac_role" json:"rbac_role"`LastSeenBeforetime.Time    `db:"last_seen_before" json:"last_seen_before"`LastSeenAftertime.Time    `db:"last_seen_after" json:"last_seen_after"`OffsetOptint32        `db:"offset_opt" json:"offset_opt"`LimitOptint32        `db:"limit_opt" json:"limit_opt"`}

typeGetUsersRowadded inv0.12.8

type GetUsersRow struct {IDuuid.UUID      `db:"id" json:"id"`Emailstring         `db:"email" json:"email"`Usernamestring         `db:"username" json:"username"`HashedPassword     []byte         `db:"hashed_password" json:"hashed_password"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`StatusUserStatus     `db:"status" json:"status"`RBACRolespq.StringArray `db:"rbac_roles" json:"rbac_roles"`LoginTypeLoginType      `db:"login_type" json:"login_type"`AvatarURLsql.NullString `db:"avatar_url" json:"avatar_url"`Deletedbool           `db:"deleted" json:"deleted"`LastSeenAttime.Time      `db:"last_seen_at" json:"last_seen_at"`QuietHoursSchedulestring         `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`Countint64          `db:"count" json:"count"`}

func (GetUsersRow)RBACObjectadded inv0.17.2

func (uGetUsersRow) RBACObject()rbac.Object

typeGetWorkspaceAgentLifecycleStateByIDRowadded inv0.25.0

type GetWorkspaceAgentLifecycleStateByIDRow struct {LifecycleStateWorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"`StartedAtsql.NullTime                 `db:"started_at" json:"started_at"`ReadyAtsql.NullTime                 `db:"ready_at" json:"ready_at"`}

typeGetWorkspaceAgentStartupLogsAfterParamsadded inv0.21.0

type GetWorkspaceAgentStartupLogsAfterParams struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`CreatedAfterint64     `db:"created_after" json:"created_after"`}

typeGetWorkspaceAgentStatsAndLabelsRowadded inv0.22.1

type GetWorkspaceAgentStatsAndLabelsRow struct {Usernamestring  `db:"username" json:"username"`AgentNamestring  `db:"agent_name" json:"agent_name"`WorkspaceNamestring  `db:"workspace_name" json:"workspace_name"`RxBytesint64   `db:"rx_bytes" json:"rx_bytes"`TxBytesint64   `db:"tx_bytes" json:"tx_bytes"`SessionCountVSCodeint64   `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64   `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64   `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64   `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`ConnectionCountint64   `db:"connection_count" json:"connection_count"`ConnectionMedianLatencyMSfloat64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`}

typeGetWorkspaceAgentStatsRowadded inv0.20.0

type GetWorkspaceAgentStatsRow struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`AggregatedFromtime.Time `db:"aggregated_from" json:"aggregated_from"`WorkspaceRxBytesint64     `db:"workspace_rx_bytes" json:"workspace_rx_bytes"`WorkspaceTxBytesint64     `db:"workspace_tx_bytes" json:"workspace_tx_bytes"`WorkspaceConnectionLatency50float64   `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"`WorkspaceConnectionLatency95float64   `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"`AgentID_2uuid.UUID `db:"agent_id_2" json:"agent_id_2"`SessionCountVSCodeint64     `db:"session_count_vscode" json:"session_count_vscode"`SessionCountSSHint64     `db:"session_count_ssh" json:"session_count_ssh"`SessionCountJetBrainsint64     `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64     `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`}

typeGetWorkspaceAppByAgentIDAndSlugParamsadded inv0.12.0

type GetWorkspaceAppByAgentIDAndSlugParams struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`Slugstring    `db:"slug" json:"slug"`}

typeGetWorkspaceBuildByWorkspaceIDAndBuildNumberParamsadded inv0.6.6

type GetWorkspaceBuildByWorkspaceIDAndBuildNumberParams struct {WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`BuildNumberint32     `db:"build_number" json:"build_number"`}

typeGetWorkspaceBuildsByWorkspaceIDParamsadded inv0.9.8

type GetWorkspaceBuildsByWorkspaceIDParams struct {WorkspaceIDuuid.UUID `db:"workspace_id" json:"workspace_id"`Sincetime.Time `db:"since" json:"since"`AfterIDuuid.UUID `db:"after_id" json:"after_id"`OffsetOptint32     `db:"offset_opt" json:"offset_opt"`LimitOptint32     `db:"limit_opt" json:"limit_opt"`}

typeGetWorkspaceByOwnerIDAndNameParamsadded inv0.5.0

type GetWorkspaceByOwnerIDAndNameParams struct {OwnerIDuuid.UUID `db:"owner_id" json:"owner_id"`Deletedbool      `db:"deleted" json:"deleted"`Namestring    `db:"name" json:"name"`}

typeGetWorkspaceProxyByHostnameParamsadded inv0.23.0

type GetWorkspaceProxyByHostnameParams struct {Hostnamestring `db:"hostname" json:"hostname"`AllowAccessUrlbool   `db:"allow_access_url" json:"allow_access_url"`AllowWildcardHostnamebool   `db:"allow_wildcard_hostname" json:"allow_wildcard_hostname"`}

typeGetWorkspacesParamsadded inv0.7.2

type GetWorkspacesParams struct {Deletedbool        `db:"deleted" json:"deleted"`Statusstring      `db:"status" json:"status"`OwnerIDuuid.UUID   `db:"owner_id" json:"owner_id"`OwnerUsernamestring      `db:"owner_username" json:"owner_username"`TemplateNamestring      `db:"template_name" json:"template_name"`TemplateIDs                           []uuid.UUID `db:"template_ids" json:"template_ids"`Namestring      `db:"name" json:"name"`HasAgentstring      `db:"has_agent" json:"has_agent"`AgentInactiveDisconnectTimeoutSecondsint64       `db:"agent_inactive_disconnect_timeout_seconds" json:"agent_inactive_disconnect_timeout_seconds"`Offsetint32       `db:"offset_" json:"offset_"`Limitint32       `db:"limit_" json:"limit_"`}

typeGetWorkspacesRowadded inv0.12.8

type GetWorkspacesRow struct {IDuuid.UUID      `db:"id" json:"id"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID      `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID      `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID      `db:"template_id" json:"template_id"`Deletedbool           `db:"deleted" json:"deleted"`Namestring         `db:"name" json:"name"`AutostartSchedulesql.NullString `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64  `db:"ttl" json:"ttl"`LastUsedAttime.Time      `db:"last_used_at" json:"last_used_at"`LockedAtsql.NullTime   `db:"locked_at" json:"locked_at"`DeletingAtsql.NullTime   `db:"deleting_at" json:"deleting_at"`TemplateNamestring         `db:"template_name" json:"template_name"`TemplateVersionIDuuid.UUID      `db:"template_version_id" json:"template_version_id"`TemplateVersionNamesql.NullString `db:"template_version_name" json:"template_version_name"`Countint64          `db:"count" json:"count"`}

typeGitAuthLinkadded inv0.11.0

type GitAuthLink struct {ProviderIDstring    `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OAuthAccessTokenstring    `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring    `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`}

func (GitAuthLink)RBACObjectadded inv0.17.2

func (uGitAuthLink) RBACObject()rbac.Object

typeGitSSHKeyadded inv0.4.0

type GitSSHKey struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`PrivateKeystring    `db:"private_key" json:"private_key"`PublicKeystring    `db:"public_key" json:"public_key"`}

func (GitSSHKey)RBACObjectadded inv0.17.2

func (uGitSSHKey) RBACObject()rbac.Object

typeGroupadded inv0.9.9

type Group struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`AvatarURLstring    `db:"avatar_url" json:"avatar_url"`QuotaAllowanceint32     `db:"quota_allowance" json:"quota_allowance"`}

func (Group)Auditableadded inv0.15.0

func (gGroup) Auditable(users []User)AuditableGroup

Auditable returns an object that can be used in audit logs.Covers both group and group member changes.

func (Group)RBACObjectadded inv0.9.9

func (gGroup) RBACObject()rbac.Object

typeGroupMemberadded inv0.9.9

type GroupMember struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`GroupIDuuid.UUID `db:"group_id" json:"group_id"`}

typeInsertAPIKeyParams

type InsertAPIKeyParams struct {IDstring      `db:"id" json:"id"`LifetimeSecondsint64       `db:"lifetime_seconds" json:"lifetime_seconds"`HashedSecret    []byte      `db:"hashed_secret" json:"hashed_secret"`IPAddresspqtype.Inet `db:"ip_address" json:"ip_address"`UserIDuuid.UUID   `db:"user_id" json:"user_id"`LastUsedtime.Time   `db:"last_used" json:"last_used"`ExpiresAttime.Time   `db:"expires_at" json:"expires_at"`CreatedAttime.Time   `db:"created_at" json:"created_at"`UpdatedAttime.Time   `db:"updated_at" json:"updated_at"`LoginTypeLoginType   `db:"login_type" json:"login_type"`ScopeAPIKeyScope `db:"scope" json:"scope"`TokenNamestring      `db:"token_name" json:"token_name"`}

typeInsertAuditLogParamsadded inv0.5.3

type InsertAuditLogParams struct {IDuuid.UUID       `db:"id" json:"id"`Timetime.Time       `db:"time" json:"time"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Ippqtype.Inet     `db:"ip" json:"ip"`UserAgentsql.NullString  `db:"user_agent" json:"user_agent"`ResourceTypeResourceType    `db:"resource_type" json:"resource_type"`ResourceIDuuid.UUID       `db:"resource_id" json:"resource_id"`ResourceTargetstring          `db:"resource_target" json:"resource_target"`ActionAuditAction     `db:"action" json:"action"`Diffjson.RawMessage `db:"diff" json:"diff"`StatusCodeint32           `db:"status_code" json:"status_code"`AdditionalFieldsjson.RawMessage `db:"additional_fields" json:"additional_fields"`RequestIDuuid.UUID       `db:"request_id" json:"request_id"`ResourceIconstring          `db:"resource_icon" json:"resource_icon"`}

typeInsertFileParams

type InsertFileParams struct {IDuuid.UUID `db:"id" json:"id"`Hashstring    `db:"hash" json:"hash"`CreatedAttime.Time `db:"created_at" json:"created_at"`CreatedByuuid.UUID `db:"created_by" json:"created_by"`Mimetypestring    `db:"mimetype" json:"mimetype"`Data      []byte    `db:"data" json:"data"`}

typeInsertGitAuthLinkParamsadded inv0.11.0

type InsertGitAuthLinkParams struct {ProviderIDstring    `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OAuthAccessTokenstring    `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring    `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`}

typeInsertGitSSHKeyParamsadded inv0.4.0

type InsertGitSSHKeyParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`PrivateKeystring    `db:"private_key" json:"private_key"`PublicKeystring    `db:"public_key" json:"public_key"`}

typeInsertGroupMemberParamsadded inv0.9.9

type InsertGroupMemberParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`GroupIDuuid.UUID `db:"group_id" json:"group_id"`}

typeInsertGroupParamsadded inv0.9.9

type InsertGroupParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`AvatarURLstring    `db:"avatar_url" json:"avatar_url"`QuotaAllowanceint32     `db:"quota_allowance" json:"quota_allowance"`}

typeInsertLicenseParamsadded inv0.8.7

type InsertLicenseParams struct {UploadedAttime.Time `db:"uploaded_at" json:"uploaded_at"`JWTstring    `db:"jwt" json:"jwt"`Exptime.Time `db:"exp" json:"exp"`UUIDuuid.UUID `db:"uuid" json:"uuid"`}

typeInsertOrganizationMemberParams

type InsertOrganizationMemberParams struct {OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Roles          []string  `db:"roles" json:"roles"`}

typeInsertOrganizationParams

type InsertOrganizationParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`Descriptionstring    `db:"description" json:"description"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeInsertProvisionerDaemonParams

type InsertProvisionerDaemonParams struct {IDuuid.UUID         `db:"id" json:"id"`CreatedAttime.Time         `db:"created_at" json:"created_at"`Namestring            `db:"name" json:"name"`Provisioners []ProvisionerType `db:"provisioners" json:"provisioners"`TagsStringMap         `db:"tags" json:"tags"`}

typeInsertProvisionerJobLogsParams

type InsertProvisionerJobLogsParams struct {JobIDuuid.UUID   `db:"job_id" json:"job_id"`CreatedAt []time.Time `db:"created_at" json:"created_at"`Source    []LogSource `db:"source" json:"source"`Level     []LogLevel  `db:"level" json:"level"`Stage     []string    `db:"stage" json:"stage"`Output    []string    `db:"output" json:"output"`}

typeInsertProvisionerJobParams

type InsertProvisionerJobParams struct {IDuuid.UUID                `db:"id" json:"id"`CreatedAttime.Time                `db:"created_at" json:"created_at"`UpdatedAttime.Time                `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID                `db:"organization_id" json:"organization_id"`InitiatorIDuuid.UUID                `db:"initiator_id" json:"initiator_id"`ProvisionerProvisionerType          `db:"provisioner" json:"provisioner"`StorageMethodProvisionerStorageMethod `db:"storage_method" json:"storage_method"`FileIDuuid.UUID                `db:"file_id" json:"file_id"`TypeProvisionerJobType       `db:"type" json:"type"`Inputjson.RawMessage          `db:"input" json:"input"`TagsStringMap                `db:"tags" json:"tags"`TraceMetadatapqtype.NullRawMessage    `db:"trace_metadata" json:"trace_metadata"`}

typeInsertReplicaParamsadded inv0.10.0

type InsertReplicaParams struct {IDuuid.UUID `db:"id" json:"id"`CreatedAttime.Time `db:"created_at" json:"created_at"`StartedAttime.Time `db:"started_at" json:"started_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Hostnamestring    `db:"hostname" json:"hostname"`RegionIDint32     `db:"region_id" json:"region_id"`RelayAddressstring    `db:"relay_address" json:"relay_address"`Versionstring    `db:"version" json:"version"`DatabaseLatencyint32     `db:"database_latency" json:"database_latency"`}

typeInsertTemplateParamsadded inv0.4.0

type InsertTemplateParams struct {IDuuid.UUID       `db:"id" json:"id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Namestring          `db:"name" json:"name"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`ActiveVersionIDuuid.UUID       `db:"active_version_id" json:"active_version_id"`Descriptionstring          `db:"description" json:"description"`CreatedByuuid.UUID       `db:"created_by" json:"created_by"`Iconstring          `db:"icon" json:"icon"`UserACLTemplateACL     `db:"user_acl" json:"user_acl"`GroupACLTemplateACL     `db:"group_acl" json:"group_acl"`DisplayNamestring          `db:"display_name" json:"display_name"`AllowUserCancelWorkspaceJobsbool            `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`}

typeInsertTemplateVersionParameterParamsadded inv0.15.0

type InsertTemplateVersionParameterParams struct {TemplateVersionIDuuid.UUID       `db:"template_version_id" json:"template_version_id"`Namestring          `db:"name" json:"name"`Descriptionstring          `db:"description" json:"description"`Typestring          `db:"type" json:"type"`Mutablebool            `db:"mutable" json:"mutable"`DefaultValuestring          `db:"default_value" json:"default_value"`Iconstring          `db:"icon" json:"icon"`Optionsjson.RawMessage `db:"options" json:"options"`ValidationRegexstring          `db:"validation_regex" json:"validation_regex"`ValidationMinsql.NullInt32   `db:"validation_min" json:"validation_min"`ValidationMaxsql.NullInt32   `db:"validation_max" json:"validation_max"`ValidationErrorstring          `db:"validation_error" json:"validation_error"`ValidationMonotonicstring          `db:"validation_monotonic" json:"validation_monotonic"`Requiredbool            `db:"required" json:"required"`DisplayNamestring          `db:"display_name" json:"display_name"`DisplayOrderint32           `db:"display_order" json:"display_order"`Ephemeralbool            `db:"ephemeral" json:"ephemeral"`}

typeInsertTemplateVersionParamsadded inv0.4.0

type InsertTemplateVersionParams struct {IDuuid.UUID     `db:"id" json:"id"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID     `db:"organization_id" json:"organization_id"`CreatedAttime.Time     `db:"created_at" json:"created_at"`UpdatedAttime.Time     `db:"updated_at" json:"updated_at"`Namestring        `db:"name" json:"name"`Messagestring        `db:"message" json:"message"`Readmestring        `db:"readme" json:"readme"`JobIDuuid.UUID     `db:"job_id" json:"job_id"`CreatedByuuid.UUID     `db:"created_by" json:"created_by"`}

typeInsertTemplateVersionVariableParamsadded inv0.17.4

type InsertTemplateVersionVariableParams struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`Namestring    `db:"name" json:"name"`Descriptionstring    `db:"description" json:"description"`Typestring    `db:"type" json:"type"`Valuestring    `db:"value" json:"value"`DefaultValuestring    `db:"default_value" json:"default_value"`Requiredbool      `db:"required" json:"required"`Sensitivebool      `db:"sensitive" json:"sensitive"`}

typeInsertUserGroupsByNameParamsadded inv0.17.0

type InsertUserGroupsByNameParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`GroupNames     []string  `db:"group_names" json:"group_names"`}

typeInsertUserLinkParamsadded inv0.8.6

type InsertUserLinkParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`LinkedIDstring    `db:"linked_id" json:"linked_id"`OAuthAccessTokenstring    `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring    `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`}

typeInsertUserParams

type InsertUserParams struct {IDuuid.UUID      `db:"id" json:"id"`Emailstring         `db:"email" json:"email"`Usernamestring         `db:"username" json:"username"`HashedPassword []byte         `db:"hashed_password" json:"hashed_password"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`RBACRolespq.StringArray `db:"rbac_roles" json:"rbac_roles"`LoginTypeLoginType      `db:"login_type" json:"login_type"`}

typeInsertWorkspaceAgentMetadataParamsadded inv0.21.3

type InsertWorkspaceAgentMetadataParams struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`DisplayNamestring    `db:"display_name" json:"display_name"`Keystring    `db:"key" json:"key"`Scriptstring    `db:"script" json:"script"`Timeoutint64     `db:"timeout" json:"timeout"`Intervalint64     `db:"interval" json:"interval"`}

typeInsertWorkspaceAgentParams

type InsertWorkspaceAgentParams struct {IDuuid.UUID             `db:"id" json:"id"`CreatedAttime.Time             `db:"created_at" json:"created_at"`UpdatedAttime.Time             `db:"updated_at" json:"updated_at"`Namestring                `db:"name" json:"name"`ResourceIDuuid.UUID             `db:"resource_id" json:"resource_id"`AuthTokenuuid.UUID             `db:"auth_token" json:"auth_token"`AuthInstanceIDsql.NullString        `db:"auth_instance_id" json:"auth_instance_id"`Architecturestring                `db:"architecture" json:"architecture"`EnvironmentVariablespqtype.NullRawMessage `db:"environment_variables" json:"environment_variables"`OperatingSystemstring                `db:"operating_system" json:"operating_system"`StartupScriptsql.NullString        `db:"startup_script" json:"startup_script"`Directorystring                `db:"directory" json:"directory"`InstanceMetadatapqtype.NullRawMessage `db:"instance_metadata" json:"instance_metadata"`ResourceMetadatapqtype.NullRawMessage `db:"resource_metadata" json:"resource_metadata"`ConnectionTimeoutSecondsint32                 `db:"connection_timeout_seconds" json:"connection_timeout_seconds"`TroubleshootingURLstring                `db:"troubleshooting_url" json:"troubleshooting_url"`MOTDFilestring                `db:"motd_file" json:"motd_file"`StartupScriptBehaviorStartupScriptBehavior `db:"startup_script_behavior" json:"startup_script_behavior"`StartupScriptTimeoutSecondsint32                 `db:"startup_script_timeout_seconds" json:"startup_script_timeout_seconds"`ShutdownScriptsql.NullString        `db:"shutdown_script" json:"shutdown_script"`ShutdownScriptTimeoutSecondsint32                 `db:"shutdown_script_timeout_seconds" json:"shutdown_script_timeout_seconds"`}

typeInsertWorkspaceAgentStartupLogsParamsadded inv0.21.0

type InsertWorkspaceAgentStartupLogsParams struct {AgentIDuuid.UUID   `db:"agent_id" json:"agent_id"`CreatedAt    []time.Time `db:"created_at" json:"created_at"`Output       []string    `db:"output" json:"output"`Level        []LogLevel  `db:"level" json:"level"`OutputLengthint32       `db:"output_length" json:"output_length"`}

typeInsertWorkspaceAgentStatParamsadded inv0.18.0

type InsertWorkspaceAgentStatParams struct {IDuuid.UUID       `db:"id" json:"id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`WorkspaceIDuuid.UUID       `db:"workspace_id" json:"workspace_id"`TemplateIDuuid.UUID       `db:"template_id" json:"template_id"`AgentIDuuid.UUID       `db:"agent_id" json:"agent_id"`ConnectionsByProtojson.RawMessage `db:"connections_by_proto" json:"connections_by_proto"`ConnectionCountint64           `db:"connection_count" json:"connection_count"`RxPacketsint64           `db:"rx_packets" json:"rx_packets"`RxBytesint64           `db:"rx_bytes" json:"rx_bytes"`TxPacketsint64           `db:"tx_packets" json:"tx_packets"`TxBytesint64           `db:"tx_bytes" json:"tx_bytes"`SessionCountVSCodeint64           `db:"session_count_vscode" json:"session_count_vscode"`SessionCountJetBrainsint64           `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64           `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`SessionCountSSHint64           `db:"session_count_ssh" json:"session_count_ssh"`ConnectionMedianLatencyMSfloat64         `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`}

typeInsertWorkspaceAppParamsadded inv0.6.2

type InsertWorkspaceAppParams struct {IDuuid.UUID          `db:"id" json:"id"`CreatedAttime.Time          `db:"created_at" json:"created_at"`AgentIDuuid.UUID          `db:"agent_id" json:"agent_id"`Slugstring             `db:"slug" json:"slug"`DisplayNamestring             `db:"display_name" json:"display_name"`Iconstring             `db:"icon" json:"icon"`Commandsql.NullString     `db:"command" json:"command"`Urlsql.NullString     `db:"url" json:"url"`Externalbool               `db:"external" json:"external"`Subdomainbool               `db:"subdomain" json:"subdomain"`SharingLevelAppSharingLevel    `db:"sharing_level" json:"sharing_level"`HealthcheckUrlstring             `db:"healthcheck_url" json:"healthcheck_url"`HealthcheckIntervalint32              `db:"healthcheck_interval" json:"healthcheck_interval"`HealthcheckThresholdint32              `db:"healthcheck_threshold" json:"healthcheck_threshold"`HealthWorkspaceAppHealth `db:"health" json:"health"`}

typeInsertWorkspaceBuildParametersParamsadded inv0.15.0

type InsertWorkspaceBuildParametersParams struct {WorkspaceBuildIDuuid.UUID `db:"workspace_build_id" json:"workspace_build_id"`Name             []string  `db:"name" json:"name"`Value            []string  `db:"value" json:"value"`}

typeInsertWorkspaceBuildParams

type InsertWorkspaceBuildParams struct {IDuuid.UUID           `db:"id" json:"id"`CreatedAttime.Time           `db:"created_at" json:"created_at"`UpdatedAttime.Time           `db:"updated_at" json:"updated_at"`WorkspaceIDuuid.UUID           `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID           `db:"template_version_id" json:"template_version_id"`BuildNumberint32               `db:"build_number" json:"build_number"`TransitionWorkspaceTransition `db:"transition" json:"transition"`InitiatorIDuuid.UUID           `db:"initiator_id" json:"initiator_id"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`ProvisionerState  []byte              `db:"provisioner_state" json:"provisioner_state"`Deadlinetime.Time           `db:"deadline" json:"deadline"`MaxDeadlinetime.Time           `db:"max_deadline" json:"max_deadline"`ReasonBuildReason         `db:"reason" json:"reason"`}

typeInsertWorkspaceParams

type InsertWorkspaceParams struct {IDuuid.UUID      `db:"id" json:"id"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID      `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID      `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID      `db:"template_id" json:"template_id"`Namestring         `db:"name" json:"name"`AutostartSchedulesql.NullString `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64  `db:"ttl" json:"ttl"`LastUsedAttime.Time      `db:"last_used_at" json:"last_used_at"`}

typeInsertWorkspaceProxyParamsadded inv0.22.0

type InsertWorkspaceProxyParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`Iconstring    `db:"icon" json:"icon"`TokenHashedSecret []byte    `db:"token_hashed_secret" json:"token_hashed_secret"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeInsertWorkspaceResourceMetadataParamsadded inv0.8.3

type InsertWorkspaceResourceMetadataParams struct {WorkspaceResourceIDuuid.UUID `db:"workspace_resource_id" json:"workspace_resource_id"`Key                 []string  `db:"key" json:"key"`Value               []string  `db:"value" json:"value"`Sensitive           []bool    `db:"sensitive" json:"sensitive"`}

typeInsertWorkspaceResourceParams

type InsertWorkspaceResourceParams struct {IDuuid.UUID           `db:"id" json:"id"`CreatedAttime.Time           `db:"created_at" json:"created_at"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Typestring              `db:"type" json:"type"`Namestring              `db:"name" json:"name"`Hidebool                `db:"hide" json:"hide"`Iconstring              `db:"icon" json:"icon"`InstanceTypesql.NullString      `db:"instance_type" json:"instance_type"`DailyCostint32               `db:"daily_cost" json:"daily_cost"`}

typeLicense

type License struct {IDint32     `db:"id" json:"id"`UploadedAttime.Time `db:"uploaded_at" json:"uploaded_at"`JWTstring    `db:"jwt" json:"jwt"`// exp tracks the claim of the same name in the JWT, and we include it here so that we can easily query for licenses that have not yet expired.Exptime.Time `db:"exp" json:"exp"`UUIDuuid.UUID `db:"uuid" json:"uuid"`}

func (License)RBACObjectadded inv0.8.7

func (lLicense) RBACObject()rbac.Object

typeLogLevel

type LogLevelstring
const (LogLevelTraceLogLevel = "trace"LogLevelDebugLogLevel = "debug"LogLevelInfoLogLevel = "info"LogLevelWarnLogLevel = "warn"LogLevelErrorLogLevel = "error")

funcAllLogLevelValuesadded inv0.15.2

func AllLogLevelValues() []LogLevel

func (*LogLevel)Scan

func (e *LogLevel) Scan(src interface{})error

func (LogLevel)Validadded inv0.15.2

func (eLogLevel) Valid()bool

typeLogSource

type LogSourcestring
const (LogSourceProvisionerDaemonLogSource = "provisioner_daemon"LogSourceProvisionerLogSource = "provisioner")

funcAllLogSourceValuesadded inv0.15.2

func AllLogSourceValues() []LogSource

func (*LogSource)Scan

func (e *LogSource) Scan(src interface{})error

func (LogSource)Validadded inv0.15.2

func (eLogSource) Valid()bool

typeLoginType

type LoginTypestring

Specifies the method of authentication. "none" is a special case in which no authentication method is allowed.

const (LoginTypePasswordLoginType = "password"LoginTypeGithubLoginType = "github"LoginTypeOIDCLoginType = "oidc"LoginTypeTokenLoginType = "token"LoginTypeNoneLoginType = "none")

funcAllLoginTypeValuesadded inv0.15.2

func AllLoginTypeValues() []LoginType

func (*LoginType)Scan

func (e *LoginType) Scan(src interface{})error

func (LoginType)Validadded inv0.15.2

func (eLoginType) Valid()bool

typeNullAPIKeyScopeadded inv0.15.2

type NullAPIKeyScope struct {APIKeyScopeAPIKeyScope `json:"api_key_scope"`Validbool        `json:"valid"`// Valid is true if APIKeyScope is not NULL}

func (*NullAPIKeyScope)Scanadded inv0.15.2

func (ns *NullAPIKeyScope) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullAPIKeyScope)Valueadded inv0.15.2

func (nsNullAPIKeyScope) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullAppSharingLeveladded inv0.15.2

type NullAppSharingLevel struct {AppSharingLevelAppSharingLevel `json:"app_sharing_level"`Validbool            `json:"valid"`// Valid is true if AppSharingLevel is not NULL}

func (*NullAppSharingLevel)Scanadded inv0.15.2

func (ns *NullAppSharingLevel) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullAppSharingLevel)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeNullAuditActionadded inv0.15.2

type NullAuditAction struct {AuditActionAuditAction `json:"audit_action"`Validbool        `json:"valid"`// Valid is true if AuditAction is not NULL}

func (*NullAuditAction)Scanadded inv0.15.2

func (ns *NullAuditAction) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullAuditAction)Valueadded inv0.15.2

func (nsNullAuditAction) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullBuildReasonadded inv0.15.2

type NullBuildReason struct {BuildReasonBuildReason `json:"build_reason"`Validbool        `json:"valid"`// Valid is true if BuildReason is not NULL}

func (*NullBuildReason)Scanadded inv0.15.2

func (ns *NullBuildReason) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullBuildReason)Valueadded inv0.15.2

func (nsNullBuildReason) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullLogLeveladded inv0.15.2

type NullLogLevel struct {LogLevelLogLevel `json:"log_level"`Validbool     `json:"valid"`// Valid is true if LogLevel is not NULL}

func (*NullLogLevel)Scanadded inv0.15.2

func (ns *NullLogLevel) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullLogLevel)Valueadded inv0.15.2

func (nsNullLogLevel) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullLogSourceadded inv0.15.2

type NullLogSource struct {LogSourceLogSource `json:"log_source"`Validbool      `json:"valid"`// Valid is true if LogSource is not NULL}

func (*NullLogSource)Scanadded inv0.15.2

func (ns *NullLogSource) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullLogSource)Valueadded inv0.15.2

func (nsNullLogSource) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullLoginTypeadded inv0.15.2

type NullLoginType struct {LoginTypeLoginType `json:"login_type"`Validbool      `json:"valid"`// Valid is true if LoginType is not NULL}

func (*NullLoginType)Scanadded inv0.15.2

func (ns *NullLoginType) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullLoginType)Valueadded inv0.15.2

func (nsNullLoginType) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullParameterDestinationSchemeadded inv0.15.2

type NullParameterDestinationScheme struct {ParameterDestinationSchemeParameterDestinationScheme `json:"parameter_destination_scheme"`Validbool                       `json:"valid"`// Valid is true if ParameterDestinationScheme is not NULL}

func (*NullParameterDestinationScheme)Scanadded inv0.15.2

func (ns *NullParameterDestinationScheme) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullParameterDestinationScheme)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeNullParameterScopeadded inv0.15.2

type NullParameterScope struct {ParameterScopeParameterScope `json:"parameter_scope"`Validbool           `json:"valid"`// Valid is true if ParameterScope is not NULL}

func (*NullParameterScope)Scanadded inv0.15.2

func (ns *NullParameterScope) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullParameterScope)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeNullParameterSourceSchemeadded inv0.15.2

type NullParameterSourceScheme struct {ParameterSourceSchemeParameterSourceScheme `json:"parameter_source_scheme"`Validbool                  `json:"valid"`// Valid is true if ParameterSourceScheme is not NULL}

func (*NullParameterSourceScheme)Scanadded inv0.15.2

func (ns *NullParameterSourceScheme) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullParameterSourceScheme)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeNullParameterTypeSystemadded inv0.15.2

type NullParameterTypeSystem struct {ParameterTypeSystemParameterTypeSystem `json:"parameter_type_system"`Validbool                `json:"valid"`// Valid is true if ParameterTypeSystem is not NULL}

func (*NullParameterTypeSystem)Scanadded inv0.15.2

func (ns *NullParameterTypeSystem) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullParameterTypeSystem)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeNullProvisionerJobTypeadded inv0.15.2

type NullProvisionerJobType struct {ProvisionerJobTypeProvisionerJobType `json:"provisioner_job_type"`Validbool               `json:"valid"`// Valid is true if ProvisionerJobType is not NULL}

func (*NullProvisionerJobType)Scanadded inv0.15.2

func (ns *NullProvisionerJobType) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullProvisionerJobType)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeNullProvisionerStorageMethodadded inv0.15.2

type NullProvisionerStorageMethod struct {ProvisionerStorageMethodProvisionerStorageMethod `json:"provisioner_storage_method"`Validbool                     `json:"valid"`// Valid is true if ProvisionerStorageMethod is not NULL}

func (*NullProvisionerStorageMethod)Scanadded inv0.15.2

func (ns *NullProvisionerStorageMethod) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullProvisionerStorageMethod)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeNullProvisionerTypeadded inv0.15.2

type NullProvisionerType struct {ProvisionerTypeProvisionerType `json:"provisioner_type"`Validbool            `json:"valid"`// Valid is true if ProvisionerType is not NULL}

func (*NullProvisionerType)Scanadded inv0.15.2

func (ns *NullProvisionerType) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullProvisionerType)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeNullResourceTypeadded inv0.15.2

type NullResourceType struct {ResourceTypeResourceType `json:"resource_type"`Validbool         `json:"valid"`// Valid is true if ResourceType is not NULL}

func (*NullResourceType)Scanadded inv0.15.2

func (ns *NullResourceType) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullResourceType)Valueadded inv0.15.2

func (nsNullResourceType) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullStartupScriptBehavioradded inv0.24.0

type NullStartupScriptBehavior struct {StartupScriptBehaviorStartupScriptBehavior `json:"startup_script_behavior"`Validbool                  `json:"valid"`// Valid is true if StartupScriptBehavior is not NULL}

func (*NullStartupScriptBehavior)Scanadded inv0.24.0

func (ns *NullStartupScriptBehavior) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullStartupScriptBehavior)Valueadded inv0.24.0

Value implements the driver Valuer interface.

typeNullUserStatusadded inv0.15.2

type NullUserStatus struct {UserStatusUserStatus `json:"user_status"`Validbool       `json:"valid"`// Valid is true if UserStatus is not NULL}

func (*NullUserStatus)Scanadded inv0.15.2

func (ns *NullUserStatus) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullUserStatus)Valueadded inv0.15.2

func (nsNullUserStatus) Value() (driver.Value,error)

Value implements the driver Valuer interface.

typeNullWorkspaceAgentLifecycleStateadded inv0.15.3

type NullWorkspaceAgentLifecycleState struct {WorkspaceAgentLifecycleStateWorkspaceAgentLifecycleState `json:"workspace_agent_lifecycle_state"`Validbool                         `json:"valid"`// Valid is true if WorkspaceAgentLifecycleState is not NULL}

func (*NullWorkspaceAgentLifecycleState)Scanadded inv0.15.3

func (ns *NullWorkspaceAgentLifecycleState) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAgentLifecycleState)Valueadded inv0.15.3

Value implements the driver Valuer interface.

typeNullWorkspaceAgentSubsystemadded inv0.23.5

type NullWorkspaceAgentSubsystem struct {WorkspaceAgentSubsystemWorkspaceAgentSubsystem `json:"workspace_agent_subsystem"`Validbool                    `json:"valid"`// Valid is true if WorkspaceAgentSubsystem is not NULL}

func (*NullWorkspaceAgentSubsystem)Scanadded inv0.23.5

func (ns *NullWorkspaceAgentSubsystem) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAgentSubsystem)Valueadded inv0.23.5

Value implements the driver Valuer interface.

typeNullWorkspaceAppHealthadded inv0.15.2

type NullWorkspaceAppHealth struct {WorkspaceAppHealthWorkspaceAppHealth `json:"workspace_app_health"`Validbool               `json:"valid"`// Valid is true if WorkspaceAppHealth is not NULL}

func (*NullWorkspaceAppHealth)Scanadded inv0.15.2

func (ns *NullWorkspaceAppHealth) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceAppHealth)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeNullWorkspaceTransitionadded inv0.15.2

type NullWorkspaceTransition struct {WorkspaceTransitionWorkspaceTransition `json:"workspace_transition"`Validbool                `json:"valid"`// Valid is true if WorkspaceTransition is not NULL}

func (*NullWorkspaceTransition)Scanadded inv0.15.2

func (ns *NullWorkspaceTransition) Scan(value interface{})error

Scan implements the Scanner interface.

func (NullWorkspaceTransition)Valueadded inv0.15.2

Value implements the driver Valuer interface.

typeOrganization

type Organization struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`Descriptionstring    `db:"description" json:"description"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

func (Organization)RBACObjectadded inv0.6.0

func (oOrganization) RBACObject()rbac.Object

typeOrganizationMember

type OrganizationMember struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`OrganizationIDuuid.UUID `db:"organization_id" json:"organization_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Roles          []string  `db:"roles" json:"roles"`}

func (OrganizationMember)RBACObjectadded inv0.6.0

func (mOrganizationMember) RBACObject()rbac.Object

typeParameterDestinationScheme

type ParameterDestinationSchemestring
const (ParameterDestinationSchemeNoneParameterDestinationScheme = "none"ParameterDestinationSchemeEnvironmentVariableParameterDestinationScheme = "environment_variable"ParameterDestinationSchemeProvisionerVariableParameterDestinationScheme = "provisioner_variable")

funcAllParameterDestinationSchemeValuesadded inv0.15.2

func AllParameterDestinationSchemeValues() []ParameterDestinationScheme

func (*ParameterDestinationScheme)Scan

func (e *ParameterDestinationScheme) Scan(src interface{})error

func (ParameterDestinationScheme)Validadded inv0.15.2

typeParameterSchema

type ParameterSchema struct {IDuuid.UUID                  `db:"id" json:"id"`CreatedAttime.Time                  `db:"created_at" json:"created_at"`JobIDuuid.UUID                  `db:"job_id" json:"job_id"`Namestring                     `db:"name" json:"name"`Descriptionstring                     `db:"description" json:"description"`DefaultSourceSchemeParameterSourceScheme      `db:"default_source_scheme" json:"default_source_scheme"`DefaultSourceValuestring                     `db:"default_source_value" json:"default_source_value"`AllowOverrideSourcebool                       `db:"allow_override_source" json:"allow_override_source"`DefaultDestinationSchemeParameterDestinationScheme `db:"default_destination_scheme" json:"default_destination_scheme"`AllowOverrideDestinationbool                       `db:"allow_override_destination" json:"allow_override_destination"`DefaultRefreshstring                     `db:"default_refresh" json:"default_refresh"`RedisplayValuebool                       `db:"redisplay_value" json:"redisplay_value"`ValidationErrorstring                     `db:"validation_error" json:"validation_error"`ValidationConditionstring                     `db:"validation_condition" json:"validation_condition"`ValidationTypeSystemParameterTypeSystem        `db:"validation_type_system" json:"validation_type_system"`ValidationValueTypestring                     `db:"validation_value_type" json:"validation_value_type"`Indexint32                      `db:"index" json:"index"`}

typeParameterScope

type ParameterScopestring
const (ParameterScopeTemplateParameterScope = "template"ParameterScopeImportJobParameterScope = "import_job"ParameterScopeWorkspaceParameterScope = "workspace")

funcAllParameterScopeValuesadded inv0.15.2

func AllParameterScopeValues() []ParameterScope

func (*ParameterScope)Scan

func (e *ParameterScope) Scan(src interface{})error

func (ParameterScope)Validadded inv0.15.2

func (eParameterScope) Valid()bool

typeParameterSourceScheme

type ParameterSourceSchemestring
const (ParameterSourceSchemeNoneParameterSourceScheme = "none"ParameterSourceSchemeDataParameterSourceScheme = "data")

funcAllParameterSourceSchemeValuesadded inv0.15.2

func AllParameterSourceSchemeValues() []ParameterSourceScheme

func (*ParameterSourceScheme)Scan

func (e *ParameterSourceScheme) Scan(src interface{})error

func (ParameterSourceScheme)Validadded inv0.15.2

typeParameterTypeSystem

type ParameterTypeSystemstring
const (ParameterTypeSystemNoneParameterTypeSystem = "none"ParameterTypeSystemHCLParameterTypeSystem = "hcl")

funcAllParameterTypeSystemValuesadded inv0.15.2

func AllParameterTypeSystemValues() []ParameterTypeSystem

func (*ParameterTypeSystem)Scan

func (e *ParameterTypeSystem) Scan(src interface{})error

func (ParameterTypeSystem)Validadded inv0.15.2

func (eParameterTypeSystem) Valid()bool

typeParameterValue

type ParameterValue struct {IDuuid.UUID                  `db:"id" json:"id"`CreatedAttime.Time                  `db:"created_at" json:"created_at"`UpdatedAttime.Time                  `db:"updated_at" json:"updated_at"`ScopeParameterScope             `db:"scope" json:"scope"`ScopeIDuuid.UUID                  `db:"scope_id" json:"scope_id"`Namestring                     `db:"name" json:"name"`SourceSchemeParameterSourceScheme      `db:"source_scheme" json:"source_scheme"`SourceValuestring                     `db:"source_value" json:"source_value"`DestinationSchemeParameterDestinationScheme `db:"destination_scheme" json:"destination_scheme"`}

typeProvisionerDaemon

type ProvisionerDaemon struct {IDuuid.UUID         `db:"id" json:"id"`CreatedAttime.Time         `db:"created_at" json:"created_at"`UpdatedAtsql.NullTime      `db:"updated_at" json:"updated_at"`Namestring            `db:"name" json:"name"`Provisioners []ProvisionerType `db:"provisioners" json:"provisioners"`ReplicaIDuuid.NullUUID     `db:"replica_id" json:"replica_id"`TagsStringMap         `db:"tags" json:"tags"`}

func (ProvisionerDaemon)RBACObjectadded inv0.6.1

func (pProvisionerDaemon) RBACObject()rbac.Object

typeProvisionerJob

type ProvisionerJob struct {IDuuid.UUID                `db:"id" json:"id"`CreatedAttime.Time                `db:"created_at" json:"created_at"`UpdatedAttime.Time                `db:"updated_at" json:"updated_at"`StartedAtsql.NullTime             `db:"started_at" json:"started_at"`CanceledAtsql.NullTime             `db:"canceled_at" json:"canceled_at"`CompletedAtsql.NullTime             `db:"completed_at" json:"completed_at"`Errorsql.NullString           `db:"error" json:"error"`OrganizationIDuuid.UUID                `db:"organization_id" json:"organization_id"`InitiatorIDuuid.UUID                `db:"initiator_id" json:"initiator_id"`ProvisionerProvisionerType          `db:"provisioner" json:"provisioner"`StorageMethodProvisionerStorageMethod `db:"storage_method" json:"storage_method"`TypeProvisionerJobType       `db:"type" json:"type"`Inputjson.RawMessage          `db:"input" json:"input"`WorkerIDuuid.NullUUID            `db:"worker_id" json:"worker_id"`FileIDuuid.UUID                `db:"file_id" json:"file_id"`TagsStringMap                `db:"tags" json:"tags"`ErrorCodesql.NullString           `db:"error_code" json:"error_code"`TraceMetadatapqtype.NullRawMessage    `db:"trace_metadata" json:"trace_metadata"`}

typeProvisionerJobLog

type ProvisionerJobLog struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`SourceLogSource `db:"source" json:"source"`LevelLogLevel  `db:"level" json:"level"`Stagestring    `db:"stage" json:"stage"`Outputstring    `db:"output" json:"output"`IDint64     `db:"id" json:"id"`}

typeProvisionerJobType

type ProvisionerJobTypestring
const (ProvisionerJobTypeTemplateVersionImportProvisionerJobType = "template_version_import"ProvisionerJobTypeWorkspaceBuildProvisionerJobType = "workspace_build"ProvisionerJobTypeTemplateVersionDryRunProvisionerJobType = "template_version_dry_run")

funcAllProvisionerJobTypeValuesadded inv0.15.2

func AllProvisionerJobTypeValues() []ProvisionerJobType

func (*ProvisionerJobType)Scan

func (e *ProvisionerJobType) Scan(src interface{})error

func (ProvisionerJobType)Validadded inv0.15.2

func (eProvisionerJobType) Valid()bool

typeProvisionerStorageMethod

type ProvisionerStorageMethodstring
const (ProvisionerStorageMethodFileProvisionerStorageMethod = "file")

funcAllProvisionerStorageMethodValuesadded inv0.15.2

func AllProvisionerStorageMethodValues() []ProvisionerStorageMethod

func (*ProvisionerStorageMethod)Scan

func (e *ProvisionerStorageMethod) Scan(src interface{})error

func (ProvisionerStorageMethod)Validadded inv0.15.2

typeProvisionerType

type ProvisionerTypestring
const (ProvisionerTypeEchoProvisionerType = "echo"ProvisionerTypeTerraformProvisionerType = "terraform")

funcAllProvisionerTypeValuesadded inv0.15.2

func AllProvisionerTypeValues() []ProvisionerType

func (*ProvisionerType)Scan

func (e *ProvisionerType) Scan(src interface{})error

func (ProvisionerType)Validadded inv0.15.2

func (eProvisionerType) Valid()bool

typeRegisterWorkspaceProxyParamsadded inv0.23.0

type RegisterWorkspaceProxyParams struct {Urlstring    `db:"url" json:"url"`WildcardHostnamestring    `db:"wildcard_hostname" json:"wildcard_hostname"`IDuuid.UUID `db:"id" json:"id"`}

typeReplicaadded inv0.10.0

type Replica struct {IDuuid.UUID    `db:"id" json:"id"`CreatedAttime.Time    `db:"created_at" json:"created_at"`StartedAttime.Time    `db:"started_at" json:"started_at"`StoppedAtsql.NullTime `db:"stopped_at" json:"stopped_at"`UpdatedAttime.Time    `db:"updated_at" json:"updated_at"`Hostnamestring       `db:"hostname" json:"hostname"`RegionIDint32        `db:"region_id" json:"region_id"`RelayAddressstring       `db:"relay_address" json:"relay_address"`DatabaseLatencyint32        `db:"database_latency" json:"database_latency"`Versionstring       `db:"version" json:"version"`Errorstring       `db:"error" json:"error"`}

typeResourceTypeadded inv0.5.3

type ResourceTypestring
const (ResourceTypeOrganizationResourceType = "organization"ResourceTypeTemplateResourceType = "template"ResourceTypeTemplateVersionResourceType = "template_version"ResourceTypeUserResourceType = "user"ResourceTypeWorkspaceResourceType = "workspace"ResourceTypeGitSshKeyResourceType = "git_ssh_key"ResourceTypeApiKeyResourceType = "api_key"ResourceTypeGroupResourceType = "group"ResourceTypeWorkspaceBuildResourceType = "workspace_build"ResourceTypeLicenseResourceType = "license"ResourceTypeWorkspaceProxyResourceType = "workspace_proxy"ResourceTypeConvertLoginResourceType = "convert_login")

funcAllResourceTypeValuesadded inv0.15.2

func AllResourceTypeValues() []ResourceType

func (*ResourceType)Scanadded inv0.5.3

func (e *ResourceType) Scan(src interface{})error

func (ResourceType)Validadded inv0.15.2

func (eResourceType) Valid()bool

typeSiteConfigadded inv0.7.2

type SiteConfig struct {Keystring `db:"key" json:"key"`Valuestring `db:"value" json:"value"`}

typeStartupScriptBehavioradded inv0.24.0

type StartupScriptBehaviorstring
const (StartupScriptBehaviorBlockingStartupScriptBehavior = "blocking"StartupScriptBehaviorNonBlockingStartupScriptBehavior = "non-blocking")

funcAllStartupScriptBehaviorValuesadded inv0.24.0

func AllStartupScriptBehaviorValues() []StartupScriptBehavior

func (*StartupScriptBehavior)Scanadded inv0.24.0

func (e *StartupScriptBehavior) Scan(src interface{})error

func (StartupScriptBehavior)Validadded inv0.24.0

typeStore

type Store interface {Ping(ctxcontext.Context) (time.Duration,error)InTx(func(Store)error, *sql.TxOptions)error// contains filtered or unexported methods}

Store contains all queryable database functions.It extends the generated interface to add transaction support.

funcNew

func New(sdb *sql.DB)Store

New creates a new database store using a SQL database connection.

typeStringMapadded inv0.24.1

type StringMap map[string]string

func (*StringMap)Scanadded inv0.24.1

func (m *StringMap) Scan(src interface{})error

func (StringMap)Valueadded inv0.24.1

func (mStringMap) Value() (driver.Value,error)

typeTailnetAgentadded inv0.25.0

type TailnetAgent struct {IDuuid.UUID       `db:"id" json:"id"`CoordinatorIDuuid.UUID       `db:"coordinator_id" json:"coordinator_id"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`Nodejson.RawMessage `db:"node" json:"node"`}

typeTailnetClientadded inv0.25.0

type TailnetClient struct {IDuuid.UUID       `db:"id" json:"id"`CoordinatorIDuuid.UUID       `db:"coordinator_id" json:"coordinator_id"`AgentIDuuid.UUID       `db:"agent_id" json:"agent_id"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`Nodejson.RawMessage `db:"node" json:"node"`}

typeTailnetCoordinatoradded inv0.25.0

type TailnetCoordinator struct {IDuuid.UUID `db:"id" json:"id"`HeartbeatAttime.Time `db:"heartbeat_at" json:"heartbeat_at"`}

We keep this separate from replicas in case we need to break the coordinator out into its own service

typeTemplateadded inv0.4.0

type Template struct {IDuuid.UUID       `db:"id" json:"id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Deletedbool            `db:"deleted" json:"deleted"`Namestring          `db:"name" json:"name"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`ActiveVersionIDuuid.UUID       `db:"active_version_id" json:"active_version_id"`Descriptionstring          `db:"description" json:"description"`DefaultTTLint64           `db:"default_ttl" json:"default_ttl"`CreatedByuuid.UUID       `db:"created_by" json:"created_by"`Iconstring          `db:"icon" json:"icon"`UserACLTemplateACL     `db:"user_acl" json:"user_acl"`GroupACLTemplateACL     `db:"group_acl" json:"group_acl"`DisplayNamestring          `db:"display_name" json:"display_name"`AllowUserCancelWorkspaceJobsbool            `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`MaxTTLint64           `db:"max_ttl" json:"max_ttl"`AllowUserAutostartbool            `db:"allow_user_autostart" json:"allow_user_autostart"`AllowUserAutostopbool            `db:"allow_user_autostop" json:"allow_user_autostop"`FailureTTLint64           `db:"failure_ttl" json:"failure_ttl"`InactivityTTLint64           `db:"inactivity_ttl" json:"inactivity_ttl"`LockedTTLint64           `db:"locked_ttl" json:"locked_ttl"`RestartRequirementDaysOfWeekint16           `db:"restart_requirement_days_of_week" json:"restart_requirement_days_of_week"`RestartRequirementWeeksint64           `db:"restart_requirement_weeks" json:"restart_requirement_weeks"`CreatedByAvatarURLstring          `db:"created_by_avatar_url" json:"created_by_avatar_url"`CreatedByUsernamestring          `db:"created_by_username" json:"created_by_username"`}

Joins in the username + avatar url of the created by user.

func (Template)DeepCopyadded inv0.20.0

func (tTemplate) DeepCopy()Template

func (Template)RBACObjectadded inv0.6.0

func (tTemplate) RBACObject()rbac.Object

typeTemplateACLadded inv0.9.9

type TemplateACL map[string][]rbac.Action

TemplateACL is a map of ids to permissions.

func (*TemplateACL)Scanadded inv0.10.2

func (t *TemplateACL) Scan(src interface{})error

func (TemplateACL)Valueadded inv0.10.2

func (tTemplateACL) Value() (driver.Value,error)

typeTemplateGroupadded inv0.9.9

type TemplateGroup struct {GroupActionsActions `db:"actions"`}

typeTemplateTableadded inv0.26.2

type TemplateTable struct {IDuuid.UUID       `db:"id" json:"id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UpdatedAttime.Time       `db:"updated_at" json:"updated_at"`OrganizationIDuuid.UUID       `db:"organization_id" json:"organization_id"`Deletedbool            `db:"deleted" json:"deleted"`Namestring          `db:"name" json:"name"`ProvisionerProvisionerType `db:"provisioner" json:"provisioner"`ActiveVersionIDuuid.UUID       `db:"active_version_id" json:"active_version_id"`Descriptionstring          `db:"description" json:"description"`// The default duration for autostop for workspaces created from this template.DefaultTTLint64       `db:"default_ttl" json:"default_ttl"`CreatedByuuid.UUID   `db:"created_by" json:"created_by"`Iconstring      `db:"icon" json:"icon"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`GroupACLTemplateACL `db:"group_acl" json:"group_acl"`// Display name is a custom, human-friendly template name that user can set.DisplayNamestring `db:"display_name" json:"display_name"`// Allow users to cancel in-progress workspace jobs.AllowUserCancelWorkspaceJobsbool  `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`MaxTTLint64 `db:"max_ttl" json:"max_ttl"`// Allow users to specify an autostart schedule for workspaces (enterprise).AllowUserAutostartbool `db:"allow_user_autostart" json:"allow_user_autostart"`// Allow users to specify custom autostop values for workspaces (enterprise).AllowUserAutostopbool  `db:"allow_user_autostop" json:"allow_user_autostop"`FailureTTLint64 `db:"failure_ttl" json:"failure_ttl"`InactivityTTLint64 `db:"inactivity_ttl" json:"inactivity_ttl"`LockedTTLint64 `db:"locked_ttl" json:"locked_ttl"`// A bitmap of days of week to restart the workspace on, starting with Monday as the 0th bit, and Sunday as the 6th bit. The 7th bit is unused.RestartRequirementDaysOfWeekint16 `db:"restart_requirement_days_of_week" json:"restart_requirement_days_of_week"`// The number of weeks between restarts. 0 or 1 weeks means "every week", 2 week means "every second week", etc. Weeks are counted from January 2, 2023, which is the first Monday of 2023. This is to ensure workspaces are started consistently for all customers on the same n-week cycles.RestartRequirementWeeksint64 `db:"restart_requirement_weeks" json:"restart_requirement_weeks"`}

typeTemplateUseradded inv0.9.9

type TemplateUser struct {UserActionsActions `db:"actions"`}

typeTemplateVersionadded inv0.4.0

type TemplateVersion struct {IDuuid.UUID     `db:"id" json:"id"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`OrganizationIDuuid.UUID     `db:"organization_id" json:"organization_id"`CreatedAttime.Time     `db:"created_at" json:"created_at"`UpdatedAttime.Time     `db:"updated_at" json:"updated_at"`Namestring        `db:"name" json:"name"`Readmestring        `db:"readme" json:"readme"`JobIDuuid.UUID     `db:"job_id" json:"job_id"`CreatedByuuid.UUID     `db:"created_by" json:"created_by"`// IDs of Git auth providers for a specific template versionGitAuthProviders []string `db:"git_auth_providers" json:"git_auth_providers"`// Message describing the changes in this version of the template, similar to a Git commit message. Like a commit message, this should be a short, high-level description of the changes in this version of the template. This message is immutable and should not be updated after the fact.Messagestring `db:"message" json:"message"`}

func (TemplateVersion)RBACObjectadded inv0.6.0

func (TemplateVersion) RBACObject(templateTemplate)rbac.Object

func (TemplateVersion)RBACObjectNoTemplateadded inv0.17.2

func (vTemplateVersion) RBACObjectNoTemplate()rbac.Object

RBACObjectNoTemplate is for orphaned template versions.

typeTemplateVersionParameteradded inv0.15.0

type TemplateVersionParameter struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`// Parameter nameNamestring `db:"name" json:"name"`// Parameter descriptionDescriptionstring `db:"description" json:"description"`// Parameter typeTypestring `db:"type" json:"type"`// Is parameter mutable?Mutablebool `db:"mutable" json:"mutable"`// Default valueDefaultValuestring `db:"default_value" json:"default_value"`// IconIconstring `db:"icon" json:"icon"`// Additional optionsOptionsjson.RawMessage `db:"options" json:"options"`// Validation: regex patternValidationRegexstring `db:"validation_regex" json:"validation_regex"`// Validation: minimum length of valueValidationMinsql.NullInt32 `db:"validation_min" json:"validation_min"`// Validation: maximum length of valueValidationMaxsql.NullInt32 `db:"validation_max" json:"validation_max"`// Validation: error displayed when the regex does not match.ValidationErrorstring `db:"validation_error" json:"validation_error"`// Validation: consecutive values preserve the monotonic orderValidationMonotonicstring `db:"validation_monotonic" json:"validation_monotonic"`// Is parameter required?Requiredbool `db:"required" json:"required"`// Display name of the rich parameterDisplayNamestring `db:"display_name" json:"display_name"`// Specifies the order in which to display parameters in user interfaces.DisplayOrderint32 `db:"display_order" json:"display_order"`// The value of an ephemeral parameter will not be preserved between consecutive workspace builds.Ephemeralbool `db:"ephemeral" json:"ephemeral"`}

typeTemplateVersionVariableadded inv0.17.4

type TemplateVersionVariable struct {TemplateVersionIDuuid.UUID `db:"template_version_id" json:"template_version_id"`// Variable nameNamestring `db:"name" json:"name"`// Variable descriptionDescriptionstring `db:"description" json:"description"`// Variable typeTypestring `db:"type" json:"type"`// Variable valueValuestring `db:"value" json:"value"`// Variable default valueDefaultValuestring `db:"default_value" json:"default_value"`// Required variables needs a default value or a value provided by template adminRequiredbool `db:"required" json:"required"`// Sensitive variables have their values redacted in logs or site UISensitivebool `db:"sensitive" json:"sensitive"`}

typeUniqueConstraintadded inv0.8.7

type UniqueConstraintstring

UniqueConstraint represents a named unique constraint on a table.

const (UniqueFilesHashCreatedByKeyUniqueConstraint = "files_hash_created_by_key"// ALTER TABLE ONLY files ADD CONSTRAINT files_hash_created_by_key UNIQUE (hash, created_by);UniqueGitAuthLinksProviderIDUserIDKeyUniqueConstraint = "git_auth_links_provider_id_user_id_key"// ALTER TABLE ONLY git_auth_links ADD CONSTRAINT git_auth_links_provider_id_user_id_key UNIQUE (provider_id, user_id);UniqueGroupMembersUserIDGroupIDKeyUniqueConstraint = "group_members_user_id_group_id_key"// ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_user_id_group_id_key UNIQUE (user_id, group_id);UniqueGroupsNameOrganizationIDKeyUniqueConstraint = "groups_name_organization_id_key"// ALTER TABLE ONLY groups ADD CONSTRAINT groups_name_organization_id_key UNIQUE (name, organization_id);UniqueLicensesJWTKeyUniqueConstraint = "licenses_jwt_key"// ALTER TABLE ONLY licenses ADD CONSTRAINT licenses_jwt_key UNIQUE (jwt);UniqueParameterSchemasJobIDNameKeyUniqueConstraint = "parameter_schemas_job_id_name_key"// ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_job_id_name_key UNIQUE (job_id, name);UniqueParameterValuesScopeIDNameKeyUniqueConstraint = "parameter_values_scope_id_name_key"// ALTER TABLE ONLY parameter_values ADD CONSTRAINT parameter_values_scope_id_name_key UNIQUE (scope_id, name);UniqueProvisionerDaemonsNameKeyUniqueConstraint = "provisioner_daemons_name_key"// ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_name_key UNIQUE (name);UniqueSiteConfigsKeyKeyUniqueConstraint = "site_configs_key_key"// ALTER TABLE ONLY site_configs ADD CONSTRAINT site_configs_key_key UNIQUE (key);UniqueTemplateVersionParametersTemplateVersionIDNameKeyUniqueConstraint = "template_version_parameters_template_version_id_name_key"// ALTER TABLE ONLY template_version_parameters ADD CONSTRAINT template_version_parameters_template_version_id_name_key UNIQUE (template_version_id, name);UniqueTemplateVersionVariablesTemplateVersionIDNameKeyUniqueConstraint = "template_version_variables_template_version_id_name_key"// ALTER TABLE ONLY template_version_variables ADD CONSTRAINT template_version_variables_template_version_id_name_key UNIQUE (template_version_id, name);UniqueTemplateVersionsTemplateIDNameKeyUniqueConstraint = "template_versions_template_id_name_key"// ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_template_id_name_key UNIQUE (template_id, name);UniqueWorkspaceAppsAgentIDSlugIndexUniqueConstraint = "workspace_apps_agent_id_slug_idx"// ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_agent_id_slug_idx UNIQUE (agent_id, slug);UniqueWorkspaceBuildParametersWorkspaceBuildIDNameKeyUniqueConstraint = "workspace_build_parameters_workspace_build_id_name_key"// ALTER TABLE ONLY workspace_build_parameters ADD CONSTRAINT workspace_build_parameters_workspace_build_id_name_key UNIQUE (workspace_build_id, name);UniqueWorkspaceBuildsJobIDKeyUniqueConstraint = "workspace_builds_job_id_key"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_job_id_key UNIQUE (job_id);UniqueWorkspaceBuildsWorkspaceIDBuildNumberKeyUniqueConstraint = "workspace_builds_workspace_id_build_number_key"// ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_workspace_id_build_number_key UNIQUE (workspace_id, build_number);UniqueWorkspaceResourceMetadataNameUniqueConstraint = "workspace_resource_metadata_name"// ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_name UNIQUE (workspace_resource_id, key);UniqueIndexApiKeyNameUniqueConstraint = "idx_api_key_name"// CREATE UNIQUE INDEX idx_api_key_name ON api_keys USING btree (user_id, token_name) WHERE (login_type = 'token'::login_type);UniqueIndexOrganizationNameUniqueConstraint = "idx_organization_name"// CREATE UNIQUE INDEX idx_organization_name ON organizations USING btree (name);UniqueIndexOrganizationNameLowerUniqueConstraint = "idx_organization_name_lower"// CREATE UNIQUE INDEX idx_organization_name_lower ON organizations USING btree (lower(name));UniqueIndexUsersEmailUniqueConstraint = "idx_users_email"// CREATE UNIQUE INDEX idx_users_email ON users USING btree (email) WHERE (deleted = false);UniqueIndexUsersUsernameUniqueConstraint = "idx_users_username"// CREATE UNIQUE INDEX idx_users_username ON users USING btree (username) WHERE (deleted = false);UniqueTemplatesOrganizationIDNameIndexUniqueConstraint = "templates_organization_id_name_idx"// CREATE UNIQUE INDEX templates_organization_id_name_idx ON templates USING btree (organization_id, lower((name)::text)) WHERE (deleted = false);UniqueUsersEmailLowerIndexUniqueConstraint = "users_email_lower_idx"// CREATE UNIQUE INDEX users_email_lower_idx ON users USING btree (lower(email)) WHERE (deleted = false);UniqueUsersUsernameLowerIndexUniqueConstraint = "users_username_lower_idx"// CREATE UNIQUE INDEX users_username_lower_idx ON users USING btree (lower(username)) WHERE (deleted = false);UniqueWorkspaceProxiesLowerNameIndexUniqueConstraint = "workspace_proxies_lower_name_idx"// CREATE UNIQUE INDEX workspace_proxies_lower_name_idx ON workspace_proxies USING btree (lower(name)) WHERE (deleted = false);UniqueWorkspacesOwnerIDLowerIndexUniqueConstraint = "workspaces_owner_id_lower_idx"// CREATE UNIQUE INDEX workspaces_owner_id_lower_idx ON workspaces USING btree (owner_id, lower((name)::text)) WHERE (deleted = false);)

UniqueConstraint enums.

typeUpdateAPIKeyByIDParams

type UpdateAPIKeyByIDParams struct {IDstring      `db:"id" json:"id"`LastUsedtime.Time   `db:"last_used" json:"last_used"`ExpiresAttime.Time   `db:"expires_at" json:"expires_at"`IPAddresspqtype.Inet `db:"ip_address" json:"ip_address"`}

typeUpdateGitAuthLinkParamsadded inv0.11.0

type UpdateGitAuthLinkParams struct {ProviderIDstring    `db:"provider_id" json:"provider_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`OAuthAccessTokenstring    `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring    `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`}

typeUpdateGitSSHKeyParamsadded inv0.4.0

type UpdateGitSSHKeyParams struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`PrivateKeystring    `db:"private_key" json:"private_key"`PublicKeystring    `db:"public_key" json:"public_key"`}

typeUpdateGroupByIDParamsadded inv0.9.9

type UpdateGroupByIDParams struct {Namestring    `db:"name" json:"name"`AvatarURLstring    `db:"avatar_url" json:"avatar_url"`QuotaAllowanceint32     `db:"quota_allowance" json:"quota_allowance"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateMemberRolesParamsadded inv0.5.2

type UpdateMemberRolesParams struct {GrantedRoles []string  `db:"granted_roles" json:"granted_roles"`UserIDuuid.UUID `db:"user_id" json:"user_id"`OrgIDuuid.UUID `db:"org_id" json:"org_id"`}

typeUpdateProvisionerJobByIDParams

type UpdateProvisionerJobByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateProvisionerJobWithCancelByIDParams

type UpdateProvisionerJobWithCancelByIDParams struct {IDuuid.UUID    `db:"id" json:"id"`CanceledAtsql.NullTime `db:"canceled_at" json:"canceled_at"`CompletedAtsql.NullTime `db:"completed_at" json:"completed_at"`}

typeUpdateProvisionerJobWithCompleteByIDParams

type UpdateProvisionerJobWithCompleteByIDParams struct {IDuuid.UUID      `db:"id" json:"id"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`CompletedAtsql.NullTime   `db:"completed_at" json:"completed_at"`Errorsql.NullString `db:"error" json:"error"`ErrorCodesql.NullString `db:"error_code" json:"error_code"`}

typeUpdateReplicaParamsadded inv0.10.0

type UpdateReplicaParams struct {IDuuid.UUID    `db:"id" json:"id"`UpdatedAttime.Time    `db:"updated_at" json:"updated_at"`StartedAttime.Time    `db:"started_at" json:"started_at"`StoppedAtsql.NullTime `db:"stopped_at" json:"stopped_at"`RelayAddressstring       `db:"relay_address" json:"relay_address"`RegionIDint32        `db:"region_id" json:"region_id"`Hostnamestring       `db:"hostname" json:"hostname"`Versionstring       `db:"version" json:"version"`Errorstring       `db:"error" json:"error"`DatabaseLatencyint32        `db:"database_latency" json:"database_latency"`}

typeUpdateTemplateACLByIDParamsadded inv0.10.2

type UpdateTemplateACLByIDParams struct {GroupACLTemplateACL `db:"group_acl" json:"group_acl"`UserACLTemplateACL `db:"user_acl" json:"user_acl"`IDuuid.UUID   `db:"id" json:"id"`}

typeUpdateTemplateActiveVersionByIDParamsadded inv0.4.0

type UpdateTemplateActiveVersionByIDParams struct {IDuuid.UUID `db:"id" json:"id"`ActiveVersionIDuuid.UUID `db:"active_version_id" json:"active_version_id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateTemplateDeletedByIDParamsadded inv0.4.0

type UpdateTemplateDeletedByIDParams struct {IDuuid.UUID `db:"id" json:"id"`Deletedbool      `db:"deleted" json:"deleted"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateTemplateMetaByIDParamsadded inv0.6.3

type UpdateTemplateMetaByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`Descriptionstring    `db:"description" json:"description"`Namestring    `db:"name" json:"name"`Iconstring    `db:"icon" json:"icon"`DisplayNamestring    `db:"display_name" json:"display_name"`AllowUserCancelWorkspaceJobsbool      `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"`}

typeUpdateTemplateScheduleByIDParamsadded inv0.19.0

type UpdateTemplateScheduleByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`AllowUserAutostartbool      `db:"allow_user_autostart" json:"allow_user_autostart"`AllowUserAutostopbool      `db:"allow_user_autostop" json:"allow_user_autostop"`DefaultTTLint64     `db:"default_ttl" json:"default_ttl"`MaxTTLint64     `db:"max_ttl" json:"max_ttl"`RestartRequirementDaysOfWeekint16     `db:"restart_requirement_days_of_week" json:"restart_requirement_days_of_week"`RestartRequirementWeeksint64     `db:"restart_requirement_weeks" json:"restart_requirement_weeks"`FailureTTLint64     `db:"failure_ttl" json:"failure_ttl"`InactivityTTLint64     `db:"inactivity_ttl" json:"inactivity_ttl"`LockedTTLint64     `db:"locked_ttl" json:"locked_ttl"`}

typeUpdateTemplateVersionByIDParamsadded inv0.4.0

type UpdateTemplateVersionByIDParams struct {IDuuid.UUID     `db:"id" json:"id"`TemplateIDuuid.NullUUID `db:"template_id" json:"template_id"`UpdatedAttime.Time     `db:"updated_at" json:"updated_at"`Namestring        `db:"name" json:"name"`Messagestring        `db:"message" json:"message"`}

typeUpdateTemplateVersionDescriptionByJobIDParamsadded inv0.5.10

type UpdateTemplateVersionDescriptionByJobIDParams struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`Readmestring    `db:"readme" json:"readme"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateTemplateVersionGitAuthProvidersByJobIDParamsadded inv0.18.0

type UpdateTemplateVersionGitAuthProvidersByJobIDParams struct {JobIDuuid.UUID `db:"job_id" json:"job_id"`GitAuthProviders []string  `db:"git_auth_providers" json:"git_auth_providers"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateUserDeletedByIDParamsadded inv0.8.15

type UpdateUserDeletedByIDParams struct {IDuuid.UUID `db:"id" json:"id"`Deletedbool      `db:"deleted" json:"deleted"`}

typeUpdateUserHashedPasswordParamsadded inv0.5.5

type UpdateUserHashedPasswordParams struct {IDuuid.UUID `db:"id" json:"id"`HashedPassword []byte    `db:"hashed_password" json:"hashed_password"`}

typeUpdateUserLastSeenAtParamsadded inv0.9.0

type UpdateUserLastSeenAtParams struct {IDuuid.UUID `db:"id" json:"id"`LastSeenAttime.Time `db:"last_seen_at" json:"last_seen_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`}

typeUpdateUserLinkParamsadded inv0.8.6

type UpdateUserLinkParams struct {OAuthAccessTokenstring    `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring    `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`}

typeUpdateUserLinkedIDParamsadded inv0.8.6

type UpdateUserLinkedIDParams struct {LinkedIDstring    `db:"linked_id" json:"linked_id"`UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`}

typeUpdateUserLoginTypeParamsadded inv0.25.0

type UpdateUserLoginTypeParams struct {NewLoginTypeLoginType `db:"new_login_type" json:"new_login_type"`UserIDuuid.UUID `db:"user_id" json:"user_id"`}

typeUpdateUserProfileParamsadded inv0.4.2

type UpdateUserProfileParams struct {IDuuid.UUID      `db:"id" json:"id"`Emailstring         `db:"email" json:"email"`Usernamestring         `db:"username" json:"username"`AvatarURLsql.NullString `db:"avatar_url" json:"avatar_url"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`}

typeUpdateUserQuietHoursScheduleParamsadded inv0.26.2

type UpdateUserQuietHoursScheduleParams struct {IDuuid.UUID `db:"id" json:"id"`QuietHoursSchedulestring    `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`}

typeUpdateUserRolesParamsadded inv0.5.2

type UpdateUserRolesParams struct {GrantedRoles []string  `db:"granted_roles" json:"granted_roles"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateUserStatusParamsadded inv0.5.1

type UpdateUserStatusParams struct {IDuuid.UUID  `db:"id" json:"id"`StatusUserStatus `db:"status" json:"status"`UpdatedAttime.Time  `db:"updated_at" json:"updated_at"`}

typeUpdateWorkspaceAgentConnectionByIDParams

type UpdateWorkspaceAgentConnectionByIDParams struct {IDuuid.UUID     `db:"id" json:"id"`FirstConnectedAtsql.NullTime  `db:"first_connected_at" json:"first_connected_at"`LastConnectedAtsql.NullTime  `db:"last_connected_at" json:"last_connected_at"`LastConnectedReplicaIDuuid.NullUUID `db:"last_connected_replica_id" json:"last_connected_replica_id"`DisconnectedAtsql.NullTime  `db:"disconnected_at" json:"disconnected_at"`UpdatedAttime.Time     `db:"updated_at" json:"updated_at"`}

typeUpdateWorkspaceAgentLifecycleStateByIDParamsadded inv0.15.3

type UpdateWorkspaceAgentLifecycleStateByIDParams struct {IDuuid.UUID                    `db:"id" json:"id"`LifecycleStateWorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"`StartedAtsql.NullTime                 `db:"started_at" json:"started_at"`ReadyAtsql.NullTime                 `db:"ready_at" json:"ready_at"`}

typeUpdateWorkspaceAgentMetadataParamsadded inv0.21.3

type UpdateWorkspaceAgentMetadataParams struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`Keystring    `db:"key" json:"key"`Valuestring    `db:"value" json:"value"`Errorstring    `db:"error" json:"error"`CollectedAttime.Time `db:"collected_at" json:"collected_at"`}

typeUpdateWorkspaceAgentStartupByIDParamsadded inv0.17.1

type UpdateWorkspaceAgentStartupByIDParams struct {IDuuid.UUID               `db:"id" json:"id"`Versionstring                  `db:"version" json:"version"`ExpandedDirectorystring                  `db:"expanded_directory" json:"expanded_directory"`SubsystemWorkspaceAgentSubsystem `db:"subsystem" json:"subsystem"`}

typeUpdateWorkspaceAgentStartupLogOverflowByIDParamsadded inv0.21.0

type UpdateWorkspaceAgentStartupLogOverflowByIDParams struct {IDuuid.UUID `db:"id" json:"id"`StartupLogsOverflowedbool      `db:"startup_logs_overflowed" json:"startup_logs_overflowed"`}

typeUpdateWorkspaceAppHealthByIDParamsadded inv0.9.0

type UpdateWorkspaceAppHealthByIDParams struct {IDuuid.UUID          `db:"id" json:"id"`HealthWorkspaceAppHealth `db:"health" json:"health"`}

typeUpdateWorkspaceAutostartParamsadded inv0.4.1

type UpdateWorkspaceAutostartParams struct {IDuuid.UUID      `db:"id" json:"id"`AutostartSchedulesql.NullString `db:"autostart_schedule" json:"autostart_schedule"`}

typeUpdateWorkspaceBuildByIDParams

type UpdateWorkspaceBuildByIDParams struct {IDuuid.UUID `db:"id" json:"id"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`ProvisionerState []byte    `db:"provisioner_state" json:"provisioner_state"`Deadlinetime.Time `db:"deadline" json:"deadline"`MaxDeadlinetime.Time `db:"max_deadline" json:"max_deadline"`}

typeUpdateWorkspaceBuildCostByIDParamsadded inv0.12.7

type UpdateWorkspaceBuildCostByIDParams struct {IDuuid.UUID `db:"id" json:"id"`DailyCostint32     `db:"daily_cost" json:"daily_cost"`}

typeUpdateWorkspaceDeletedByIDParams

type UpdateWorkspaceDeletedByIDParams struct {IDuuid.UUID `db:"id" json:"id"`Deletedbool      `db:"deleted" json:"deleted"`}

typeUpdateWorkspaceLastUsedAtParamsadded inv0.8.12

type UpdateWorkspaceLastUsedAtParams struct {IDuuid.UUID `db:"id" json:"id"`LastUsedAttime.Time `db:"last_used_at" json:"last_used_at"`}

typeUpdateWorkspaceLockedDeletingAtParamsadded inv0.26.2

type UpdateWorkspaceLockedDeletingAtParams struct {IDuuid.UUID    `db:"id" json:"id"`LockedAtsql.NullTime `db:"locked_at" json:"locked_at"`}

typeUpdateWorkspaceParamsadded inv0.8.7

type UpdateWorkspaceParams struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`}

typeUpdateWorkspaceProxyDeletedParamsadded inv0.22.0

type UpdateWorkspaceProxyDeletedParams struct {Deletedbool      `db:"deleted" json:"deleted"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateWorkspaceProxyParamsadded inv0.22.0

type UpdateWorkspaceProxyParams struct {Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`Iconstring    `db:"icon" json:"icon"`TokenHashedSecret []byte    `db:"token_hashed_secret" json:"token_hashed_secret"`IDuuid.UUID `db:"id" json:"id"`}

typeUpdateWorkspaceTTLParamsadded inv0.6.0

type UpdateWorkspaceTTLParams struct {IDuuid.UUID     `db:"id" json:"id"`Ttlsql.NullInt64 `db:"ttl" json:"ttl"`}

typeUpdateWorkspacesDeletingAtByTemplateIDParamsadded inv0.26.2

type UpdateWorkspacesDeletingAtByTemplateIDParams struct {LockedTtlMsint64     `db:"locked_ttl_ms" json:"locked_ttl_ms"`TemplateIDuuid.UUID `db:"template_id" json:"template_id"`}

typeUpsertDefaultProxyParamsadded inv0.24.0

type UpsertDefaultProxyParams struct {DisplayNamestring `db:"display_name" json:"display_name"`IconUrlstring `db:"icon_url" json:"icon_url"`}

typeUpsertTailnetAgentParamsadded inv0.25.0

type UpsertTailnetAgentParams struct {IDuuid.UUID       `db:"id" json:"id"`CoordinatorIDuuid.UUID       `db:"coordinator_id" json:"coordinator_id"`Nodejson.RawMessage `db:"node" json:"node"`}

typeUpsertTailnetClientParamsadded inv0.25.0

type UpsertTailnetClientParams struct {IDuuid.UUID       `db:"id" json:"id"`CoordinatorIDuuid.UUID       `db:"coordinator_id" json:"coordinator_id"`AgentIDuuid.UUID       `db:"agent_id" json:"agent_id"`Nodejson.RawMessage `db:"node" json:"node"`}

typeUser

type User struct {IDuuid.UUID      `db:"id" json:"id"`Emailstring         `db:"email" json:"email"`Usernamestring         `db:"username" json:"username"`HashedPassword []byte         `db:"hashed_password" json:"hashed_password"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`StatusUserStatus     `db:"status" json:"status"`RBACRolespq.StringArray `db:"rbac_roles" json:"rbac_roles"`LoginTypeLoginType      `db:"login_type" json:"login_type"`AvatarURLsql.NullString `db:"avatar_url" json:"avatar_url"`Deletedbool           `db:"deleted" json:"deleted"`LastSeenAttime.Time      `db:"last_seen_at" json:"last_seen_at"`// Daily (!) cron schedule (with optional CRON_TZ) signifying the start of the user's quiet hours. If empty, the default quiet hours on the instance is used instead.QuietHoursSchedulestring `db:"quiet_hours_schedule" json:"quiet_hours_schedule"`}

funcConvertUserRowsadded inv0.12.8

func ConvertUserRows(rows []GetUsersRow) []User

func (User)RBACObjectadded inv0.7.5

func (uUser) RBACObject()rbac.Object

RBACObject returns the RBAC object for the site wide user resource.If you are trying to get the RBAC object for the UserData, useu.UserDataRBACObject() instead.

func (User)UserDataRBACObjectadded inv0.15.1

func (uUser) UserDataRBACObject()rbac.Object

typeUserLinkadded inv0.8.6

type UserLink struct {UserIDuuid.UUID `db:"user_id" json:"user_id"`LoginTypeLoginType `db:"login_type" json:"login_type"`LinkedIDstring    `db:"linked_id" json:"linked_id"`OAuthAccessTokenstring    `db:"oauth_access_token" json:"oauth_access_token"`OAuthRefreshTokenstring    `db:"oauth_refresh_token" json:"oauth_refresh_token"`OAuthExpirytime.Time `db:"oauth_expiry" json:"oauth_expiry"`}

func (UserLink)RBACObjectadded inv0.17.2

func (uUserLink) RBACObject()rbac.Object

typeUserStatusadded inv0.5.1

type UserStatusstring
const (UserStatusActiveUserStatus = "active"UserStatusSuspendedUserStatus = "suspended")

funcAllUserStatusValuesadded inv0.15.2

func AllUserStatusValues() []UserStatus

func (*UserStatus)Scanadded inv0.5.1

func (e *UserStatus) Scan(src interface{})error

func (UserStatus)Validadded inv0.15.2

func (eUserStatus) Valid()bool

typeVisibleUseradded inv0.26.2

type VisibleUser struct {IDuuid.UUID      `db:"id" json:"id"`Usernamestring         `db:"username" json:"username"`AvatarURLsql.NullString `db:"avatar_url" json:"avatar_url"`}

Visible fields of users are allowed to be joined with other tables for including context of other resources.

typeWorkspace

type Workspace struct {IDuuid.UUID      `db:"id" json:"id"`CreatedAttime.Time      `db:"created_at" json:"created_at"`UpdatedAttime.Time      `db:"updated_at" json:"updated_at"`OwnerIDuuid.UUID      `db:"owner_id" json:"owner_id"`OrganizationIDuuid.UUID      `db:"organization_id" json:"organization_id"`TemplateIDuuid.UUID      `db:"template_id" json:"template_id"`Deletedbool           `db:"deleted" json:"deleted"`Namestring         `db:"name" json:"name"`AutostartSchedulesql.NullString `db:"autostart_schedule" json:"autostart_schedule"`Ttlsql.NullInt64  `db:"ttl" json:"ttl"`LastUsedAttime.Time      `db:"last_used_at" json:"last_used_at"`LockedAtsql.NullTime   `db:"locked_at" json:"locked_at"`DeletingAtsql.NullTime   `db:"deleting_at" json:"deleting_at"`}

funcConvertWorkspaceRowsadded inv0.12.8

func ConvertWorkspaceRows(rows []GetWorkspacesRow) []Workspace

func (Workspace)ApplicationConnectRBACadded inv0.9.0

func (wWorkspace) ApplicationConnectRBAC()rbac.Object

func (Workspace)ExecutionRBACadded inv0.8.6

func (wWorkspace) ExecutionRBAC()rbac.Object

func (Workspace)LockedRBACadded inv0.25.0

func (wWorkspace) LockedRBAC()rbac.Object

func (Workspace)RBACObjectadded inv0.6.0

func (wWorkspace) RBACObject()rbac.Object

func (Workspace)WorkspaceBuildRBACadded inv0.25.0

func (wWorkspace) WorkspaceBuildRBAC(transitionWorkspaceTransition)rbac.Object

typeWorkspaceAgent

type WorkspaceAgent struct {IDuuid.UUID             `db:"id" json:"id"`CreatedAttime.Time             `db:"created_at" json:"created_at"`UpdatedAttime.Time             `db:"updated_at" json:"updated_at"`Namestring                `db:"name" json:"name"`FirstConnectedAtsql.NullTime          `db:"first_connected_at" json:"first_connected_at"`LastConnectedAtsql.NullTime          `db:"last_connected_at" json:"last_connected_at"`DisconnectedAtsql.NullTime          `db:"disconnected_at" json:"disconnected_at"`ResourceIDuuid.UUID             `db:"resource_id" json:"resource_id"`AuthTokenuuid.UUID             `db:"auth_token" json:"auth_token"`AuthInstanceIDsql.NullString        `db:"auth_instance_id" json:"auth_instance_id"`Architecturestring                `db:"architecture" json:"architecture"`EnvironmentVariablespqtype.NullRawMessage `db:"environment_variables" json:"environment_variables"`OperatingSystemstring                `db:"operating_system" json:"operating_system"`StartupScriptsql.NullString        `db:"startup_script" json:"startup_script"`InstanceMetadatapqtype.NullRawMessage `db:"instance_metadata" json:"instance_metadata"`ResourceMetadatapqtype.NullRawMessage `db:"resource_metadata" json:"resource_metadata"`Directorystring                `db:"directory" json:"directory"`// Version tracks the version of the currently running workspace agent. Workspace agents register their version upon start.Versionstring        `db:"version" json:"version"`LastConnectedReplicaIDuuid.NullUUID `db:"last_connected_replica_id" json:"last_connected_replica_id"`// Connection timeout in seconds, 0 means disabled.ConnectionTimeoutSecondsint32 `db:"connection_timeout_seconds" json:"connection_timeout_seconds"`// URL for troubleshooting the agent.TroubleshootingURLstring `db:"troubleshooting_url" json:"troubleshooting_url"`// Path to file inside workspace containing the message of the day (MOTD) to show to the user when logging in via SSH.MOTDFilestring `db:"motd_file" json:"motd_file"`// The current lifecycle state reported by the workspace agent.LifecycleStateWorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"`// The number of seconds to wait for the startup script to complete. If the script does not complete within this time, the agent lifecycle will be marked as start_timeout.StartupScriptTimeoutSecondsint32 `db:"startup_script_timeout_seconds" json:"startup_script_timeout_seconds"`// The resolved path of a user-specified directory. e.g. ~/coder -> /home/coder/coderExpandedDirectorystring `db:"expanded_directory" json:"expanded_directory"`// Script that is executed before the agent is stopped.ShutdownScriptsql.NullString `db:"shutdown_script" json:"shutdown_script"`// The number of seconds to wait for the shutdown script to complete. If the script does not complete within this time, the agent lifecycle will be marked as shutdown_timeout.ShutdownScriptTimeoutSecondsint32 `db:"shutdown_script_timeout_seconds" json:"shutdown_script_timeout_seconds"`// Total length of startup logsStartupLogsLengthint32 `db:"startup_logs_length" json:"startup_logs_length"`// Whether the startup logs overflowed in lengthStartupLogsOverflowedbool                    `db:"startup_logs_overflowed" json:"startup_logs_overflowed"`SubsystemWorkspaceAgentSubsystem `db:"subsystem" json:"subsystem"`// When startup script behavior is non-blocking, the workspace will be ready and accessible upon agent connection, when it is blocking, workspace will wait for the startup script to complete before becoming ready and accessible.StartupScriptBehaviorStartupScriptBehavior `db:"startup_script_behavior" json:"startup_script_behavior"`// The time the agent entered the starting lifecycle stateStartedAtsql.NullTime `db:"started_at" json:"started_at"`// The time the agent entered the ready or start_error lifecycle stateReadyAtsql.NullTime `db:"ready_at" json:"ready_at"`}

func (WorkspaceAgent)Statusadded inv0.21.3

typeWorkspaceAgentConnectionStatusadded inv0.21.3

type WorkspaceAgentConnectionStatus struct {StatusWorkspaceAgentStatus `json:"status"`FirstConnectedAt *time.Time           `json:"first_connected_at"`LastConnectedAt  *time.Time           `json:"last_connected_at"`DisconnectedAt   *time.Time           `json:"disconnected_at"`}

typeWorkspaceAgentLifecycleStateadded inv0.15.3

type WorkspaceAgentLifecycleStatestring
const (WorkspaceAgentLifecycleStateCreatedWorkspaceAgentLifecycleState = "created"WorkspaceAgentLifecycleStateStartingWorkspaceAgentLifecycleState = "starting"WorkspaceAgentLifecycleStateStartTimeoutWorkspaceAgentLifecycleState = "start_timeout"WorkspaceAgentLifecycleStateStartErrorWorkspaceAgentLifecycleState = "start_error"WorkspaceAgentLifecycleStateReadyWorkspaceAgentLifecycleState = "ready"WorkspaceAgentLifecycleStateShuttingDownWorkspaceAgentLifecycleState = "shutting_down"WorkspaceAgentLifecycleStateShutdownTimeoutWorkspaceAgentLifecycleState = "shutdown_timeout"WorkspaceAgentLifecycleStateShutdownErrorWorkspaceAgentLifecycleState = "shutdown_error"WorkspaceAgentLifecycleStateOffWorkspaceAgentLifecycleState = "off")

funcAllWorkspaceAgentLifecycleStateValuesadded inv0.15.3

func AllWorkspaceAgentLifecycleStateValues() []WorkspaceAgentLifecycleState

func (*WorkspaceAgentLifecycleState)Scanadded inv0.15.3

func (e *WorkspaceAgentLifecycleState) Scan(src interface{})error

func (WorkspaceAgentLifecycleState)Validadded inv0.15.3

typeWorkspaceAgentMetadatumadded inv0.21.3

type WorkspaceAgentMetadatum struct {WorkspaceAgentIDuuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"`DisplayNamestring    `db:"display_name" json:"display_name"`Keystring    `db:"key" json:"key"`Scriptstring    `db:"script" json:"script"`Valuestring    `db:"value" json:"value"`Errorstring    `db:"error" json:"error"`Timeoutint64     `db:"timeout" json:"timeout"`Intervalint64     `db:"interval" json:"interval"`CollectedAttime.Time `db:"collected_at" json:"collected_at"`}

typeWorkspaceAgentStartupLogadded inv0.21.0

type WorkspaceAgentStartupLog struct {AgentIDuuid.UUID `db:"agent_id" json:"agent_id"`CreatedAttime.Time `db:"created_at" json:"created_at"`Outputstring    `db:"output" json:"output"`IDint64     `db:"id" json:"id"`LevelLogLevel  `db:"level" json:"level"`}

typeWorkspaceAgentStatadded inv0.18.0

type WorkspaceAgentStat struct {IDuuid.UUID       `db:"id" json:"id"`CreatedAttime.Time       `db:"created_at" json:"created_at"`UserIDuuid.UUID       `db:"user_id" json:"user_id"`AgentIDuuid.UUID       `db:"agent_id" json:"agent_id"`WorkspaceIDuuid.UUID       `db:"workspace_id" json:"workspace_id"`TemplateIDuuid.UUID       `db:"template_id" json:"template_id"`ConnectionsByProtojson.RawMessage `db:"connections_by_proto" json:"connections_by_proto"`ConnectionCountint64           `db:"connection_count" json:"connection_count"`RxPacketsint64           `db:"rx_packets" json:"rx_packets"`RxBytesint64           `db:"rx_bytes" json:"rx_bytes"`TxPacketsint64           `db:"tx_packets" json:"tx_packets"`TxBytesint64           `db:"tx_bytes" json:"tx_bytes"`ConnectionMedianLatencyMSfloat64         `db:"connection_median_latency_ms" json:"connection_median_latency_ms"`SessionCountVSCodeint64           `db:"session_count_vscode" json:"session_count_vscode"`SessionCountJetBrainsint64           `db:"session_count_jetbrains" json:"session_count_jetbrains"`SessionCountReconnectingPTYint64           `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"`SessionCountSSHint64           `db:"session_count_ssh" json:"session_count_ssh"`}

typeWorkspaceAgentStatusadded inv0.21.3

type WorkspaceAgentStatusstring
const (WorkspaceAgentStatusConnectingWorkspaceAgentStatus = "connecting"WorkspaceAgentStatusConnectedWorkspaceAgentStatus = "connected"WorkspaceAgentStatusDisconnectedWorkspaceAgentStatus = "disconnected"WorkspaceAgentStatusTimeoutWorkspaceAgentStatus = "timeout")

This is also in codersdk/workspaceagents.go and should be kept in sync.

func (WorkspaceAgentStatus)Validadded inv0.21.3

func (sWorkspaceAgentStatus) Valid()bool

typeWorkspaceAgentSubsystemadded inv0.23.5

type WorkspaceAgentSubsystemstring
const (WorkspaceAgentSubsystemEnvbuilderWorkspaceAgentSubsystem = "envbuilder"WorkspaceAgentSubsystemEnvboxWorkspaceAgentSubsystem = "envbox"WorkspaceAgentSubsystemNoneWorkspaceAgentSubsystem = "none")

funcAllWorkspaceAgentSubsystemValuesadded inv0.23.5

func AllWorkspaceAgentSubsystemValues() []WorkspaceAgentSubsystem

func (*WorkspaceAgentSubsystem)Scanadded inv0.23.5

func (e *WorkspaceAgentSubsystem) Scan(src interface{})error

func (WorkspaceAgentSubsystem)Validadded inv0.23.5

typeWorkspaceAppadded inv0.6.2

type WorkspaceApp struct {IDuuid.UUID          `db:"id" json:"id"`CreatedAttime.Time          `db:"created_at" json:"created_at"`AgentIDuuid.UUID          `db:"agent_id" json:"agent_id"`DisplayNamestring             `db:"display_name" json:"display_name"`Iconstring             `db:"icon" json:"icon"`Commandsql.NullString     `db:"command" json:"command"`Urlsql.NullString     `db:"url" json:"url"`HealthcheckUrlstring             `db:"healthcheck_url" json:"healthcheck_url"`HealthcheckIntervalint32              `db:"healthcheck_interval" json:"healthcheck_interval"`HealthcheckThresholdint32              `db:"healthcheck_threshold" json:"healthcheck_threshold"`HealthWorkspaceAppHealth `db:"health" json:"health"`Subdomainbool               `db:"subdomain" json:"subdomain"`SharingLevelAppSharingLevel    `db:"sharing_level" json:"sharing_level"`Slugstring             `db:"slug" json:"slug"`Externalbool               `db:"external" json:"external"`}

typeWorkspaceAppHealthadded inv0.9.0

type WorkspaceAppHealthstring
const (WorkspaceAppHealthDisabledWorkspaceAppHealth = "disabled"WorkspaceAppHealthInitializingWorkspaceAppHealth = "initializing"WorkspaceAppHealthHealthyWorkspaceAppHealth = "healthy"WorkspaceAppHealthUnhealthyWorkspaceAppHealth = "unhealthy")

funcAllWorkspaceAppHealthValuesadded inv0.15.2

func AllWorkspaceAppHealthValues() []WorkspaceAppHealth

func (*WorkspaceAppHealth)Scanadded inv0.9.0

func (e *WorkspaceAppHealth) Scan(src interface{})error

func (WorkspaceAppHealth)Validadded inv0.15.2

func (eWorkspaceAppHealth) Valid()bool

typeWorkspaceBuild

type WorkspaceBuild struct {IDuuid.UUID           `db:"id" json:"id"`CreatedAttime.Time           `db:"created_at" json:"created_at"`UpdatedAttime.Time           `db:"updated_at" json:"updated_at"`WorkspaceIDuuid.UUID           `db:"workspace_id" json:"workspace_id"`TemplateVersionIDuuid.UUID           `db:"template_version_id" json:"template_version_id"`BuildNumberint32               `db:"build_number" json:"build_number"`TransitionWorkspaceTransition `db:"transition" json:"transition"`InitiatorIDuuid.UUID           `db:"initiator_id" json:"initiator_id"`ProvisionerState  []byte              `db:"provisioner_state" json:"provisioner_state"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`Deadlinetime.Time           `db:"deadline" json:"deadline"`ReasonBuildReason         `db:"reason" json:"reason"`DailyCostint32               `db:"daily_cost" json:"daily_cost"`MaxDeadlinetime.Time           `db:"max_deadline" json:"max_deadline"`}

typeWorkspaceBuildParameteradded inv0.15.0

type WorkspaceBuildParameter struct {WorkspaceBuildIDuuid.UUID `db:"workspace_build_id" json:"workspace_build_id"`// Parameter nameNamestring `db:"name" json:"name"`// Parameter valueValuestring `db:"value" json:"value"`}

typeWorkspaceProxyadded inv0.22.0

type WorkspaceProxy struct {IDuuid.UUID `db:"id" json:"id"`Namestring    `db:"name" json:"name"`DisplayNamestring    `db:"display_name" json:"display_name"`// Expects an emoji character. (/emojis/1f1fa-1f1f8.png)Iconstring `db:"icon" json:"icon"`// Full url including scheme of the proxy api url:https://us.example.comUrlstring `db:"url" json:"url"`// Hostname with the wildcard for subdomain based app hosting: *.us.example.comWildcardHostnamestring    `db:"wildcard_hostname" json:"wildcard_hostname"`CreatedAttime.Time `db:"created_at" json:"created_at"`UpdatedAttime.Time `db:"updated_at" json:"updated_at"`// Boolean indicator of a deleted workspace proxy. Proxies are soft-deleted.Deletedbool `db:"deleted" json:"deleted"`// Hashed secret is used to authenticate the workspace proxy using a session token.TokenHashedSecret []byte `db:"token_hashed_secret" json:"token_hashed_secret"`}

func (WorkspaceProxy)IsPrimaryadded inv0.24.0

func (wWorkspaceProxy) IsPrimary()bool

func (WorkspaceProxy)RBACObjectadded inv0.22.0

func (wWorkspaceProxy) RBACObject()rbac.Object

typeWorkspaceResource

type WorkspaceResource struct {IDuuid.UUID           `db:"id" json:"id"`CreatedAttime.Time           `db:"created_at" json:"created_at"`JobIDuuid.UUID           `db:"job_id" json:"job_id"`TransitionWorkspaceTransition `db:"transition" json:"transition"`Typestring              `db:"type" json:"type"`Namestring              `db:"name" json:"name"`Hidebool                `db:"hide" json:"hide"`Iconstring              `db:"icon" json:"icon"`InstanceTypesql.NullString      `db:"instance_type" json:"instance_type"`DailyCostint32               `db:"daily_cost" json:"daily_cost"`}

typeWorkspaceResourceMetadatumadded inv0.8.3

type WorkspaceResourceMetadatum struct {WorkspaceResourceIDuuid.UUID      `db:"workspace_resource_id" json:"workspace_resource_id"`Keystring         `db:"key" json:"key"`Valuesql.NullString `db:"value" json:"value"`Sensitivebool           `db:"sensitive" json:"sensitive"`IDint64          `db:"id" json:"id"`}

typeWorkspaceStatusadded inv0.18.1

type WorkspaceStatusstring
const (WorkspaceStatusPendingWorkspaceStatus = "pending"WorkspaceStatusStartingWorkspaceStatus = "starting"WorkspaceStatusRunningWorkspaceStatus = "running"WorkspaceStatusStoppingWorkspaceStatus = "stopping"WorkspaceStatusStoppedWorkspaceStatus = "stopped"WorkspaceStatusFailedWorkspaceStatus = "failed"WorkspaceStatusCancelingWorkspaceStatus = "canceling"WorkspaceStatusCanceledWorkspaceStatus = "canceled"WorkspaceStatusDeletingWorkspaceStatus = "deleting"WorkspaceStatusDeletedWorkspaceStatus = "deleted")

func (WorkspaceStatus)Validadded inv0.18.1

func (sWorkspaceStatus) Valid()bool

typeWorkspaceTransition

type WorkspaceTransitionstring
const (WorkspaceTransitionStartWorkspaceTransition = "start"WorkspaceTransitionStopWorkspaceTransition = "stop"WorkspaceTransitionDeleteWorkspaceTransition = "delete")

funcAllWorkspaceTransitionValuesadded inv0.15.2

func AllWorkspaceTransitionValues() []WorkspaceTransition

func (*WorkspaceTransition)Scan

func (e *WorkspaceTransition) Scan(src interface{})error

func (WorkspaceTransition)Validadded inv0.15.2

func (eWorkspaceTransition) Valid()bool

Source Files

View all Source files

Directories

PathSynopsis
Package db2sdk provides common conversion routines from database types to codersdk types
Package db2sdk provides common conversion routines from database types to codersdk types
Package dbauthz provides an authorization layer on top of the database.
Package dbauthz provides an authorization layer on top of the database.
Code generated by coderd/database/gen/metrics.
Code generated by coderd/database/gen/metrics.
Package dbmock is a generated GoMock package.
Package dbmock is a generated GoMock package.
gen

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp