database
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
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
- func GenLockID(name string) int64
- func IsQueryCanceledError(err error) bool
- func IsSerializedError(err error) bool
- func IsStartupLogsLimitError(err error) bool
- func IsUniqueViolation(err error, uniqueConstraints ...UniqueConstraint) bool
- func Now() time.Time
- func Time(t time.Time) time.Time
- type APIKey
- type APIKeyScope
- type AcquireProvisionerJobParams
- type Actions
- type AppSharingLevel
- type AuditAction
- type AuditLog
- type AuditOAuthConvertState
- type AuditableGroup
- type BuildReason
- type DBTX
- type DeleteGroupMemberFromGroupParams
- type DeleteGroupMembersByOrgAndUserParams
- type DeleteTailnetAgentParams
- type DeleteTailnetAgentRow
- type DeleteTailnetClientParams
- type DeleteTailnetClientRow
- type File
- type GetAPIKeyByNameParams
- type GetAPIKeysByUserIDParams
- type GetAuditLogsOffsetParams
- type GetAuditLogsOffsetRow
- type GetAuthorizationUserRolesRow
- type GetDefaultProxyConfigRow
- type GetDeploymentDAUsRow
- type GetDeploymentWorkspaceAgentStatsRow
- type GetDeploymentWorkspaceStatsRow
- type GetFileByHashAndCreatorParams
- type GetFileTemplatesRow
- type GetGitAuthLinkParams
- type GetGroupByOrgAndNameParams
- type GetOrganizationIDsByMemberIDsRow
- type GetOrganizationMemberByUserIDParams
- type GetPreviousTemplateVersionParams
- type GetProvisionerJobsByIDsWithQueuePositionRow
- type GetProvisionerLogsAfterIDParams
- type GetTemplateAverageBuildTimeParams
- type GetTemplateAverageBuildTimeRow
- type GetTemplateByOrganizationAndNameParams
- type GetTemplateDAUsParams
- type GetTemplateDAUsRow
- type GetTemplateDailyInsightsParams
- type GetTemplateDailyInsightsRow
- type GetTemplateInsightsParams
- type GetTemplateInsightsRow
- type GetTemplateVersionByTemplateIDAndNameParams
- type GetTemplateVersionsByTemplateIDParams
- type GetTemplatesWithFilterParams
- type GetUserByEmailOrUsernameParams
- type GetUserLatencyInsightsParams
- type GetUserLatencyInsightsRow
- type GetUserLinkByUserIDLoginTypeParams
- type GetUsersParams
- type GetUsersRow
- type GetWorkspaceAgentLifecycleStateByIDRow
- type GetWorkspaceAgentStartupLogsAfterParams
- type GetWorkspaceAgentStatsAndLabelsRow
- type GetWorkspaceAgentStatsRow
- type GetWorkspaceAppByAgentIDAndSlugParams
- type GetWorkspaceBuildByWorkspaceIDAndBuildNumberParams
- type GetWorkspaceBuildsByWorkspaceIDParams
- type GetWorkspaceByOwnerIDAndNameParams
- type GetWorkspaceProxyByHostnameParams
- type GetWorkspacesParams
- type GetWorkspacesRow
- type GitAuthLink
- type GitSSHKey
- type Group
- type GroupMember
- type InsertAPIKeyParams
- type InsertAuditLogParams
- type InsertFileParams
- type InsertGitAuthLinkParams
- type InsertGitSSHKeyParams
- type InsertGroupMemberParams
- type InsertGroupParams
- type InsertLicenseParams
- type InsertOrganizationMemberParams
- type InsertOrganizationParams
- type InsertProvisionerDaemonParams
- type InsertProvisionerJobLogsParams
- type InsertProvisionerJobParams
- type InsertReplicaParams
- type InsertTemplateParams
- type InsertTemplateVersionParameterParams
- type InsertTemplateVersionParams
- type InsertTemplateVersionVariableParams
- type InsertUserGroupsByNameParams
- type InsertUserLinkParams
- type InsertUserParams
- type InsertWorkspaceAgentMetadataParams
- type InsertWorkspaceAgentParams
- type InsertWorkspaceAgentStartupLogsParams
- type InsertWorkspaceAgentStatParams
- type InsertWorkspaceAppParams
- type InsertWorkspaceBuildParametersParams
- type InsertWorkspaceBuildParams
- type InsertWorkspaceParams
- type InsertWorkspaceProxyParams
- type InsertWorkspaceResourceMetadataParams
- type InsertWorkspaceResourceParams
- type License
- type LogLevel
- type LogSource
- type LoginType
- type NullAPIKeyScope
- type NullAppSharingLevel
- type NullAuditAction
- type NullBuildReason
- type NullLogLevel
- type NullLogSource
- type NullLoginType
- type NullParameterDestinationScheme
- type NullParameterScope
- type NullParameterSourceScheme
- type NullParameterTypeSystem
- type NullProvisionerJobType
- type NullProvisionerStorageMethod
- type NullProvisionerType
- type NullResourceType
- type NullStartupScriptBehavior
- type NullUserStatus
- type NullWorkspaceAgentLifecycleState
- type NullWorkspaceAgentSubsystem
- type NullWorkspaceAppHealth
- type NullWorkspaceTransition
- type Organization
- type OrganizationMember
- type ParameterDestinationScheme
- type ParameterSchema
- type ParameterScope
- type ParameterSourceScheme
- type ParameterTypeSystem
- type ParameterValue
- type ProvisionerDaemon
- type ProvisionerJob
- type ProvisionerJobLog
- type ProvisionerJobType
- type ProvisionerStorageMethod
- type ProvisionerType
- type RegisterWorkspaceProxyParams
- type Replica
- type ResourceType
- type SiteConfig
- type StartupScriptBehavior
- type Store
- type StringMap
- type TailnetAgent
- type TailnetClient
- type TailnetCoordinator
- type Template
- type TemplateACL
- type TemplateGroup
- type TemplateTable
- type TemplateUser
- type TemplateVersion
- type TemplateVersionParameter
- type TemplateVersionVariable
- type UniqueConstraint
- type UpdateAPIKeyByIDParams
- type UpdateGitAuthLinkParams
- type UpdateGitSSHKeyParams
- type UpdateGroupByIDParams
- type UpdateMemberRolesParams
- type UpdateProvisionerJobByIDParams
- type UpdateProvisionerJobWithCancelByIDParams
- type UpdateProvisionerJobWithCompleteByIDParams
- type UpdateReplicaParams
- type UpdateTemplateACLByIDParams
- type UpdateTemplateActiveVersionByIDParams
- type UpdateTemplateDeletedByIDParams
- type UpdateTemplateMetaByIDParams
- type UpdateTemplateScheduleByIDParams
- type UpdateTemplateVersionByIDParams
- type UpdateTemplateVersionDescriptionByJobIDParams
- type UpdateTemplateVersionGitAuthProvidersByJobIDParams
- type UpdateUserDeletedByIDParams
- type UpdateUserHashedPasswordParams
- type UpdateUserLastSeenAtParams
- type UpdateUserLinkParams
- type UpdateUserLinkedIDParams
- type UpdateUserLoginTypeParams
- type UpdateUserProfileParams
- type UpdateUserQuietHoursScheduleParams
- type UpdateUserRolesParams
- type UpdateUserStatusParams
- type UpdateWorkspaceAgentConnectionByIDParams
- type UpdateWorkspaceAgentLifecycleStateByIDParams
- type UpdateWorkspaceAgentMetadataParams
- type UpdateWorkspaceAgentStartupByIDParams
- type UpdateWorkspaceAgentStartupLogOverflowByIDParams
- type UpdateWorkspaceAppHealthByIDParams
- type UpdateWorkspaceAutostartParams
- type UpdateWorkspaceBuildByIDParams
- type UpdateWorkspaceBuildCostByIDParams
- type UpdateWorkspaceDeletedByIDParams
- type UpdateWorkspaceLastUsedAtParams
- type UpdateWorkspaceLockedDeletingAtParams
- type UpdateWorkspaceParams
- type UpdateWorkspaceProxyDeletedParams
- type UpdateWorkspaceProxyParams
- type UpdateWorkspaceTTLParams
- type UpdateWorkspacesDeletingAtByTemplateIDParams
- type UpsertDefaultProxyParams
- type UpsertTailnetAgentParams
- type UpsertTailnetClientParams
- type User
- type UserLink
- type UserStatus
- type VisibleUser
- type Workspace
- type WorkspaceAgent
- type WorkspaceAgentConnectionStatus
- type WorkspaceAgentLifecycleState
- type WorkspaceAgentMetadatum
- type WorkspaceAgentStartupLog
- type WorkspaceAgentStat
- type WorkspaceAgentStatus
- type WorkspaceAgentSubsystem
- type WorkspaceApp
- type WorkspaceAppHealth
- type WorkspaceBuild
- type WorkspaceBuildParameter
- type WorkspaceProxy
- type WorkspaceResource
- type WorkspaceResourceMetadatum
- type WorkspaceStatus
- type WorkspaceTransition
Constants¶
const AllUsersGroup = "Everyone"
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¶
funcGenLockID¶added inv0.25.0
GenLockID generates a unique and consistent lock ID from a given string.
funcIsQueryCanceledError¶added inv0.18.0
IsQueryCanceledError checks if the error is due to a query being canceled.
funcIsSerializedError¶added inv0.20.1
funcIsStartupLogsLimitError¶added inv0.21.0
funcIsUniqueViolation¶added 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.
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)RBACObject¶added inv0.15.1
typeAPIKeyScope¶added inv0.9.0
type APIKeyScopestring
const (APIKeyScopeAllAPIKeyScope = "all"APIKeyScopeApplicationConnectAPIKeyScope = "application_connect")
funcAllAPIKeyScopeValues¶added inv0.15.2
func AllAPIKeyScopeValues() []APIKeyScope
func (*APIKeyScope)Scan¶added inv0.9.0
func (e *APIKeyScope) Scan(src interface{})error
func (APIKeyScope)ToRBAC¶added inv0.9.0
func (sAPIKeyScope) ToRBAC()rbac.ScopeName
func (APIKeyScope)Valid¶added 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"`}
typeAppSharingLevel¶added inv0.10.0
type AppSharingLevelstring
const (AppSharingLevelOwnerAppSharingLevel = "owner"AppSharingLevelAuthenticatedAppSharingLevel = "authenticated"AppSharingLevelPublicAppSharingLevel = "public")
funcAllAppSharingLevelValues¶added inv0.15.2
func AllAppSharingLevelValues() []AppSharingLevel
func (*AppSharingLevel)Scan¶added inv0.10.0
func (e *AppSharingLevel) Scan(src interface{})error
func (AppSharingLevel)Valid¶added inv0.15.2
func (eAppSharingLevel) Valid()bool
typeAuditAction¶added inv0.5.3
type AuditActionstring
const (AuditActionCreateAuditAction = "create"AuditActionWriteAuditAction = "write"AuditActionDeleteAuditAction = "delete"AuditActionStartAuditAction = "start"AuditActionStopAuditAction = "stop"AuditActionLoginAuditAction = "login"AuditActionLogoutAuditAction = "logout"AuditActionRegisterAuditAction = "register")
funcAllAuditActionValues¶added inv0.15.2
func AllAuditActionValues() []AuditAction
func (*AuditAction)Scan¶added inv0.5.3
func (e *AuditAction) Scan(src interface{})error
func (AuditAction)Valid¶added inv0.15.2
func (eAuditAction) Valid()bool
typeAuditLog¶added 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"`}
typeAuditOAuthConvertState¶added 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.
typeAuditableGroup¶added inv0.15.0
type AuditableGroup struct {GroupMembers []GroupMember `json:"members"`}
typeBuildReason¶added inv0.7.2
type BuildReasonstring
const (BuildReasonInitiatorBuildReason = "initiator"BuildReasonAutostartBuildReason = "autostart"BuildReasonAutostopBuildReason = "autostop"BuildReasonAutolockBuildReason = "autolock"BuildReasonFailedstopBuildReason = "failedstop"BuildReasonAutodeleteBuildReason = "autodelete")
funcAllBuildReasonValues¶added inv0.15.2
func AllBuildReasonValues() []BuildReason
func (*BuildReason)Scan¶added inv0.7.2
func (e *BuildReason) Scan(src interface{})error
func (BuildReason)Valid¶added 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.
typeDeleteGroupMemberFromGroupParams¶added inv0.16.0
typeDeleteGroupMembersByOrgAndUserParams¶added inv0.17.0
typeDeleteTailnetAgentParams¶added inv0.25.0
typeDeleteTailnetAgentRow¶added inv0.25.0
typeDeleteTailnetClientParams¶added inv0.25.0
typeDeleteTailnetClientRow¶added inv0.25.0
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)RBACObject¶added inv0.6.1
typeGetAPIKeyByNameParams¶added inv0.19.0
typeGetAPIKeysByUserIDParams¶added inv0.18.0
typeGetAuditLogsOffsetParams¶added 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"`}
typeGetAuditLogsOffsetRow¶added 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"`}
typeGetAuthorizationUserRolesRow¶added inv0.6.1
typeGetDefaultProxyConfigRow¶added inv0.24.0
typeGetDeploymentDAUsRow¶added inv0.15.3
typeGetDeploymentWorkspaceAgentStatsRow¶added 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"`}
typeGetDeploymentWorkspaceStatsRow¶added 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"`}
typeGetFileByHashAndCreatorParams¶added inv0.10.0
typeGetFileTemplatesRow¶added 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)RBACObject¶added inv0.21.0
func (tGetFileTemplatesRow) RBACObject()rbac.Object
typeGetGitAuthLinkParams¶added inv0.11.0
typeGetGroupByOrgAndNameParams¶added inv0.9.9
typeGetOrganizationIDsByMemberIDsRow¶added 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)RBACObject¶added inv0.17.2
func (mGetOrganizationIDsByMemberIDsRow) RBACObject()rbac.Object
typeGetPreviousTemplateVersionParams¶added inv0.13.2
typeGetProvisionerJobsByIDsWithQueuePositionRow¶added 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"`}
typeGetProvisionerLogsAfterIDParams¶added inv0.21.0
typeGetTemplateAverageBuildTimeParams¶added inv0.10.0
typeGetTemplateAverageBuildTimeRow¶added 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"`}
typeGetTemplateByOrganizationAndNameParams¶added inv0.4.0
typeGetTemplateDAUsParams¶added inv0.24.0
typeGetTemplateDAUsRow¶added inv0.8.12
typeGetTemplateDailyInsightsParams¶added inv0.27.1
typeGetTemplateDailyInsightsRow¶added inv0.27.1
typeGetTemplateInsightsParams¶added inv0.27.1
typeGetTemplateInsightsRow¶added 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"`}
typeGetTemplateVersionByTemplateIDAndNameParams¶added inv0.4.0
typeGetTemplateVersionsByTemplateIDParams¶added inv0.5.6
typeGetTemplatesWithFilterParams¶added inv0.7.0
typeGetUserLatencyInsightsParams¶added inv0.27.1
typeGetUserLatencyInsightsRow¶added 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"`}
typeGetUserLinkByUserIDLoginTypeParams¶added inv0.8.6
typeGetUsersParams¶added 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"`}
typeGetUsersRow¶added 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)RBACObject¶added inv0.17.2
func (uGetUsersRow) RBACObject()rbac.Object
typeGetWorkspaceAgentLifecycleStateByIDRow¶added 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"`}
typeGetWorkspaceAgentStartupLogsAfterParams¶added inv0.21.0
typeGetWorkspaceAgentStatsAndLabelsRow¶added 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"`}
typeGetWorkspaceAgentStatsRow¶added 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"`}
typeGetWorkspaceAppByAgentIDAndSlugParams¶added inv0.12.0
typeGetWorkspaceBuildByWorkspaceIDAndBuildNumberParams¶added inv0.6.6
typeGetWorkspaceBuildsByWorkspaceIDParams¶added inv0.9.8
typeGetWorkspaceByOwnerIDAndNameParams¶added inv0.5.0
typeGetWorkspaceProxyByHostnameParams¶added inv0.23.0
typeGetWorkspacesParams¶added 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_"`}
typeGetWorkspacesRow¶added 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"`}
typeGitAuthLink¶added 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)RBACObject¶added inv0.17.2
func (uGitAuthLink) RBACObject()rbac.Object
typeGitSSHKey¶added 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)RBACObject¶added inv0.17.2
typeGroup¶added 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)Auditable¶added 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)RBACObject¶added inv0.9.9
typeGroupMember¶added inv0.9.9
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"`}
typeInsertAuditLogParams¶added 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"`}
typeInsertGitAuthLinkParams¶added 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"`}
typeInsertGitSSHKeyParams¶added inv0.4.0
typeInsertGroupMemberParams¶added inv0.9.9
typeInsertGroupParams¶added inv0.9.9
typeInsertLicenseParams¶added inv0.8.7
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"`}
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"`}
typeInsertReplicaParams¶added 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"`}
typeInsertTemplateParams¶added 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"`}
typeInsertTemplateVersionParameterParams¶added 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"`}
typeInsertTemplateVersionParams¶added 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"`}
typeInsertTemplateVersionVariableParams¶added 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"`}
typeInsertUserGroupsByNameParams¶added inv0.17.0
typeInsertUserLinkParams¶added 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"`}
typeInsertWorkspaceAgentMetadataParams¶added 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"`}
typeInsertWorkspaceAgentStartupLogsParams¶added 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"`}
typeInsertWorkspaceAgentStatParams¶added 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"`}
typeInsertWorkspaceAppParams¶added 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"`}
typeInsertWorkspaceBuildParametersParams¶added inv0.15.0
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"`}
typeInsertWorkspaceProxyParams¶added 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"`}
typeInsertWorkspaceResourceMetadataParams¶added inv0.8.3
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)RBACObject¶added inv0.8.7
typeLogLevel¶
type LogLevelstring
funcAllLogLevelValues¶added inv0.15.2
func AllLogLevelValues() []LogLevel
typeLogSource¶
type LogSourcestring
funcAllLogSourceValues¶added inv0.15.2
func AllLogSourceValues() []LogSource
typeLoginType¶
type LoginTypestring
Specifies the method of authentication. "none" is a special case in which no authentication method is allowed.
funcAllLoginTypeValues¶added inv0.15.2
func AllLoginTypeValues() []LoginType
typeNullAPIKeyScope¶added inv0.15.2
type NullAPIKeyScope struct {APIKeyScopeAPIKeyScope `json:"api_key_scope"`Validbool `json:"valid"`// Valid is true if APIKeyScope is not NULL}
func (*NullAPIKeyScope)Scan¶added inv0.15.2
func (ns *NullAPIKeyScope) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullAppSharingLevel¶added inv0.15.2
type NullAppSharingLevel struct {AppSharingLevelAppSharingLevel `json:"app_sharing_level"`Validbool `json:"valid"`// Valid is true if AppSharingLevel is not NULL}
func (*NullAppSharingLevel)Scan¶added inv0.15.2
func (ns *NullAppSharingLevel) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullAuditAction¶added inv0.15.2
type NullAuditAction struct {AuditActionAuditAction `json:"audit_action"`Validbool `json:"valid"`// Valid is true if AuditAction is not NULL}
func (*NullAuditAction)Scan¶added inv0.15.2
func (ns *NullAuditAction) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullBuildReason¶added inv0.15.2
type NullBuildReason struct {BuildReasonBuildReason `json:"build_reason"`Validbool `json:"valid"`// Valid is true if BuildReason is not NULL}
func (*NullBuildReason)Scan¶added inv0.15.2
func (ns *NullBuildReason) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullLogLevel¶added inv0.15.2
type NullLogLevel struct {LogLevelLogLevel `json:"log_level"`Validbool `json:"valid"`// Valid is true if LogLevel is not NULL}
func (*NullLogLevel)Scan¶added inv0.15.2
func (ns *NullLogLevel) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullLogSource¶added inv0.15.2
type NullLogSource struct {LogSourceLogSource `json:"log_source"`Validbool `json:"valid"`// Valid is true if LogSource is not NULL}
func (*NullLogSource)Scan¶added inv0.15.2
func (ns *NullLogSource) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullLoginType¶added inv0.15.2
type NullLoginType struct {LoginTypeLoginType `json:"login_type"`Validbool `json:"valid"`// Valid is true if LoginType is not NULL}
func (*NullLoginType)Scan¶added inv0.15.2
func (ns *NullLoginType) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullParameterDestinationScheme¶added inv0.15.2
type NullParameterDestinationScheme struct {ParameterDestinationSchemeParameterDestinationScheme `json:"parameter_destination_scheme"`Validbool `json:"valid"`// Valid is true if ParameterDestinationScheme is not NULL}
func (*NullParameterDestinationScheme)Scan¶added inv0.15.2
func (ns *NullParameterDestinationScheme) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullParameterScope¶added inv0.15.2
type NullParameterScope struct {ParameterScopeParameterScope `json:"parameter_scope"`Validbool `json:"valid"`// Valid is true if ParameterScope is not NULL}
func (*NullParameterScope)Scan¶added inv0.15.2
func (ns *NullParameterScope) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullParameterSourceScheme¶added inv0.15.2
type NullParameterSourceScheme struct {ParameterSourceSchemeParameterSourceScheme `json:"parameter_source_scheme"`Validbool `json:"valid"`// Valid is true if ParameterSourceScheme is not NULL}
func (*NullParameterSourceScheme)Scan¶added inv0.15.2
func (ns *NullParameterSourceScheme) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullParameterTypeSystem¶added inv0.15.2
type NullParameterTypeSystem struct {ParameterTypeSystemParameterTypeSystem `json:"parameter_type_system"`Validbool `json:"valid"`// Valid is true if ParameterTypeSystem is not NULL}
func (*NullParameterTypeSystem)Scan¶added inv0.15.2
func (ns *NullParameterTypeSystem) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullProvisionerJobType¶added inv0.15.2
type NullProvisionerJobType struct {ProvisionerJobTypeProvisionerJobType `json:"provisioner_job_type"`Validbool `json:"valid"`// Valid is true if ProvisionerJobType is not NULL}
func (*NullProvisionerJobType)Scan¶added inv0.15.2
func (ns *NullProvisionerJobType) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullProvisionerStorageMethod¶added inv0.15.2
type NullProvisionerStorageMethod struct {ProvisionerStorageMethodProvisionerStorageMethod `json:"provisioner_storage_method"`Validbool `json:"valid"`// Valid is true if ProvisionerStorageMethod is not NULL}
func (*NullProvisionerStorageMethod)Scan¶added inv0.15.2
func (ns *NullProvisionerStorageMethod) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullProvisionerType¶added inv0.15.2
type NullProvisionerType struct {ProvisionerTypeProvisionerType `json:"provisioner_type"`Validbool `json:"valid"`// Valid is true if ProvisionerType is not NULL}
func (*NullProvisionerType)Scan¶added inv0.15.2
func (ns *NullProvisionerType) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullResourceType¶added inv0.15.2
type NullResourceType struct {ResourceTypeResourceType `json:"resource_type"`Validbool `json:"valid"`// Valid is true if ResourceType is not NULL}
func (*NullResourceType)Scan¶added inv0.15.2
func (ns *NullResourceType) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullStartupScriptBehavior¶added inv0.24.0
type NullStartupScriptBehavior struct {StartupScriptBehaviorStartupScriptBehavior `json:"startup_script_behavior"`Validbool `json:"valid"`// Valid is true if StartupScriptBehavior is not NULL}
func (*NullStartupScriptBehavior)Scan¶added inv0.24.0
func (ns *NullStartupScriptBehavior) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullUserStatus¶added inv0.15.2
type NullUserStatus struct {UserStatusUserStatus `json:"user_status"`Validbool `json:"valid"`// Valid is true if UserStatus is not NULL}
func (*NullUserStatus)Scan¶added inv0.15.2
func (ns *NullUserStatus) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAgentLifecycleState¶added 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)Scan¶added inv0.15.3
func (ns *NullWorkspaceAgentLifecycleState) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAgentSubsystem¶added inv0.23.5
type NullWorkspaceAgentSubsystem struct {WorkspaceAgentSubsystemWorkspaceAgentSubsystem `json:"workspace_agent_subsystem"`Validbool `json:"valid"`// Valid is true if WorkspaceAgentSubsystem is not NULL}
func (*NullWorkspaceAgentSubsystem)Scan¶added inv0.23.5
func (ns *NullWorkspaceAgentSubsystem) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceAppHealth¶added inv0.15.2
type NullWorkspaceAppHealth struct {WorkspaceAppHealthWorkspaceAppHealth `json:"workspace_app_health"`Validbool `json:"valid"`// Valid is true if WorkspaceAppHealth is not NULL}
func (*NullWorkspaceAppHealth)Scan¶added inv0.15.2
func (ns *NullWorkspaceAppHealth) Scan(value interface{})error
Scan implements the Scanner interface.
typeNullWorkspaceTransition¶added inv0.15.2
type NullWorkspaceTransition struct {WorkspaceTransitionWorkspaceTransition `json:"workspace_transition"`Validbool `json:"valid"`// Valid is true if WorkspaceTransition is not NULL}
func (*NullWorkspaceTransition)Scan¶added inv0.15.2
func (ns *NullWorkspaceTransition) Scan(value interface{})error
Scan implements the Scanner 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)RBACObject¶added 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)RBACObject¶added inv0.6.0
func (mOrganizationMember) RBACObject()rbac.Object
typeParameterDestinationScheme¶
type ParameterDestinationSchemestring
const (ParameterDestinationSchemeNoneParameterDestinationScheme = "none"ParameterDestinationSchemeEnvironmentVariableParameterDestinationScheme = "environment_variable"ParameterDestinationSchemeProvisionerVariableParameterDestinationScheme = "provisioner_variable")
funcAllParameterDestinationSchemeValues¶added inv0.15.2
func AllParameterDestinationSchemeValues() []ParameterDestinationScheme
func (*ParameterDestinationScheme)Scan¶
func (e *ParameterDestinationScheme) Scan(src interface{})error
func (ParameterDestinationScheme)Valid¶added inv0.15.2
func (eParameterDestinationScheme) Valid()bool
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")
funcAllParameterScopeValues¶added inv0.15.2
func AllParameterScopeValues() []ParameterScope
func (*ParameterScope)Scan¶
func (e *ParameterScope) Scan(src interface{})error
func (ParameterScope)Valid¶added inv0.15.2
func (eParameterScope) Valid()bool
typeParameterSourceScheme¶
type ParameterSourceSchemestring
const (ParameterSourceSchemeNoneParameterSourceScheme = "none"ParameterSourceSchemeDataParameterSourceScheme = "data")
funcAllParameterSourceSchemeValues¶added inv0.15.2
func AllParameterSourceSchemeValues() []ParameterSourceScheme
func (*ParameterSourceScheme)Scan¶
func (e *ParameterSourceScheme) Scan(src interface{})error
func (ParameterSourceScheme)Valid¶added inv0.15.2
func (eParameterSourceScheme) Valid()bool
typeParameterTypeSystem¶
type ParameterTypeSystemstring
const (ParameterTypeSystemNoneParameterTypeSystem = "none"ParameterTypeSystemHCLParameterTypeSystem = "hcl")
funcAllParameterTypeSystemValues¶added inv0.15.2
func AllParameterTypeSystemValues() []ParameterTypeSystem
func (*ParameterTypeSystem)Scan¶
func (e *ParameterTypeSystem) Scan(src interface{})error
func (ParameterTypeSystem)Valid¶added 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)RBACObject¶added 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")
funcAllProvisionerJobTypeValues¶added inv0.15.2
func AllProvisionerJobTypeValues() []ProvisionerJobType
func (*ProvisionerJobType)Scan¶
func (e *ProvisionerJobType) Scan(src interface{})error
func (ProvisionerJobType)Valid¶added inv0.15.2
func (eProvisionerJobType) Valid()bool
typeProvisionerStorageMethod¶
type ProvisionerStorageMethodstring
const (ProvisionerStorageMethodFileProvisionerStorageMethod = "file")
funcAllProvisionerStorageMethodValues¶added inv0.15.2
func AllProvisionerStorageMethodValues() []ProvisionerStorageMethod
func (*ProvisionerStorageMethod)Scan¶
func (e *ProvisionerStorageMethod) Scan(src interface{})error
func (ProvisionerStorageMethod)Valid¶added inv0.15.2
func (eProvisionerStorageMethod) Valid()bool
typeProvisionerType¶
type ProvisionerTypestring
const (ProvisionerTypeEchoProvisionerType = "echo"ProvisionerTypeTerraformProvisionerType = "terraform")
funcAllProvisionerTypeValues¶added inv0.15.2
func AllProvisionerTypeValues() []ProvisionerType
func (*ProvisionerType)Scan¶
func (e *ProvisionerType) Scan(src interface{})error
func (ProvisionerType)Valid¶added inv0.15.2
func (eProvisionerType) Valid()bool
typeRegisterWorkspaceProxyParams¶added inv0.23.0
typeReplica¶added 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"`}
typeResourceType¶added 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")
funcAllResourceTypeValues¶added inv0.15.2
func AllResourceTypeValues() []ResourceType
func (*ResourceType)Scan¶added inv0.5.3
func (e *ResourceType) Scan(src interface{})error
func (ResourceType)Valid¶added inv0.15.2
func (eResourceType) Valid()bool
typeSiteConfig¶added inv0.7.2
typeStartupScriptBehavior¶added inv0.24.0
type StartupScriptBehaviorstring
const (StartupScriptBehaviorBlockingStartupScriptBehavior = "blocking"StartupScriptBehaviorNonBlockingStartupScriptBehavior = "non-blocking")
funcAllStartupScriptBehaviorValues¶added inv0.24.0
func AllStartupScriptBehaviorValues() []StartupScriptBehavior
func (*StartupScriptBehavior)Scan¶added inv0.24.0
func (e *StartupScriptBehavior) Scan(src interface{})error
func (StartupScriptBehavior)Valid¶added inv0.24.0
func (eStartupScriptBehavior) Valid()bool
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.
typeTailnetAgent¶added inv0.25.0
typeTailnetClient¶added inv0.25.0
typeTailnetCoordinator¶added 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
typeTemplate¶added 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)RBACObject¶added inv0.6.0
typeTemplateACL¶added inv0.9.9
TemplateACL is a map of ids to permissions.
func (*TemplateACL)Scan¶added inv0.10.2
func (t *TemplateACL) Scan(src interface{})error
typeTemplateGroup¶added inv0.9.9
typeTemplateTable¶added 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"`}
typeTemplateUser¶added inv0.9.9
typeTemplateVersion¶added 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)RBACObject¶added inv0.6.0
func (TemplateVersion) RBACObject(templateTemplate)rbac.Object
func (TemplateVersion)RBACObjectNoTemplate¶added inv0.17.2
func (vTemplateVersion) RBACObjectNoTemplate()rbac.Object
RBACObjectNoTemplate is for orphaned template versions.
typeTemplateVersionParameter¶added 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"`}
typeTemplateVersionVariable¶added 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"`}
typeUniqueConstraint¶added 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.
typeUpdateGitAuthLinkParams¶added 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"`}
typeUpdateGitSSHKeyParams¶added inv0.4.0
typeUpdateGroupByIDParams¶added inv0.9.9
typeUpdateMemberRolesParams¶added inv0.5.2
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"`}
typeUpdateReplicaParams¶added 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"`}
typeUpdateTemplateACLByIDParams¶added 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"`}
typeUpdateTemplateActiveVersionByIDParams¶added inv0.4.0
typeUpdateTemplateDeletedByIDParams¶added inv0.4.0
typeUpdateTemplateMetaByIDParams¶added 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"`}
typeUpdateTemplateScheduleByIDParams¶added 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"`}
typeUpdateTemplateVersionByIDParams¶added inv0.4.0
typeUpdateTemplateVersionDescriptionByJobIDParams¶added inv0.5.10
typeUpdateTemplateVersionGitAuthProvidersByJobIDParams¶added inv0.18.0
typeUpdateUserDeletedByIDParams¶added inv0.8.15
typeUpdateUserHashedPasswordParams¶added inv0.5.5
typeUpdateUserLastSeenAtParams¶added inv0.9.0
typeUpdateUserLinkParams¶added 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"`}
typeUpdateUserLinkedIDParams¶added inv0.8.6
typeUpdateUserLoginTypeParams¶added inv0.25.0
typeUpdateUserProfileParams¶added inv0.4.2
typeUpdateUserQuietHoursScheduleParams¶added inv0.26.2
typeUpdateUserRolesParams¶added inv0.5.2
typeUpdateUserStatusParams¶added 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"`}
typeUpdateWorkspaceAgentLifecycleStateByIDParams¶added inv0.15.3
typeUpdateWorkspaceAgentMetadataParams¶added inv0.21.3
typeUpdateWorkspaceAgentStartupByIDParams¶added 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"`}
typeUpdateWorkspaceAgentStartupLogOverflowByIDParams¶added inv0.21.0
typeUpdateWorkspaceAppHealthByIDParams¶added inv0.9.0
type UpdateWorkspaceAppHealthByIDParams struct {IDuuid.UUID `db:"id" json:"id"`HealthWorkspaceAppHealth `db:"health" json:"health"`}
typeUpdateWorkspaceAutostartParams¶added 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"`}
typeUpdateWorkspaceBuildCostByIDParams¶added inv0.12.7
typeUpdateWorkspaceLastUsedAtParams¶added inv0.8.12
typeUpdateWorkspaceLockedDeletingAtParams¶added inv0.26.2
typeUpdateWorkspaceParams¶added inv0.8.7
typeUpdateWorkspaceProxyDeletedParams¶added inv0.22.0
typeUpdateWorkspaceProxyParams¶added inv0.22.0
typeUpdateWorkspaceTTLParams¶added inv0.6.0
typeUpdateWorkspacesDeletingAtByTemplateIDParams¶added inv0.26.2
typeUpsertDefaultProxyParams¶added inv0.24.0
typeUpsertTailnetAgentParams¶added inv0.25.0
typeUpsertTailnetClientParams¶added inv0.25.0
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"`}
funcConvertUserRows¶added inv0.12.8
func ConvertUserRows(rows []GetUsersRow) []User
func (User)RBACObject¶added inv0.7.5
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)UserDataRBACObject¶added inv0.15.1
typeUserLink¶added 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)RBACObject¶added inv0.17.2
typeUserStatus¶added inv0.5.1
type UserStatusstring
const (UserStatusActiveUserStatus = "active"UserStatusSuspendedUserStatus = "suspended")
funcAllUserStatusValues¶added inv0.15.2
func AllUserStatusValues() []UserStatus
func (*UserStatus)Scan¶added inv0.5.1
func (e *UserStatus) Scan(src interface{})error
func (UserStatus)Valid¶added inv0.15.2
func (eUserStatus) Valid()bool
typeVisibleUser¶added 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"`}
funcConvertWorkspaceRows¶added inv0.12.8
func ConvertWorkspaceRows(rows []GetWorkspacesRow) []Workspace
func (Workspace)ApplicationConnectRBAC¶added inv0.9.0
func (Workspace)ExecutionRBAC¶added inv0.8.6
func (Workspace)LockedRBAC¶added inv0.25.0
func (Workspace)RBACObject¶added inv0.6.0
func (Workspace)WorkspaceBuildRBAC¶added 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)Status¶added inv0.21.3
func (aWorkspaceAgent) Status(inactiveTimeouttime.Duration)WorkspaceAgentConnectionStatus
typeWorkspaceAgentConnectionStatus¶added inv0.21.3
typeWorkspaceAgentLifecycleState¶added 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")
funcAllWorkspaceAgentLifecycleStateValues¶added inv0.15.3
func AllWorkspaceAgentLifecycleStateValues() []WorkspaceAgentLifecycleState
func (*WorkspaceAgentLifecycleState)Scan¶added inv0.15.3
func (e *WorkspaceAgentLifecycleState) Scan(src interface{})error
func (WorkspaceAgentLifecycleState)Valid¶added inv0.15.3
func (eWorkspaceAgentLifecycleState) Valid()bool
typeWorkspaceAgentMetadatum¶added 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"`}
typeWorkspaceAgentStartupLog¶added inv0.21.0
typeWorkspaceAgentStat¶added 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"`}
typeWorkspaceAgentStatus¶added 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)Valid¶added inv0.21.3
func (sWorkspaceAgentStatus) Valid()bool
typeWorkspaceAgentSubsystem¶added inv0.23.5
type WorkspaceAgentSubsystemstring
const (WorkspaceAgentSubsystemEnvbuilderWorkspaceAgentSubsystem = "envbuilder"WorkspaceAgentSubsystemEnvboxWorkspaceAgentSubsystem = "envbox"WorkspaceAgentSubsystemNoneWorkspaceAgentSubsystem = "none")
funcAllWorkspaceAgentSubsystemValues¶added inv0.23.5
func AllWorkspaceAgentSubsystemValues() []WorkspaceAgentSubsystem
func (*WorkspaceAgentSubsystem)Scan¶added inv0.23.5
func (e *WorkspaceAgentSubsystem) Scan(src interface{})error
func (WorkspaceAgentSubsystem)Valid¶added inv0.23.5
func (eWorkspaceAgentSubsystem) Valid()bool
typeWorkspaceApp¶added 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"`}
typeWorkspaceAppHealth¶added inv0.9.0
type WorkspaceAppHealthstring
const (WorkspaceAppHealthDisabledWorkspaceAppHealth = "disabled"WorkspaceAppHealthInitializingWorkspaceAppHealth = "initializing"WorkspaceAppHealthHealthyWorkspaceAppHealth = "healthy"WorkspaceAppHealthUnhealthyWorkspaceAppHealth = "unhealthy")
funcAllWorkspaceAppHealthValues¶added inv0.15.2
func AllWorkspaceAppHealthValues() []WorkspaceAppHealth
func (*WorkspaceAppHealth)Scan¶added inv0.9.0
func (e *WorkspaceAppHealth) Scan(src interface{})error
func (WorkspaceAppHealth)Valid¶added 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"`}
typeWorkspaceBuildParameter¶added inv0.15.0
typeWorkspaceProxy¶added 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)IsPrimary¶added inv0.24.0
func (wWorkspaceProxy) IsPrimary()bool
func (WorkspaceProxy)RBACObject¶added 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"`}
typeWorkspaceResourceMetadatum¶added inv0.8.3
typeWorkspaceStatus¶added 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)Valid¶added inv0.18.1
func (sWorkspaceStatus) Valid()bool
typeWorkspaceTransition¶
type WorkspaceTransitionstring
const (WorkspaceTransitionStartWorkspaceTransition = "start"WorkspaceTransitionStopWorkspaceTransition = "stop"WorkspaceTransitionDeleteWorkspaceTransition = "delete")
funcAllWorkspaceTransitionValues¶added inv0.15.2
func AllWorkspaceTransitionValues() []WorkspaceTransition
func (*WorkspaceTransition)Scan¶
func (e *WorkspaceTransition) Scan(src interface{})error
func (WorkspaceTransition)Valid¶added inv0.15.2
func (eWorkspaceTransition) Valid()bool
Source Files¶
Directories¶
Path | Synopsis |
---|---|
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 | |