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/ and run "make gen" to generate models. 2. Add/Edit queries in "query.sql" and run "make gen" to create Go code.
Code generated by scripts/dbgen/main.go. DO NOT EDIT.
Code generated by scripts/dbgen/main.go. DO NOT EDIT.
Index ¶
- Constants
- func ExpectOne[T any](ret []T, err error) (T, error)
- func GenLockID(name string) int64
- func IncrementExecutionCount(opts *TxOptions)
- func IsForeignKeyViolation(err error, foreignKeyConstraints ...ForeignKeyConstraint) bool
- func IsQueryCanceledError(err error) bool
- func IsSerializedError(err error) bool
- func IsUniqueViolation(err error, uniqueConstraints ...UniqueConstraint) bool
- func IsWorkspaceAgentLogsLimitError(err error) bool
- func ReadModifyUpdate(db Store, f func(tx Store) error) error
- func WithSerialRetryCount(count int) func(*sqlQuerier)
- type APIKey
- type APIKeyScope
- type AcquireNotificationMessagesParams
- type AcquireNotificationMessagesRow
- type AcquireProvisionerJobParams
- type Actions
- type ActivityBumpWorkspaceParams
- type AgentIDNamePair
- type AppSharingLevel
- type ArchiveUnusedTemplateVersionsParams
- type AuditAction
- type AuditLog
- type AuditOAuthConvertState
- type AuditableGroup
- type AuditableOrganizationMember
- type AutomaticUpdates
- type BatchUpdateWorkspaceLastUsedAtParams
- type BatchUpdateWorkspaceNextStartAtParams
- type BuildReason
- type BulkMarkNotificationMessagesFailedParams
- type BulkMarkNotificationMessagesSentParams
- type ConnectorCreator
- type CryptoKey
- type CryptoKeyFeature
- type CustomRole
- type CustomRolePermission
- type CustomRolePermissions
- type CustomRolesParams
- type DBCryptKey
- type DBTX
- type DeleteAllTailnetClientSubscriptionsParams
- type DeleteAllTailnetTunnelsParams
- type DeleteCryptoKeyParams
- type DeleteCustomRoleParams
- type DeleteExternalAuthLinkParams
- type DeleteGroupMemberFromGroupParams
- type DeleteOAuth2ProviderAppCodesByAppAndUserIDParams
- type DeleteOAuth2ProviderAppTokensByAppAndUserIDParams
- type DeleteOrganizationMemberParams
- type DeleteTailnetAgentParams
- type DeleteTailnetAgentRow
- type DeleteTailnetClientParams
- type DeleteTailnetClientRow
- type DeleteTailnetClientSubscriptionParams
- type DeleteTailnetPeerParams
- type DeleteTailnetPeerRow
- type DeleteTailnetTunnelParams
- type DeleteTailnetTunnelRow
- type DeleteWebpushSubscriptionByUserIDAndEndpointParams
- type DeleteWorkspaceAgentPortShareParams
- type DialerConnector
- type DisplayApp
- type EnqueueNotificationMessageParams
- type ExternalAuthLink
- type ExternalAuthProvider
- type FetchNewMessageMetadataParams
- type FetchNewMessageMetadataRow
- type File
- type ForeignKeyConstraint
- type GetAPIKeyByNameParams
- type GetAPIKeysByUserIDParams
- type GetAuditLogsOffsetParams
- type GetAuditLogsOffsetRow
- type GetAuthorizationUserRolesRow
- type GetCryptoKeyByFeatureAndSequenceParams
- type GetDefaultProxyConfigRow
- type GetDeploymentDAUsRow
- type GetDeploymentWorkspaceAgentStatsRow
- type GetDeploymentWorkspaceAgentUsageStatsRow
- type GetDeploymentWorkspaceStatsRow
- type GetEligibleProvisionerDaemonsByProvisionerJobIDsRow
- type GetExternalAuthLinkParams
- type GetFailedWorkspaceBuildsByTemplateIDParams
- type GetFailedWorkspaceBuildsByTemplateIDRow
- type GetFileByHashAndCreatorParams
- type GetFileTemplatesRow
- type GetFilteredInboxNotificationsByUserIDParams
- type GetGroupByOrgAndNameParams
- type GetGroupMembersByGroupIDParams
- type GetGroupMembersCountByGroupIDParams
- type GetGroupsParams
- type GetGroupsRow
- type GetInboxNotificationsByUserIDParams
- type GetJFrogXrayScanByWorkspaceAndAgentIDParams
- type GetNotificationMessagesByStatusParams
- type GetOAuth2ProviderAppsByUserIDRow
- type GetOrganizationByNameParams
- type GetOrganizationIDsByMemberIDsRow
- type GetOrganizationResourceCountByIDRow
- type GetOrganizationsByUserIDParams
- type GetOrganizationsParams
- type GetPreviousTemplateVersionParams
- type GetProvisionerDaemonsByOrganizationParams
- type GetProvisionerDaemonsWithStatusByOrganizationParams
- type GetProvisionerDaemonsWithStatusByOrganizationRow
- type GetProvisionerJobsByIDsWithQueuePositionRow
- type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams
- type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow
- type GetProvisionerKeyByNameParams
- type GetProvisionerLogsAfterIDParams
- type GetQuotaAllowanceForUserParams
- type GetQuotaConsumedForUserParams
- type GetTailnetTunnelPeerBindingsRow
- type GetTailnetTunnelPeerIDsRow
- type GetTemplateAppInsightsByTemplateParams
- type GetTemplateAppInsightsByTemplateRow
- type GetTemplateAppInsightsParams
- type GetTemplateAppInsightsRow
- type GetTemplateAverageBuildTimeParams
- type GetTemplateAverageBuildTimeRow
- type GetTemplateByOrganizationAndNameParams
- type GetTemplateDAUsParams
- type GetTemplateDAUsRow
- type GetTemplateInsightsByIntervalParams
- type GetTemplateInsightsByIntervalRow
- type GetTemplateInsightsByTemplateParams
- type GetTemplateInsightsByTemplateRow
- type GetTemplateInsightsParams
- type GetTemplateInsightsRow
- type GetTemplateParameterInsightsParams
- type GetTemplateParameterInsightsRow
- type GetTemplateUsageStatsParams
- type GetTemplateVersionByTemplateIDAndNameParams
- type GetTemplateVersionsByTemplateIDParams
- type GetTemplatesWithFilterParams
- type GetUserActivityInsightsParams
- type GetUserActivityInsightsRow
- type GetUserByEmailOrUsernameParams
- type GetUserLatencyInsightsParams
- type GetUserLatencyInsightsRow
- type GetUserLinkByUserIDLoginTypeParams
- type GetUserStatusCountsParams
- type GetUserStatusCountsRow
- type GetUserWorkspaceBuildParametersParams
- type GetUserWorkspaceBuildParametersRow
- type GetUsersParams
- type GetUsersRow
- type GetWebpushVAPIDKeysRow
- type GetWorkspaceAgentAndLatestBuildByAuthTokenRow
- type GetWorkspaceAgentLifecycleStateByIDRow
- type GetWorkspaceAgentLogsAfterParams
- type GetWorkspaceAgentMetadataParams
- type GetWorkspaceAgentPortShareParams
- type GetWorkspaceAgentScriptTimingsByBuildIDRow
- type GetWorkspaceAgentStatsAndLabelsRow
- type GetWorkspaceAgentStatsRow
- type GetWorkspaceAgentUsageStatsAndLabelsRow
- type GetWorkspaceAgentUsageStatsRow
- type GetWorkspaceAppByAgentIDAndSlugParams
- type GetWorkspaceBuildByWorkspaceIDAndBuildNumberParams
- type GetWorkspaceBuildStatsByTemplatesRow
- type GetWorkspaceBuildsByWorkspaceIDParams
- type GetWorkspaceByOwnerIDAndNameParams
- type GetWorkspaceProxyByHostnameParams
- type GetWorkspaceUniqueOwnerCountByTemplateIDsRow
- type GetWorkspacesAndAgentsByOwnerIDRow
- type GetWorkspacesEligibleForTransitionRow
- type GetWorkspacesParams
- type GetWorkspacesRow
- type GitSSHKey
- type Group
- type GroupMember
- type GroupMemberTable
- type GroupSource
- type HealthSettings
- type InboxNotification
- type InboxNotificationReadStatus
- type InsertAPIKeyParams
- type InsertAuditLogParams
- type InsertCryptoKeyParams
- type InsertCustomRoleParams
- type InsertDBCryptKeyParams
- type InsertExternalAuthLinkParams
- type InsertFileParams
- type InsertGitSSHKeyParams
- type InsertGroupMemberParams
- type InsertGroupParams
- type InsertInboxNotificationParams
- type InsertLicenseParams
- type InsertMemoryResourceMonitorParams
- type InsertMissingGroupsParams
- type InsertOAuth2ProviderAppCodeParams
- type InsertOAuth2ProviderAppParams
- type InsertOAuth2ProviderAppSecretParams
- type InsertOAuth2ProviderAppTokenParams
- type InsertOrganizationMemberParams
- type InsertOrganizationParams
- type InsertPresetParametersParams
- type InsertPresetParams
- type InsertProvisionerJobLogsParams
- type InsertProvisionerJobParams
- type InsertProvisionerJobTimingsParams
- type InsertProvisionerKeyParams
- type InsertReplicaParams
- type InsertTelemetryItemIfNotExistsParams
- type InsertTemplateParams
- type InsertTemplateVersionParameterParams
- type InsertTemplateVersionParams
- type InsertTemplateVersionTerraformValuesByJobIDParams
- type InsertTemplateVersionVariableParams
- type InsertTemplateVersionWorkspaceTagParams
- type InsertUserGroupsByIDParams
- type InsertUserGroupsByNameParams
- type InsertUserLinkParams
- type InsertUserParams
- type InsertVolumeResourceMonitorParams
- type InsertWebpushSubscriptionParams
- type InsertWorkspaceAgentDevcontainersParams
- type InsertWorkspaceAgentLogSourcesParams
- type InsertWorkspaceAgentLogsParams
- type InsertWorkspaceAgentMetadataParams
- type InsertWorkspaceAgentParams
- type InsertWorkspaceAgentScriptTimingsParams
- type InsertWorkspaceAgentScriptsParams
- type InsertWorkspaceAgentStatsParams
- type InsertWorkspaceAppParams
- type InsertWorkspaceAppStatsParams
- type InsertWorkspaceAppStatusParams
- type InsertWorkspaceBuildParametersParams
- type InsertWorkspaceBuildParams
- type InsertWorkspaceModuleParams
- type InsertWorkspaceParams
- type InsertWorkspaceProxyParams
- type InsertWorkspaceResourceMetadataParams
- type InsertWorkspaceResourceParams
- type JfrogXrayScan
- type License
- type LogLevel
- type LogSource
- type LoginType
- type MarkAllInboxNotificationsAsReadParams
- type NameOrganizationPair
- type NotificationMessage
- type NotificationMessageStatus
- type NotificationMethod
- type NotificationPreference
- type NotificationReportGeneratorLog
- type NotificationTemplate
- type NotificationTemplateKind
- type NotificationsSettings
- type NullAPIKeyScope
- type NullAppSharingLevel
- type NullAuditAction
- type NullAutomaticUpdates
- type NullBuildReason
- type NullCryptoKeyFeature
- type NullDisplayApp
- type NullGroupSource
- type NullInboxNotificationReadStatus
- type NullLogLevel
- type NullLogSource
- type NullLoginType
- type NullNotificationMessageStatus
- type NullNotificationMethod
- type NullNotificationTemplateKind
- type NullParameterDestinationScheme
- type NullParameterScope
- type NullParameterSourceScheme
- type NullParameterTypeSystem
- type NullPortShareProtocol
- type NullProvisionerDaemonStatus
- type NullProvisionerJobStatus
- type NullProvisionerJobTimingStage
- type NullProvisionerJobType
- type NullProvisionerStorageMethod
- type NullProvisionerType
- type NullResourceType
- type NullStartupScriptBehavior
- type NullTailnetStatus
- type NullUserStatus
- type NullWorkspaceAgentLifecycleState
- type NullWorkspaceAgentMonitorState
- type NullWorkspaceAgentScriptTimingStage
- type NullWorkspaceAgentScriptTimingStatus
- type NullWorkspaceAgentSubsystem
- type NullWorkspaceAppHealth
- type NullWorkspaceAppOpenIn
- type NullWorkspaceAppStatusState
- type NullWorkspaceTransition
- type OAuth2ProviderApp
- type OAuth2ProviderAppCode
- type OAuth2ProviderAppSecret
- type OAuth2ProviderAppToken
- type OIDCClaimFieldValuesParams
- type Organization
- type OrganizationMember
- type OrganizationMembersParams
- type OrganizationMembersRow
- type PGLock
- type PGLocks
- type PaginatedOrganizationMembersParams
- type PaginatedOrganizationMembersRow
- type ParameterDestinationScheme
- type ParameterSchema
- type ParameterScope
- type ParameterSourceScheme
- type ParameterTypeSystem
- type ParameterValue
- type PortShareProtocol
- type ProvisionerDaemon
- type ProvisionerDaemonStatus
- type ProvisionerJob
- type ProvisionerJobLog
- type ProvisionerJobStat
- type ProvisionerJobStatus
- type ProvisionerJobTiming
- type ProvisionerJobTimingStage
- type ProvisionerJobType
- type ProvisionerKey
- type ProvisionerStorageMethod
- type ProvisionerType
- type RegisterWorkspaceProxyParams
- type RemoveUserFromGroupsParams
- type Replica
- type ResourceType
- type SiteConfig
- type StartupScriptBehavior
- type Store
- type StringMap
- type StringMapOfInt
- type TailnetAgent
- type TailnetClient
- type TailnetClientSubscription
- type TailnetCoordinator
- type TailnetPeer
- type TailnetStatus
- type TailnetTunnel
- type TelemetryItem
- type Template
- type TemplateACL
- type TemplateGroup
- type TemplateTable
- type TemplateUsageStat
- type TemplateUser
- type TemplateVersion
- type TemplateVersionParameter
- type TemplateVersionPreset
- type TemplateVersionPresetParameter
- type TemplateVersionTable
- type TemplateVersionTerraformValue
- type TemplateVersionVariable
- type TemplateVersionWorkspaceTag
- type TxOptions
- type UnarchiveTemplateVersionParams
- type UniqueConstraint
- type UpdateAPIKeyByIDParams
- type UpdateCryptoKeyDeletesAtParams
- type UpdateCustomRoleParams
- type UpdateExternalAuthLinkParams
- type UpdateExternalAuthLinkRefreshTokenParams
- type UpdateGitSSHKeyParams
- type UpdateGroupByIDParams
- type UpdateInactiveUsersToDormantParams
- type UpdateInactiveUsersToDormantRow
- type UpdateInboxNotificationReadStatusParams
- type UpdateMemberRolesParams
- type UpdateMemoryResourceMonitorParams
- type UpdateNotificationTemplateMethodByIDParams
- type UpdateOAuth2ProviderAppByIDParams
- type UpdateOAuth2ProviderAppSecretByIDParams
- type UpdateOrganizationDeletedByIDParams
- type UpdateOrganizationParams
- type UpdateProvisionerDaemonLastSeenAtParams
- type UpdateProvisionerJobByIDParams
- type UpdateProvisionerJobWithCancelByIDParams
- type UpdateProvisionerJobWithCompleteByIDParams
- type UpdateReplicaParams
- type UpdateTailnetPeerStatusByCoordinatorParams
- type UpdateTemplateACLByIDParams
- type UpdateTemplateAccessControlByIDParams
- type UpdateTemplateActiveVersionByIDParams
- type UpdateTemplateDeletedByIDParams
- type UpdateTemplateMetaByIDParams
- type UpdateTemplateScheduleByIDParams
- type UpdateTemplateVersionByIDParams
- type UpdateTemplateVersionDescriptionByJobIDParams
- type UpdateTemplateVersionExternalAuthProvidersByJobIDParams
- type UpdateTemplateWorkspacesLastUsedAtParams
- type UpdateUserAppearanceSettingsParams
- type UpdateUserGithubComUserIDParams
- type UpdateUserHashedOneTimePasscodeParams
- type UpdateUserHashedPasswordParams
- type UpdateUserLastSeenAtParams
- type UpdateUserLinkParams
- type UpdateUserLinkedIDParams
- type UpdateUserLoginTypeParams
- type UpdateUserNotificationPreferencesParams
- type UpdateUserProfileParams
- type UpdateUserQuietHoursScheduleParams
- type UpdateUserRolesParams
- type UpdateUserStatusParams
- type UpdateVolumeResourceMonitorParams
- type UpdateWorkspaceAgentConnectionByIDParams
- type UpdateWorkspaceAgentLifecycleStateByIDParams
- type UpdateWorkspaceAgentLogOverflowByIDParams
- type UpdateWorkspaceAgentMetadataParams
- type UpdateWorkspaceAgentStartupByIDParams
- type UpdateWorkspaceAppHealthByIDParams
- type UpdateWorkspaceAutomaticUpdatesParams
- type UpdateWorkspaceAutostartParams
- type UpdateWorkspaceBuildCostByIDParams
- type UpdateWorkspaceBuildDeadlineByIDParams
- type UpdateWorkspaceBuildProvisionerStateByIDParams
- type UpdateWorkspaceDeletedByIDParams
- type UpdateWorkspaceDormantDeletingAtParams
- type UpdateWorkspaceLastUsedAtParams
- type UpdateWorkspaceNextStartAtParams
- type UpdateWorkspaceParams
- type UpdateWorkspaceProxyDeletedParams
- type UpdateWorkspaceProxyParams
- type UpdateWorkspaceTTLParams
- type UpdateWorkspacesDormantDeletingAtByTemplateIDParams
- type UpdateWorkspacesTTLByTemplateIDParams
- type UpsertDefaultProxyParams
- type UpsertJFrogXrayScanByWorkspaceAndAgentIDParams
- type UpsertNotificationReportGeneratorLogParams
- type UpsertProvisionerDaemonParams
- type UpsertRuntimeConfigParams
- type UpsertTailnetAgentParams
- type UpsertTailnetClientParams
- type UpsertTailnetClientSubscriptionParams
- type UpsertTailnetPeerParams
- type UpsertTailnetTunnelParams
- type UpsertTelemetryItemParams
- type UpsertWebpushVAPIDKeysParams
- type UpsertWorkspaceAgentPortShareParams
- type UpsertWorkspaceAppAuditSessionParams
- type User
- type UserConfig
- type UserDeleted
- type UserLink
- type UserLinkClaims
- type UserStatus
- type UserStatusChange
- type VisibleUser
- type WebpushSubscription
- type Workspace
- type WorkspaceAgent
- type WorkspaceAgentConnectionStatus
- type WorkspaceAgentDevcontainer
- type WorkspaceAgentLifecycleState
- type WorkspaceAgentLog
- type WorkspaceAgentLogSource
- type WorkspaceAgentMemoryResourceMonitor
- type WorkspaceAgentMetadatum
- type WorkspaceAgentMonitorState
- type WorkspaceAgentPortShare
- type WorkspaceAgentScript
- type WorkspaceAgentScriptTiming
- type WorkspaceAgentScriptTimingStage
- type WorkspaceAgentScriptTimingStatus
- type WorkspaceAgentStat
- type WorkspaceAgentStatus
- type WorkspaceAgentSubsystem
- type WorkspaceAgentVolumeResourceMonitor
- type WorkspaceApp
- type WorkspaceAppAuditSession
- type WorkspaceAppHealth
- type WorkspaceAppOpenIn
- type WorkspaceAppStat
- type WorkspaceAppStatus
- type WorkspaceAppStatusState
- type WorkspaceBuild
- type WorkspaceBuildParameter
- type WorkspaceBuildTable
- type WorkspaceModule
- type WorkspaceProxy
- type WorkspaceResource
- type WorkspaceResourceMetadatum
- type WorkspaceStatus
- type WorkspaceTable
- type WorkspaceTransition
Constants ¶
const ( LockIDDeploymentSetup = iota + 1 LockIDEnterpriseDeploymentSetup LockIDDBRollup LockIDDBPurge LockIDNotificationsReportGenerator LockIDCryptoKeyRotation )
Well-known lock IDs for lock functions in the database. These should not change. If locks are deprecated, they should be kept in this list to avoid reusing the same ID.
const EveryoneGroup = "Everyone"
Variables ¶
This section is empty.
Functions ¶
func ExpectOne ¶ added in v2.13.0
ExpectOne can be used to convert a ':many:' query into a ':one' query. To reduce the quantity of SQL queries, a :many with a filter is used. These filters sometimes are expected to return just 1 row.
A :many query will never return a sql.ErrNoRows, but a :one does. This function will correct the error for the empty set.
func IncrementExecutionCount ¶ added in v2.17.0
func IncrementExecutionCount(opts *TxOptions)
IncrementExecutionCount is a helper function for external packages to increment the unexported count. Mainly for `dbmem`.
func IsForeignKeyViolation ¶ added in v2.2.0
func IsForeignKeyViolation(err error, foreignKeyConstraints ...ForeignKeyConstraint) bool
IsForeignKeyViolation checks if the error is due to a foreign key violation. If one or more specific foreign key 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 foreign key violation.
func IsQueryCanceledError ¶
IsQueryCanceledError checks if the error is due to a query being canceled.
func IsSerializedError ¶
func IsUniqueViolation ¶
func IsUniqueViolation(err error, 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.
func ReadModifyUpdate ¶
ReadModifyUpdate is a helper function to run a db transaction that reads some object(s), modifies some of the data, and writes the modified object(s) back to the database. It is run in a transaction at RepeatableRead isolation so that if another database client also modifies the data we are writing and commits, then the transaction is rolled back and restarted.
This is needed because we typically read all object columns, modify some subset, and then write all columns. Consider an object with columns A, B and initial values A=1, B=1. Two database clients work simultaneously, with one client attempting to set A=2, and another attempting to set B=2. They both initially read A=1, B=1, and then one writes A=2, B=1, and the other writes A=1, B=2. With default PostgreSQL isolation of ReadCommitted, both of these transactions would succeed and we end up with either A=2, B=1 or A=1, B=2. One or other client gets their transaction wiped out even though the data they wanted to change didn't conflict.
If we run at RepeatableRead isolation, then one or other transaction will fail. Let's say the transaction that sets A=2 succeeds. Then the first B=2 transaction fails, but here we retry. The second attempt we read A=2, B=1, then write A=2, B=2 as desired, and this succeeds.
func WithSerialRetryCount ¶ added in v2.17.0
func WithSerialRetryCount(count int) func(*sqlQuerier)
Types ¶
type APIKey ¶
type APIKey struct { ID string `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"` UserID uuid.UUID `db:"user_id" json:"user_id"` LastUsed time.Time `db:"last_used" json:"last_used"` ExpiresAt time.Time `db:"expires_at" json:"expires_at"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` LoginType LoginType `db:"login_type" json:"login_type"` LifetimeSeconds int64 `db:"lifetime_seconds" json:"lifetime_seconds"` IPAddress pqtype.Inet `db:"ip_address" json:"ip_address"` Scope APIKeyScope `db:"scope" json:"scope"` TokenName string `db:"token_name" json:"token_name"` }
func (APIKey) RBACObject ¶
type APIKeyScope ¶
type APIKeyScope string
const ( APIKeyScopeAll APIKeyScope = "all" APIKeyScopeApplicationConnect APIKeyScope = "application_connect" )
func AllAPIKeyScopeValues ¶
func AllAPIKeyScopeValues() []APIKeyScope
func (*APIKeyScope) Scan ¶
func (e *APIKeyScope) Scan(src interface{}) error
func (APIKeyScope) ToRBAC ¶
func (s APIKeyScope) ToRBAC() rbac.ScopeName
func (APIKeyScope) Valid ¶
func (e APIKeyScope) Valid() bool
type AcquireNotificationMessagesParams ¶ added in v2.13.0
type AcquireNotificationMessagesRow ¶ added in v2.13.0
type AcquireNotificationMessagesRow struct { ID uuid.UUID `db:"id" json:"id"` Payload json.RawMessage `db:"payload" json:"payload"` Method NotificationMethod `db:"method" json:"method"` AttemptCount int32 `db:"attempt_count" json:"attempt_count"` QueuedSeconds float64 `db:"queued_seconds" json:"queued_seconds"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` TitleTemplate string `db:"title_template" json:"title_template"` BodyTemplate string `db:"body_template" json:"body_template"` Disabled bool `db:"disabled" json:"disabled"` }
type AcquireProvisionerJobParams ¶
type AcquireProvisionerJobParams struct { StartedAt sql.NullTime `db:"started_at" json:"started_at"` WorkerID uuid.NullUUID `db:"worker_id" json:"worker_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` Types []ProvisionerType `db:"types" json:"types"` ProvisionerTags json.RawMessage `db:"provisioner_tags" json:"provisioner_tags"` }
type ActivityBumpWorkspaceParams ¶ added in v2.4.0
type AgentIDNamePair ¶ added in v2.18.0
type AgentIDNamePair struct { ID uuid.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` }
AgentIDNamePair is used as a result tuple for workspace and agent rows.
func (*AgentIDNamePair) Scan ¶ added in v2.18.0
func (p *AgentIDNamePair) Scan(src interface{}) error
type AppSharingLevel ¶
type AppSharingLevel string
const ( AppSharingLevelOwner AppSharingLevel = "owner" AppSharingLevelAuthenticated AppSharingLevel = "authenticated" AppSharingLevelPublic AppSharingLevel = "public" )
func AllAppSharingLevelValues ¶
func AllAppSharingLevelValues() []AppSharingLevel
func (*AppSharingLevel) Scan ¶
func (e *AppSharingLevel) Scan(src interface{}) error
func (AppSharingLevel) Valid ¶
func (e AppSharingLevel) Valid() bool
type ArchiveUnusedTemplateVersionsParams ¶ added in v2.3.0
type ArchiveUnusedTemplateVersionsParams struct { UpdatedAt time.Time `db:"updated_at" json:"updated_at"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"` JobStatus NullProvisionerJobStatus `db:"job_status" json:"job_status"` }
type AuditAction ¶
type AuditAction string
const ( AuditActionCreate AuditAction = "create" AuditActionWrite AuditAction = "write" AuditActionDelete AuditAction = "delete" AuditActionStart AuditAction = "start" AuditActionStop AuditAction = "stop" AuditActionLogin AuditAction = "login" AuditActionLogout AuditAction = "logout" AuditActionRegister AuditAction = "register" AuditActionRequestPasswordReset AuditAction = "request_password_reset" AuditActionConnect AuditAction = "connect" AuditActionDisconnect AuditAction = "disconnect" AuditActionOpen AuditAction = "open" AuditActionClose AuditAction = "close" )
func AllAuditActionValues ¶
func AllAuditActionValues() []AuditAction
func (*AuditAction) Scan ¶
func (e *AuditAction) Scan(src interface{}) error
func (AuditAction) Valid ¶
func (e AuditAction) Valid() bool
type AuditLog ¶
type AuditLog struct { ID uuid.UUID `db:"id" json:"id"` Time time.Time `db:"time" json:"time"` UserID uuid.UUID `db:"user_id" json:"user_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` Ip pqtype.Inet `db:"ip" json:"ip"` UserAgent sql.NullString `db:"user_agent" json:"user_agent"` ResourceType ResourceType `db:"resource_type" json:"resource_type"` ResourceID uuid.UUID `db:"resource_id" json:"resource_id"` ResourceTarget string `db:"resource_target" json:"resource_target"` Action AuditAction `db:"action" json:"action"` Diff json.RawMessage `db:"diff" json:"diff"` StatusCode int32 `db:"status_code" json:"status_code"` AdditionalFields json.RawMessage `db:"additional_fields" json:"additional_fields"` RequestID uuid.UUID `db:"request_id" json:"request_id"` ResourceIcon string `db:"resource_icon" json:"resource_icon"` }
func (AuditLog) RBACObject ¶ added in v2.14.0
type AuditOAuthConvertState ¶
type AuditOAuthConvertState struct { CreatedAt time.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. ExpiresAt time.Time `db:"expires_at" json:"expires_at"` FromLoginType LoginType `db:"from_login_type" json:"from_login_type"` // The login type the user is converting to. Should be github or oidc. ToLoginType LoginType `db:"to_login_type" json:"to_login_type"` UserID uuid.UUID `db:"user_id" json:"user_id"` }
AuditOAuthConvertState is never stored in the database. It is stored in a cookie clientside as a JWT. This type is provided for audit logging purposes.
type AuditableGroup ¶
type AuditableGroup struct { Group Members []GroupMemberTable `json:"members"` }
type AuditableOrganizationMember ¶ added in v2.13.0
type AuditableOrganizationMember struct { OrganizationMember Username string `json:"username"` }
type AutomaticUpdates ¶ added in v2.3.0
type AutomaticUpdates string
const ( AutomaticUpdatesAlways AutomaticUpdates = "always" AutomaticUpdatesNever AutomaticUpdates = "never" )
func AllAutomaticUpdatesValues ¶ added in v2.3.0
func AllAutomaticUpdatesValues() []AutomaticUpdates
func (*AutomaticUpdates) Scan ¶ added in v2.3.0
func (e *AutomaticUpdates) Scan(src interface{}) error
func (AutomaticUpdates) Valid ¶ added in v2.3.0
func (e AutomaticUpdates) Valid() bool
type BatchUpdateWorkspaceLastUsedAtParams ¶ added in v2.7.0
type BatchUpdateWorkspaceNextStartAtParams ¶ added in v2.19.0
type BuildReason ¶
type BuildReason string
const ( BuildReasonInitiator BuildReason = "initiator" BuildReasonAutostart BuildReason = "autostart" BuildReasonAutostop BuildReason = "autostop" BuildReasonDormancy BuildReason = "dormancy" BuildReasonFailedstop BuildReason = "failedstop" BuildReasonAutodelete BuildReason = "autodelete" )
func AllBuildReasonValues ¶
func AllBuildReasonValues() []BuildReason
func (*BuildReason) Scan ¶
func (e *BuildReason) Scan(src interface{}) error
func (BuildReason) Valid ¶
func (e BuildReason) Valid() bool
type BulkMarkNotificationMessagesFailedParams ¶ added in v2.13.0
type BulkMarkNotificationMessagesFailedParams struct { MaxAttempts int32 `db:"max_attempts" json:"max_attempts"` RetryInterval int32 `db:"retry_interval" json:"retry_interval"` IDs []uuid.UUID `db:"ids" json:"ids"` FailedAts []time.Time `db:"failed_ats" json:"failed_ats"` Statuses []NotificationMessageStatus `db:"statuses" json:"statuses"` StatusReasons []string `db:"status_reasons" json:"status_reasons"` }
type BulkMarkNotificationMessagesSentParams ¶ added in v2.13.0
type ConnectorCreator ¶ added in v2.15.0
ConnectorCreator is a driver.Driver that can create a driver.Connector.
type CryptoKey ¶ added in v2.16.0
type CryptoKey struct { Feature CryptoKeyFeature `db:"feature" json:"feature"` Sequence int32 `db:"sequence" json:"sequence"` Secret sql.NullString `db:"secret" json:"secret"` SecretKeyID sql.NullString `db:"secret_key_id" json:"secret_key_id"` StartsAt time.Time `db:"starts_at" json:"starts_at"` DeletesAt sql.NullTime `db:"deletes_at" json:"deletes_at"` }
func (CryptoKey) DecodeString ¶ added in v2.17.0
type CryptoKeyFeature ¶ added in v2.16.0
type CryptoKeyFeature string
const ( CryptoKeyFeatureWorkspaceAppsToken CryptoKeyFeature = "workspace_apps_token" CryptoKeyFeatureWorkspaceAppsAPIKey CryptoKeyFeature = "workspace_apps_api_key" CryptoKeyFeatureOIDCConvert CryptoKeyFeature = "oidc_convert" CryptoKeyFeatureTailnetResume CryptoKeyFeature = "tailnet_resume" )
func AllCryptoKeyFeatureValues ¶ added in v2.16.0
func AllCryptoKeyFeatureValues() []CryptoKeyFeature
func (*CryptoKeyFeature) Scan ¶ added in v2.16.0
func (e *CryptoKeyFeature) Scan(src interface{}) error
func (CryptoKeyFeature) Valid ¶ added in v2.16.0
func (e CryptoKeyFeature) Valid() bool
type CustomRole ¶ added in v2.12.0
type CustomRole struct { Name string `db:"name" json:"name"` DisplayName string `db:"display_name" json:"display_name"` SitePermissions CustomRolePermissions `db:"site_permissions" json:"site_permissions"` OrgPermissions CustomRolePermissions `db:"org_permissions" json:"org_permissions"` UserPermissions CustomRolePermissions `db:"user_permissions" json:"user_permissions"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` // Roles can optionally be scoped to an organization OrganizationID uuid.NullUUID `db:"organization_id" json:"organization_id"` // Custom roles ID is used purely for auditing purposes. Name is a better unique identifier. ID uuid.UUID `db:"id" json:"id"` }
Custom roles allow dynamic roles expanded at runtime
func (CustomRole) RoleIdentifier ¶ added in v2.13.0
func (r CustomRole) RoleIdentifier() rbac.RoleIdentifier
type CustomRolePermission ¶ added in v2.13.0
type CustomRolePermission struct { Negate bool `json:"negate"` ResourceType string `json:"resource_type"` Action policy.Action `json:"action"` }
func (CustomRolePermission) String ¶ added in v2.13.0
func (a CustomRolePermission) String() string
type CustomRolePermissions ¶ added in v2.13.0
type CustomRolePermissions []CustomRolePermission
func (*CustomRolePermissions) Scan ¶ added in v2.13.0
func (a *CustomRolePermissions) Scan(src interface{}) error
type CustomRolesParams ¶ added in v2.12.0
type CustomRolesParams struct { LookupRoles []NameOrganizationPair `db:"lookup_roles" json:"lookup_roles"` ExcludeOrgRoles bool `db:"exclude_org_roles" json:"exclude_org_roles"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` }
type DBCryptKey ¶ added in v2.2.0
type DBCryptKey struct { // An integer used to identify the key. Number int32 `db:"number" json:"number"` // If the key is active, the digest of the active key. ActiveKeyDigest sql.NullString `db:"active_key_digest" json:"active_key_digest"` // If the key has been revoked, the digest of the revoked key. RevokedKeyDigest sql.NullString `db:"revoked_key_digest" json:"revoked_key_digest"` // The time at which the key was created. CreatedAt sql.NullTime `db:"created_at" json:"created_at"` // The time at which the key was revoked. RevokedAt sql.NullTime `db:"revoked_at" json:"revoked_at"` // A column used to test the encryption. Test string `db:"test" json:"test"` }
A table used to store the keys used to encrypt the database.
type DBTX ¶
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.Row SelectContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error GetContext(ctx context.Context, dest interface{}, query string, args ...interface{}) error }
DBTX represents a database connection or transaction.
type DeleteAllTailnetClientSubscriptionsParams ¶ added in v2.2.0
type DeleteAllTailnetTunnelsParams ¶ added in v2.4.0
type DeleteCryptoKeyParams ¶ added in v2.16.0
type DeleteCryptoKeyParams struct { Feature CryptoKeyFeature `db:"feature" json:"feature"` Sequence int32 `db:"sequence" json:"sequence"` }
type DeleteCustomRoleParams ¶ added in v2.15.0
type DeleteExternalAuthLinkParams ¶ added in v2.5.0
type DeleteOAuth2ProviderAppCodesByAppAndUserIDParams ¶ added in v2.9.0
type DeleteOAuth2ProviderAppTokensByAppAndUserIDParams ¶ added in v2.9.0
type DeleteOrganizationMemberParams ¶ added in v2.13.0
type DeleteTailnetAgentRow ¶
type DeleteTailnetClientRow ¶
type DeleteTailnetClientSubscriptionParams ¶ added in v2.2.0
type DeleteTailnetPeerParams ¶ added in v2.4.0
type DeleteTailnetPeerRow ¶ added in v2.4.0
type DeleteTailnetTunnelParams ¶ added in v2.4.0
type DeleteTailnetTunnelRow ¶ added in v2.4.0
type DeleteWebpushSubscriptionByUserIDAndEndpointParams ¶ added in v2.21.0
type DeleteWorkspaceAgentPortShareParams ¶ added in v2.9.0
type DeleteWorkspaceAgentPortShareParams struct {}
type DialerConnector ¶ added in v2.15.0
DialerConnector is a driver.Connector that can set a pq.Dialer.
type DisplayApp ¶ added in v2.1.5
type DisplayApp string
const ( DisplayAppVscode DisplayApp = "vscode" DisplayAppVscodeInsiders DisplayApp = "vscode_insiders" DisplayAppWebTerminal DisplayApp = "web_terminal" DisplayAppSSHHelper DisplayApp = "ssh_helper" DisplayAppPortForwardingHelper DisplayApp = "port_forwarding_helper" )
func AllDisplayAppValues ¶ added in v2.1.5
func AllDisplayAppValues() []DisplayApp
func (*DisplayApp) Scan ¶ added in v2.1.5
func (e *DisplayApp) Scan(src interface{}) error
func (DisplayApp) Valid ¶ added in v2.1.5
func (e DisplayApp) Valid() bool
type EnqueueNotificationMessageParams ¶ added in v2.13.0
type EnqueueNotificationMessageParams struct { ID uuid.UUID `db:"id" json:"id"` NotificationTemplateID uuid.UUID `db:"notification_template_id" json:"notification_template_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` Method NotificationMethod `db:"method" json:"method"` Payload json.RawMessage `db:"payload" json:"payload"` Targets []uuid.UUID `db:"targets" json:"targets"` CreatedBy string `db:"created_by" json:"created_by"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
type ExternalAuthLink ¶ added in v2.2.1
type ExternalAuthLink struct { ProviderID string `db:"provider_id" json:"provider_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OAuthAccessToken string `db:"oauth_access_token" json:"oauth_access_token"` OAuthRefreshToken string `db:"oauth_refresh_token" json:"oauth_refresh_token"` OAuthExpiry time.Time `db:"oauth_expiry" json:"oauth_expiry"` // The ID of the key used to encrypt the OAuth access token. If this is NULL, the access token is not encrypted OAuthAccessTokenKeyID sql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"` // The ID of the key used to encrypt the OAuth refresh token. If this is NULL, the refresh token is not encrypted OAuthRefreshTokenKeyID sql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"` OAuthExtra pqtype.NullRawMessage `db:"oauth_extra" json:"oauth_extra"` }
func (ExternalAuthLink) OAuthToken ¶ added in v2.8.0
func (u ExternalAuthLink) OAuthToken() *oauth2.Token
func (ExternalAuthLink) RBACObject ¶ added in v2.2.1
func (u ExternalAuthLink) RBACObject() rbac.Object
type ExternalAuthProvider ¶ added in v2.9.0
type FetchNewMessageMetadataParams ¶ added in v2.13.0
type FetchNewMessageMetadataRow ¶ added in v2.13.0
type FetchNewMessageMetadataRow struct { NotificationName string `db:"notification_name" json:"notification_name"` NotificationTemplateID uuid.UUID `db:"notification_template_id" json:"notification_template_id"` Actions []byte `db:"actions" json:"actions"` CustomMethod NullNotificationMethod `db:"custom_method" json:"custom_method"` UserID uuid.UUID `db:"user_id" json:"user_id"` UserEmail string `db:"user_email" json:"user_email"` UserName string `db:"user_name" json:"user_name"` UserUsername string `db:"user_username" json:"user_username"` }
type File ¶
type File struct { Hash string `db:"hash" json:"hash"` CreatedAt time.Time `db:"created_at" json:"created_at"` CreatedBy uuid.UUID `db:"created_by" json:"created_by"` Mimetype string `db:"mimetype" json:"mimetype"` Data []byte `db:"data" json:"data"` ID uuid.UUID `db:"id" json:"id"` }
func (File) RBACObject ¶
type ForeignKeyConstraint ¶ added in v2.2.0
type ForeignKeyConstraint string
ForeignKeyConstraint represents a named foreign key constraint on a table.
const ( ForeignKeyAPIKeysUserIDUUID ForeignKeyConstraint = "api_keys_user_id_uuid_fkey" // ALTER TABLE ONLY api_keys ADD CONSTRAINT api_keys_user_id_uuid_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyCryptoKeysSecretKeyID ForeignKeyConstraint = "crypto_keys_secret_key_id_fkey" // ALTER TABLE ONLY crypto_keys ADD CONSTRAINT crypto_keys_secret_key_id_fkey FOREIGN KEY (secret_key_id) REFERENCES dbcrypt_keys(active_key_digest); ForeignKeyGitAuthLinksOauthAccessTokenKeyID ForeignKeyConstraint = "git_auth_links_oauth_access_token_key_id_fkey" // ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_oauth_access_token_key_id_fkey FOREIGN KEY (oauth_access_token_key_id) REFERENCES dbcrypt_keys(active_key_digest); ForeignKeyGitAuthLinksOauthRefreshTokenKeyID ForeignKeyConstraint = "git_auth_links_oauth_refresh_token_key_id_fkey" // ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_oauth_refresh_token_key_id_fkey FOREIGN KEY (oauth_refresh_token_key_id) REFERENCES dbcrypt_keys(active_key_digest); ForeignKeyGitSSHKeysUserID ForeignKeyConstraint = "gitsshkeys_user_id_fkey" // ALTER TABLE ONLY gitsshkeys ADD CONSTRAINT gitsshkeys_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id); ForeignKeyGroupMembersGroupID ForeignKeyConstraint = "group_members_group_id_fkey" // ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_group_id_fkey FOREIGN KEY (group_id) REFERENCES groups(id) ON DELETE CASCADE; ForeignKeyGroupMembersUserID ForeignKeyConstraint = "group_members_user_id_fkey" // ALTER TABLE ONLY group_members ADD CONSTRAINT group_members_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyGroupsOrganizationID ForeignKeyConstraint = "groups_organization_id_fkey" // ALTER TABLE ONLY groups ADD CONSTRAINT groups_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; ForeignKeyInboxNotificationsTemplateID ForeignKeyConstraint = "inbox_notifications_template_id_fkey" // ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_template_id_fkey FOREIGN KEY (template_id) REFERENCES notification_templates(id) ON DELETE CASCADE; ForeignKeyInboxNotificationsUserID ForeignKeyConstraint = "inbox_notifications_user_id_fkey" // ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyJfrogXrayScansAgentID ForeignKeyConstraint = "jfrog_xray_scans_agent_id_fkey" // ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyJfrogXrayScansWorkspaceID ForeignKeyConstraint = "jfrog_xray_scans_workspace_id_fkey" // ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE; ForeignKeyNotificationMessagesNotificationTemplateID ForeignKeyConstraint = "notification_messages_notification_template_id_fkey" // ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_notification_template_id_fkey FOREIGN KEY (notification_template_id) REFERENCES notification_templates(id) ON DELETE CASCADE; ForeignKeyNotificationMessagesUserID ForeignKeyConstraint = "notification_messages_user_id_fkey" // ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyNotificationPreferencesNotificationTemplateID ForeignKeyConstraint = "notification_preferences_notification_template_id_fkey" // ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_notification_template_id_fkey FOREIGN KEY (notification_template_id) REFERENCES notification_templates(id) ON DELETE CASCADE; ForeignKeyNotificationPreferencesUserID ForeignKeyConstraint = "notification_preferences_user_id_fkey" // ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyOauth2ProviderAppCodesAppID ForeignKeyConstraint = "oauth2_provider_app_codes_app_id_fkey" // ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_app_id_fkey FOREIGN KEY (app_id) REFERENCES oauth2_provider_apps(id) ON DELETE CASCADE; ForeignKeyOauth2ProviderAppCodesUserID ForeignKeyConstraint = "oauth2_provider_app_codes_user_id_fkey" // ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyOauth2ProviderAppSecretsAppID ForeignKeyConstraint = "oauth2_provider_app_secrets_app_id_fkey" // ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_app_id_fkey FOREIGN KEY (app_id) REFERENCES oauth2_provider_apps(id) ON DELETE CASCADE; ForeignKeyOauth2ProviderAppTokensAPIKeyID ForeignKeyConstraint = "oauth2_provider_app_tokens_api_key_id_fkey" // ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_api_key_id_fkey FOREIGN KEY (api_key_id) REFERENCES api_keys(id) ON DELETE CASCADE; ForeignKeyOauth2ProviderAppTokensAppSecretID ForeignKeyConstraint = "oauth2_provider_app_tokens_app_secret_id_fkey" // ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_app_secret_id_fkey FOREIGN KEY (app_secret_id) REFERENCES oauth2_provider_app_secrets(id) ON DELETE CASCADE; ForeignKeyOrganizationMembersOrganizationIDUUID ForeignKeyConstraint = "organization_members_organization_id_uuid_fkey" // ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_organization_id_uuid_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; ForeignKeyOrganizationMembersUserIDUUID ForeignKeyConstraint = "organization_members_user_id_uuid_fkey" // ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_user_id_uuid_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyParameterSchemasJobID ForeignKeyConstraint = "parameter_schemas_job_id_fkey" // ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE; ForeignKeyProvisionerDaemonsKeyID ForeignKeyConstraint = "provisioner_daemons_key_id_fkey" // ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_key_id_fkey FOREIGN KEY (key_id) REFERENCES provisioner_keys(id) ON DELETE CASCADE; ForeignKeyProvisionerDaemonsOrganizationID ForeignKeyConstraint = "provisioner_daemons_organization_id_fkey" // ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; ForeignKeyProvisionerJobLogsJobID ForeignKeyConstraint = "provisioner_job_logs_job_id_fkey" // ALTER TABLE ONLY provisioner_job_logs ADD CONSTRAINT provisioner_job_logs_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE; ForeignKeyProvisionerJobTimingsJobID ForeignKeyConstraint = "provisioner_job_timings_job_id_fkey" // ALTER TABLE ONLY provisioner_job_timings ADD CONSTRAINT provisioner_job_timings_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE; ForeignKeyProvisionerJobsOrganizationID ForeignKeyConstraint = "provisioner_jobs_organization_id_fkey" // ALTER TABLE ONLY provisioner_jobs ADD CONSTRAINT provisioner_jobs_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; ForeignKeyProvisionerKeysOrganizationID ForeignKeyConstraint = "provisioner_keys_organization_id_fkey" // ALTER TABLE ONLY provisioner_keys ADD CONSTRAINT provisioner_keys_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; ForeignKeyTailnetAgentsCoordinatorID ForeignKeyConstraint = "tailnet_agents_coordinator_id_fkey" // ALTER TABLE ONLY tailnet_agents ADD CONSTRAINT tailnet_agents_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE; ForeignKeyTailnetClientSubscriptionsCoordinatorID ForeignKeyConstraint = "tailnet_client_subscriptions_coordinator_id_fkey" // ALTER TABLE ONLY tailnet_client_subscriptions ADD CONSTRAINT tailnet_client_subscriptions_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE; ForeignKeyTailnetClientsCoordinatorID ForeignKeyConstraint = "tailnet_clients_coordinator_id_fkey" // ALTER TABLE ONLY tailnet_clients ADD CONSTRAINT tailnet_clients_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE; ForeignKeyTailnetPeersCoordinatorID ForeignKeyConstraint = "tailnet_peers_coordinator_id_fkey" // ALTER TABLE ONLY tailnet_peers ADD CONSTRAINT tailnet_peers_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE; ForeignKeyTailnetTunnelsCoordinatorID ForeignKeyConstraint = "tailnet_tunnels_coordinator_id_fkey" // ALTER TABLE ONLY tailnet_tunnels ADD CONSTRAINT tailnet_tunnels_coordinator_id_fkey FOREIGN KEY (coordinator_id) REFERENCES tailnet_coordinators(id) ON DELETE CASCADE; ForeignKeyTemplateVersionParametersTemplateVersionID ForeignKeyConstraint = "template_version_parameters_template_version_id_fkey" // ALTER TABLE ONLY template_version_parameters ADD CONSTRAINT template_version_parameters_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE; ForeignKeyTemplateVersionPresetParametTemplateVersionPresetID ForeignKeyConstraint = "template_version_preset_paramet_template_version_preset_id_fkey" // ALTER TABLE ONLY template_version_preset_parameters ADD CONSTRAINT template_version_preset_paramet_template_version_preset_id_fkey FOREIGN KEY (template_version_preset_id) REFERENCES template_version_presets(id) ON DELETE CASCADE; ForeignKeyTemplateVersionPresetsTemplateVersionID ForeignKeyConstraint = "template_version_presets_template_version_id_fkey" // ALTER TABLE ONLY template_version_presets ADD CONSTRAINT template_version_presets_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE; ForeignKeyTemplateVersionTerraformValuesTemplateVersionID ForeignKeyConstraint = "template_version_terraform_values_template_version_id_fkey" // ALTER TABLE ONLY template_version_terraform_values ADD CONSTRAINT template_version_terraform_values_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE; ForeignKeyTemplateVersionVariablesTemplateVersionID ForeignKeyConstraint = "template_version_variables_template_version_id_fkey" // ALTER TABLE ONLY template_version_variables ADD CONSTRAINT template_version_variables_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE; ForeignKeyTemplateVersionWorkspaceTagsTemplateVersionID ForeignKeyConstraint = "template_version_workspace_tags_template_version_id_fkey" // ALTER TABLE ONLY template_version_workspace_tags ADD CONSTRAINT template_version_workspace_tags_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE; ForeignKeyTemplateVersionsCreatedBy ForeignKeyConstraint = "template_versions_created_by_fkey" // ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE RESTRICT; ForeignKeyTemplateVersionsOrganizationID ForeignKeyConstraint = "template_versions_organization_id_fkey" // ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; ForeignKeyTemplateVersionsTemplateID ForeignKeyConstraint = "template_versions_template_id_fkey" // ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_template_id_fkey FOREIGN KEY (template_id) REFERENCES templates(id) ON DELETE CASCADE; ForeignKeyTemplatesCreatedBy ForeignKeyConstraint = "templates_created_by_fkey" // ALTER TABLE ONLY templates ADD CONSTRAINT templates_created_by_fkey FOREIGN KEY (created_by) REFERENCES users(id) ON DELETE RESTRICT; ForeignKeyTemplatesOrganizationID ForeignKeyConstraint = "templates_organization_id_fkey" // ALTER TABLE ONLY templates ADD CONSTRAINT templates_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; ForeignKeyUserConfigsUserID ForeignKeyConstraint = "user_configs_user_id_fkey" // ALTER TABLE ONLY user_configs ADD CONSTRAINT user_configs_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyUserDeletedUserID ForeignKeyConstraint = "user_deleted_user_id_fkey" // ALTER TABLE ONLY user_deleted ADD CONSTRAINT user_deleted_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id); ForeignKeyUserLinksOauthAccessTokenKeyID ForeignKeyConstraint = "user_links_oauth_access_token_key_id_fkey" // ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_oauth_access_token_key_id_fkey FOREIGN KEY (oauth_access_token_key_id) REFERENCES dbcrypt_keys(active_key_digest); ForeignKeyUserLinksOauthRefreshTokenKeyID ForeignKeyConstraint = "user_links_oauth_refresh_token_key_id_fkey" // ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_oauth_refresh_token_key_id_fkey FOREIGN KEY (oauth_refresh_token_key_id) REFERENCES dbcrypt_keys(active_key_digest); ForeignKeyUserLinksUserID ForeignKeyConstraint = "user_links_user_id_fkey" // ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyUserStatusChangesUserID ForeignKeyConstraint = "user_status_changes_user_id_fkey" // ALTER TABLE ONLY user_status_changes ADD CONSTRAINT user_status_changes_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id); ForeignKeyWebpushSubscriptionsUserID ForeignKeyConstraint = "webpush_subscriptions_user_id_fkey" // ALTER TABLE ONLY webpush_subscriptions ADD CONSTRAINT webpush_subscriptions_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ForeignKeyWorkspaceAgentDevcontainersWorkspaceAgentID ForeignKeyConstraint = "workspace_agent_devcontainers_workspace_agent_id_fkey" // ALTER TABLE ONLY workspace_agent_devcontainers ADD CONSTRAINT workspace_agent_devcontainers_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyWorkspaceAgentLogSourcesWorkspaceAgentID ForeignKeyConstraint = "workspace_agent_log_sources_workspace_agent_id_fkey" // ALTER TABLE ONLY workspace_agent_log_sources ADD CONSTRAINT workspace_agent_log_sources_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyWorkspaceAgentMemoryResourceMonitorsAgentID ForeignKeyConstraint = "workspace_agent_memory_resource_monitors_agent_id_fkey" // ALTER TABLE ONLY workspace_agent_memory_resource_monitors ADD CONSTRAINT workspace_agent_memory_resource_monitors_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyWorkspaceAgentMetadataWorkspaceAgentID ForeignKeyConstraint = "workspace_agent_metadata_workspace_agent_id_fkey" // ALTER TABLE ONLY workspace_agent_metadata ADD CONSTRAINT workspace_agent_metadata_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyWorkspaceAgentScriptTimingsScriptID ForeignKeyConstraint = "workspace_agent_script_timings_script_id_fkey" // ALTER TABLE ONLY workspace_agent_script_timings ADD CONSTRAINT workspace_agent_script_timings_script_id_fkey FOREIGN KEY (script_id) REFERENCES workspace_agent_scripts(id) ON DELETE CASCADE; ForeignKeyWorkspaceAgentScriptsWorkspaceAgentID ForeignKeyConstraint = "workspace_agent_scripts_workspace_agent_id_fkey" // ALTER TABLE ONLY workspace_agent_scripts ADD CONSTRAINT workspace_agent_scripts_workspace_agent_id_fkey FOREIGN KEY (workspace_agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyWorkspaceAgentStartupLogsAgentID ForeignKeyConstraint = "workspace_agent_startup_logs_agent_id_fkey" // ALTER TABLE ONLY workspace_agent_logs ADD CONSTRAINT workspace_agent_startup_logs_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyWorkspaceAgentVolumeResourceMonitorsAgentID ForeignKeyConstraint = "workspace_agent_volume_resource_monitors_agent_id_fkey" // ALTER TABLE ONLY workspace_agent_volume_resource_monitors ADD CONSTRAINT workspace_agent_volume_resource_monitors_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyWorkspaceAgentsResourceID ForeignKeyConstraint = "workspace_agents_resource_id_fkey" // ALTER TABLE ONLY workspace_agents ADD CONSTRAINT workspace_agents_resource_id_fkey FOREIGN KEY (resource_id) REFERENCES workspace_resources(id) ON DELETE CASCADE; ForeignKeyWorkspaceAppAuditSessionsAgentID ForeignKeyConstraint = "workspace_app_audit_sessions_agent_id_fkey" // ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyWorkspaceAppStatsAgentID ForeignKeyConstraint = "workspace_app_stats_agent_id_fkey" // ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id); ForeignKeyWorkspaceAppStatsUserID ForeignKeyConstraint = "workspace_app_stats_user_id_fkey" // ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_user_id_fkey FOREIGN KEY (user_id) REFERENCES users(id); ForeignKeyWorkspaceAppStatsWorkspaceID ForeignKeyConstraint = "workspace_app_stats_workspace_id_fkey" // ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id); ForeignKeyWorkspaceAppStatusesAgentID ForeignKeyConstraint = "workspace_app_statuses_agent_id_fkey" // ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id); ForeignKeyWorkspaceAppStatusesAppID ForeignKeyConstraint = "workspace_app_statuses_app_id_fkey" // ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_app_id_fkey FOREIGN KEY (app_id) REFERENCES workspace_apps(id); ForeignKeyWorkspaceAppStatusesWorkspaceID ForeignKeyConstraint = "workspace_app_statuses_workspace_id_fkey" // ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id); ForeignKeyWorkspaceAppsAgentID ForeignKeyConstraint = "workspace_apps_agent_id_fkey" // ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_agent_id_fkey FOREIGN KEY (agent_id) REFERENCES workspace_agents(id) ON DELETE CASCADE; ForeignKeyWorkspaceBuildParametersWorkspaceBuildID ForeignKeyConstraint = "workspace_build_parameters_workspace_build_id_fkey" // ALTER TABLE ONLY workspace_build_parameters ADD CONSTRAINT workspace_build_parameters_workspace_build_id_fkey FOREIGN KEY (workspace_build_id) REFERENCES workspace_builds(id) ON DELETE CASCADE; ForeignKeyWorkspaceBuildsJobID ForeignKeyConstraint = "workspace_builds_job_id_fkey" // ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE; ForeignKeyWorkspaceBuildsTemplateVersionID ForeignKeyConstraint = "workspace_builds_template_version_id_fkey" // ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_template_version_id_fkey FOREIGN KEY (template_version_id) REFERENCES template_versions(id) ON DELETE CASCADE; ForeignKeyWorkspaceBuildsTemplateVersionPresetID ForeignKeyConstraint = "workspace_builds_template_version_preset_id_fkey" // ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_template_version_preset_id_fkey FOREIGN KEY (template_version_preset_id) REFERENCES template_version_presets(id) ON DELETE SET NULL; ForeignKeyWorkspaceBuildsWorkspaceID ForeignKeyConstraint = "workspace_builds_workspace_id_fkey" // ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_workspace_id_fkey FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE; ForeignKeyWorkspaceModulesJobID ForeignKeyConstraint = "workspace_modules_job_id_fkey" // ALTER TABLE ONLY workspace_modules ADD CONSTRAINT workspace_modules_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE; ForeignKeyWorkspaceResourceMetadataWorkspaceResourceID ForeignKeyConstraint = "workspace_resource_metadata_workspace_resource_id_fkey" // ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_workspace_resource_id_fkey FOREIGN KEY (workspace_resource_id) REFERENCES workspace_resources(id) ON DELETE CASCADE; ForeignKeyWorkspaceResourcesJobID ForeignKeyConstraint = "workspace_resources_job_id_fkey" // ALTER TABLE ONLY workspace_resources ADD CONSTRAINT workspace_resources_job_id_fkey FOREIGN KEY (job_id) REFERENCES provisioner_jobs(id) ON DELETE CASCADE; ForeignKeyWorkspacesOrganizationID ForeignKeyConstraint = "workspaces_organization_id_fkey" // ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_organization_id_fkey FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE RESTRICT; ForeignKeyWorkspacesOwnerID ForeignKeyConstraint = "workspaces_owner_id_fkey" // ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_owner_id_fkey FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE RESTRICT; ForeignKeyWorkspacesTemplateID ForeignKeyConstraint = "workspaces_template_id_fkey" // ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_template_id_fkey FOREIGN KEY (template_id) REFERENCES templates(id) ON DELETE RESTRICT; )
ForeignKeyConstraint enums.
type GetAPIKeyByNameParams ¶
type GetAuditLogsOffsetParams ¶
type GetAuditLogsOffsetParams struct { ResourceType string `db:"resource_type" json:"resource_type"` ResourceID uuid.UUID `db:"resource_id" json:"resource_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` ResourceTarget string `db:"resource_target" json:"resource_target"` Action string `db:"action" json:"action"` UserID uuid.UUID `db:"user_id" json:"user_id"` Username string `db:"username" json:"username"` Email string `db:"email" json:"email"` DateFrom time.Time `db:"date_from" json:"date_from"` DateTo time.Time `db:"date_to" json:"date_to"` BuildReason string `db:"build_reason" json:"build_reason"` RequestID uuid.UUID `db:"request_id" json:"request_id"` OffsetOpt int32 `db:"offset_opt" json:"offset_opt"` LimitOpt int32 `db:"limit_opt" json:"limit_opt"` }
type GetAuditLogsOffsetRow ¶
type GetAuditLogsOffsetRow struct { AuditLog AuditLog `db:"audit_log" json:"audit_log"` UserUsername sql.NullString `db:"user_username" json:"user_username"` UserName sql.NullString `db:"user_name" json:"user_name"` UserEmail sql.NullString `db:"user_email" json:"user_email"` UserCreatedAt sql.NullTime `db:"user_created_at" json:"user_created_at"` UserUpdatedAt sql.NullTime `db:"user_updated_at" json:"user_updated_at"` UserLastSeenAt sql.NullTime `db:"user_last_seen_at" json:"user_last_seen_at"` UserStatus NullUserStatus `db:"user_status" json:"user_status"` UserLoginType NullLoginType `db:"user_login_type" json:"user_login_type"` UserRoles pq.StringArray `db:"user_roles" json:"user_roles"` UserAvatarUrl sql.NullString `db:"user_avatar_url" json:"user_avatar_url"` UserDeleted sql.NullBool `db:"user_deleted" json:"user_deleted"` UserQuietHoursSchedule sql.NullString `db:"user_quiet_hours_schedule" json:"user_quiet_hours_schedule"` OrganizationName string `db:"organization_name" json:"organization_name"` OrganizationDisplayName string `db:"organization_display_name" json:"organization_display_name"` OrganizationIcon string `db:"organization_icon" json:"organization_icon"` Count int64 `db:"count" json:"count"` }
func (GetAuditLogsOffsetRow) RBACObject ¶ added in v2.14.0
func (w GetAuditLogsOffsetRow) RBACObject() rbac.Object
type GetAuthorizationUserRolesRow ¶
type GetAuthorizationUserRolesRow struct { ID uuid.UUID `db:"id" json:"id"` Username string `db:"username" json:"username"` Status UserStatus `db:"status" json:"status"` Email string `db:"email" json:"email"` Roles []string `db:"roles" json:"roles"` Groups []string `db:"groups" json:"groups"` }
func (GetAuthorizationUserRolesRow) RoleNames ¶ added in v2.13.0
func (r GetAuthorizationUserRolesRow) RoleNames() ([]rbac.RoleIdentifier, error)
type GetCryptoKeyByFeatureAndSequenceParams ¶ added in v2.16.0
type GetCryptoKeyByFeatureAndSequenceParams struct { Feature CryptoKeyFeature `db:"feature" json:"feature"` Sequence int32 `db:"sequence" json:"sequence"` }
type GetDeploymentDAUsRow ¶
type GetDeploymentWorkspaceAgentStatsRow ¶
type GetDeploymentWorkspaceAgentStatsRow struct { WorkspaceRxBytes int64 `db:"workspace_rx_bytes" json:"workspace_rx_bytes"` WorkspaceTxBytes int64 `db:"workspace_tx_bytes" json:"workspace_tx_bytes"` WorkspaceConnectionLatency50 float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"` WorkspaceConnectionLatency95 float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"` SessionCountVSCode int64 `db:"session_count_vscode" json:"session_count_vscode"` SessionCountSSH int64 `db:"session_count_ssh" json:"session_count_ssh"` SessionCountJetBrains int64 `db:"session_count_jetbrains" json:"session_count_jetbrains"` SessionCountReconnectingPTY int64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"` }
type GetDeploymentWorkspaceAgentUsageStatsRow ¶ added in v2.16.0
type GetDeploymentWorkspaceAgentUsageStatsRow struct { WorkspaceRxBytes int64 `db:"workspace_rx_bytes" json:"workspace_rx_bytes"` WorkspaceTxBytes int64 `db:"workspace_tx_bytes" json:"workspace_tx_bytes"` WorkspaceConnectionLatency50 float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"` WorkspaceConnectionLatency95 float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"` SessionCountVSCode int64 `db:"session_count_vscode" json:"session_count_vscode"` SessionCountSSH int64 `db:"session_count_ssh" json:"session_count_ssh"` SessionCountJetBrains int64 `db:"session_count_jetbrains" json:"session_count_jetbrains"` SessionCountReconnectingPTY int64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"` }
type GetDeploymentWorkspaceStatsRow ¶
type GetDeploymentWorkspaceStatsRow struct { PendingWorkspaces int64 `db:"pending_workspaces" json:"pending_workspaces"` BuildingWorkspaces int64 `db:"building_workspaces" json:"building_workspaces"` RunningWorkspaces int64 `db:"running_workspaces" json:"running_workspaces"` FailedWorkspaces int64 `db:"failed_workspaces" json:"failed_workspaces"` StoppedWorkspaces int64 `db:"stopped_workspaces" json:"stopped_workspaces"` }
type GetEligibleProvisionerDaemonsByProvisionerJobIDsRow ¶ added in v2.18.1
type GetEligibleProvisionerDaemonsByProvisionerJobIDsRow struct { JobID uuid.UUID `db:"job_id" json:"job_id"` ProvisionerDaemon ProvisionerDaemon `db:"provisioner_daemon" json:"provisioner_daemon"` }
func (GetEligibleProvisionerDaemonsByProvisionerJobIDsRow) RBACObject ¶ added in v2.18.1
func (p GetEligibleProvisionerDaemonsByProvisionerJobIDsRow) RBACObject() rbac.Object
type GetExternalAuthLinkParams ¶ added in v2.2.1
type GetFailedWorkspaceBuildsByTemplateIDParams ¶ added in v2.16.0
type GetFailedWorkspaceBuildsByTemplateIDRow ¶ added in v2.16.0
type GetFailedWorkspaceBuildsByTemplateIDRow struct { TemplateVersionName string `db:"template_version_name" json:"template_version_name"` WorkspaceOwnerUsername string `db:"workspace_owner_username" json:"workspace_owner_username"` WorkspaceName string `db:"workspace_name" json:"workspace_name"` WorkspaceBuildNumber int32 `db:"workspace_build_number" json:"workspace_build_number"` }
type GetFileTemplatesRow ¶
type GetFileTemplatesRow struct { FileID uuid.UUID `db:"file_id" json:"file_id"` FileCreatedBy uuid.UUID `db:"file_created_by" json:"file_created_by"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` TemplateOrganizationID uuid.UUID `db:"template_organization_id" json:"template_organization_id"` TemplateCreatedBy uuid.UUID `db:"template_created_by" json:"template_created_by"` UserACL TemplateACL `db:"user_acl" json:"user_acl"` GroupACL TemplateACL `db:"group_acl" json:"group_acl"` }
func (GetFileTemplatesRow) RBACObject ¶
func (t GetFileTemplatesRow) RBACObject() rbac.Object
type GetFilteredInboxNotificationsByUserIDParams ¶ added in v2.21.0
type GetFilteredInboxNotificationsByUserIDParams struct { UserID uuid.UUID `db:"user_id" json:"user_id"` Templates []uuid.UUID `db:"templates" json:"templates"` Targets []uuid.UUID `db:"targets" json:"targets"` ReadStatus InboxNotificationReadStatus `db:"read_status" json:"read_status"` CreatedAtOpt time.Time `db:"created_at_opt" json:"created_at_opt"` LimitOpt int32 `db:"limit_opt" json:"limit_opt"` }
type GetGroupMembersByGroupIDParams ¶ added in v2.21.0
type GetGroupMembersCountByGroupIDParams ¶ added in v2.21.0
type GetGroupsParams ¶ added in v2.15.0
type GetGroupsRow ¶ added in v2.15.0
type GetGroupsRow struct { Group Group `db:"group" json:"group"` OrganizationName string `db:"organization_name" json:"organization_name"` OrganizationDisplayName string `db:"organization_display_name" json:"organization_display_name"` }
func (GetGroupsRow) RBACObject ¶ added in v2.15.0
func (g GetGroupsRow) RBACObject() rbac.Object
type GetInboxNotificationsByUserIDParams ¶ added in v2.21.0
type GetJFrogXrayScanByWorkspaceAndAgentIDParams ¶ added in v2.8.0
type GetNotificationMessagesByStatusParams ¶ added in v2.14.0
type GetNotificationMessagesByStatusParams struct { Status NotificationMessageStatus `db:"status" json:"status"` Limit int32 `db:"limit" json:"limit"` }
type GetOAuth2ProviderAppsByUserIDRow ¶ added in v2.9.0
type GetOAuth2ProviderAppsByUserIDRow struct { TokenCount int64 `db:"token_count" json:"token_count"` OAuth2ProviderApp OAuth2ProviderApp `db:"oauth2_provider_app" json:"oauth2_provider_app"` }
func (GetOAuth2ProviderAppsByUserIDRow) RBACObject ¶ added in v2.9.0
func (a GetOAuth2ProviderAppsByUserIDRow) RBACObject() rbac.Object
type GetOrganizationByNameParams ¶ added in v2.20.0
type GetOrganizationIDsByMemberIDsRow ¶
type GetOrganizationIDsByMemberIDsRow struct { UserID uuid.UUID `db:"user_id" json:"user_id"` OrganizationIDs []uuid.UUID `db:"organization_IDs" json:"organization_IDs"` }
func (GetOrganizationIDsByMemberIDsRow) RBACObject ¶
func (m GetOrganizationIDsByMemberIDsRow) RBACObject() rbac.Object
type GetOrganizationResourceCountByIDRow ¶ added in v2.21.0
type GetOrganizationResourceCountByIDRow struct { WorkspaceCount int64 `db:"workspace_count" json:"workspace_count"` GroupCount int64 `db:"group_count" json:"group_count"` TemplateCount int64 `db:"template_count" json:"template_count"` MemberCount int64 `db:"member_count" json:"member_count"` ProvisionerKeyCount int64 `db:"provisioner_key_count" json:"provisioner_key_count"` }
type GetOrganizationsByUserIDParams ¶ added in v2.20.0
type GetOrganizationsParams ¶ added in v2.15.0
type GetProvisionerDaemonsByOrganizationParams ¶ added in v2.18.0
type GetProvisionerDaemonsWithStatusByOrganizationParams ¶ added in v2.19.0
type GetProvisionerDaemonsWithStatusByOrganizationParams struct { StaleIntervalMS int64 `db:"stale_interval_ms" json:"stale_interval_ms"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` IDs []uuid.UUID `db:"ids" json:"ids"` Tags StringMap `db:"tags" json:"tags"` Limit sql.NullInt32 `db:"limit" json:"limit"` }
type GetProvisionerDaemonsWithStatusByOrganizationRow ¶ added in v2.19.0
type GetProvisionerDaemonsWithStatusByOrganizationRow struct { ProvisionerDaemon ProvisionerDaemon `db:"provisioner_daemon" json:"provisioner_daemon"` Status ProvisionerDaemonStatus `db:"status" json:"status"` KeyName string `db:"key_name" json:"key_name"` CurrentJobID uuid.NullUUID `db:"current_job_id" json:"current_job_id"` CurrentJobStatus NullProvisionerJobStatus `db:"current_job_status" json:"current_job_status"` PreviousJobID uuid.NullUUID `db:"previous_job_id" json:"previous_job_id"` PreviousJobStatus NullProvisionerJobStatus `db:"previous_job_status" json:"previous_job_status"` CurrentJobTemplateName string `db:"current_job_template_name" json:"current_job_template_name"` CurrentJobTemplateDisplayName string `db:"current_job_template_display_name" json:"current_job_template_display_name"` CurrentJobTemplateIcon string `db:"current_job_template_icon" json:"current_job_template_icon"` PreviousJobTemplateName string `db:"previous_job_template_name" json:"previous_job_template_name"` PreviousJobTemplateDisplayName string `db:"previous_job_template_display_name" json:"previous_job_template_display_name"` PreviousJobTemplateIcon string `db:"previous_job_template_icon" json:"previous_job_template_icon"` }
func (GetProvisionerDaemonsWithStatusByOrganizationRow) RBACObject ¶ added in v2.19.0
func (p GetProvisionerDaemonsWithStatusByOrganizationRow) RBACObject() rbac.Object
type GetProvisionerJobsByIDsWithQueuePositionRow ¶
type GetProvisionerJobsByIDsWithQueuePositionRow struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` ProvisionerJob ProvisionerJob `db:"provisioner_job" json:"provisioner_job"` QueuePosition int64 `db:"queue_position" json:"queue_position"` QueueSize int64 `db:"queue_size" json:"queue_size"` }
type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams ¶ added in v2.19.0
type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerParams struct { OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` IDs []uuid.UUID `db:"ids" json:"ids"` Status []ProvisionerJobStatus `db:"status" json:"status"` Tags StringMap `db:"tags" json:"tags"` Limit sql.NullInt32 `db:"limit" json:"limit"` }
type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow ¶ added in v2.19.0
type GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow struct { ProvisionerJob ProvisionerJob `db:"provisioner_job" json:"provisioner_job"` QueuePosition int64 `db:"queue_position" json:"queue_position"` QueueSize int64 `db:"queue_size" json:"queue_size"` AvailableWorkers []uuid.UUID `db:"available_workers" json:"available_workers"` TemplateVersionName string `db:"template_version_name" json:"template_version_name"` TemplateID uuid.NullUUID `db:"template_id" json:"template_id"` TemplateName string `db:"template_name" json:"template_name"` TemplateDisplayName string `db:"template_display_name" json:"template_display_name"` TemplateIcon string `db:"template_icon" json:"template_icon"` WorkspaceID uuid.NullUUID `db:"workspace_id" json:"workspace_id"` WorkspaceName string `db:"workspace_name" json:"workspace_name"` }
func (GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow) RBACObject ¶ added in v2.19.0
func (r GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisionerRow) RBACObject() rbac.Object
type GetProvisionerKeyByNameParams ¶ added in v2.14.0
type GetQuotaAllowanceForUserParams ¶ added in v2.15.0
type GetQuotaConsumedForUserParams ¶ added in v2.15.0
type GetTailnetTunnelPeerBindingsRow ¶ added in v2.4.0
type GetTailnetTunnelPeerBindingsRow struct { PeerID uuid.UUID `db:"peer_id" json:"peer_id"` CoordinatorID uuid.UUID `db:"coordinator_id" json:"coordinator_id"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Node []byte `db:"node" json:"node"` Status TailnetStatus `db:"status" json:"status"` }
type GetTailnetTunnelPeerIDsRow ¶ added in v2.4.0
type GetTemplateAppInsightsByTemplateParams ¶ added in v2.4.0
type GetTemplateAppInsightsByTemplateRow ¶ added in v2.4.0
type GetTemplateAppInsightsByTemplateRow struct { TemplateID uuid.UUID `db:"template_id" json:"template_id"` SlugOrPort string `db:"slug_or_port" json:"slug_or_port"` DisplayName string `db:"display_name" json:"display_name"` ActiveUsers int64 `db:"active_users" json:"active_users"` UsageSeconds int64 `db:"usage_seconds" json:"usage_seconds"` }
type GetTemplateAppInsightsRow ¶
type GetTemplateAppInsightsRow struct { TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"` ActiveUsers int64 `db:"active_users" json:"active_users"` Slug string `db:"slug" json:"slug"` DisplayName string `db:"display_name" json:"display_name"` Icon string `db:"icon" json:"icon"` UsageSeconds int64 `db:"usage_seconds" json:"usage_seconds"` TimesUsed int64 `db:"times_used" json:"times_used"` }
type GetTemplateAverageBuildTimeRow ¶
type GetTemplateAverageBuildTimeRow struct { Start50 float64 `db:"start_50" json:"start_50"` Stop50 float64 `db:"stop_50" json:"stop_50"` Delete50 float64 `db:"delete_50" json:"delete_50"` Start95 float64 `db:"start_95" json:"start_95"` Stop95 float64 `db:"stop_95" json:"stop_95"` Delete95 float64 `db:"delete_95" json:"delete_95"` }
type GetTemplateDAUsParams ¶
type GetTemplateDAUsRow ¶
type GetTemplateInsightsByIntervalParams ¶ added in v2.2.0
type GetTemplateInsightsByIntervalRow ¶ added in v2.2.0
type GetTemplateInsightsByTemplateParams ¶ added in v2.3.2
type GetTemplateInsightsByTemplateRow ¶ added in v2.3.2
type GetTemplateInsightsByTemplateRow struct { TemplateID uuid.UUID `db:"template_id" json:"template_id"` ActiveUsers int64 `db:"active_users" json:"active_users"` UsageVscodeSeconds int64 `db:"usage_vscode_seconds" json:"usage_vscode_seconds"` UsageJetbrainsSeconds int64 `db:"usage_jetbrains_seconds" json:"usage_jetbrains_seconds"` UsageReconnectingPtySeconds int64 `db:"usage_reconnecting_pty_seconds" json:"usage_reconnecting_pty_seconds"` UsageSshSeconds int64 `db:"usage_ssh_seconds" json:"usage_ssh_seconds"` }
type GetTemplateInsightsRow ¶
type GetTemplateInsightsRow struct { TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"` SshTemplateIds []uuid.UUID `db:"ssh_template_ids" json:"ssh_template_ids"` SftpTemplateIds []uuid.UUID `db:"sftp_template_ids" json:"sftp_template_ids"` ReconnectingPtyTemplateIds []uuid.UUID `db:"reconnecting_pty_template_ids" json:"reconnecting_pty_template_ids"` VscodeTemplateIds []uuid.UUID `db:"vscode_template_ids" json:"vscode_template_ids"` JetbrainsTemplateIds []uuid.UUID `db:"jetbrains_template_ids" json:"jetbrains_template_ids"` ActiveUsers int64 `db:"active_users" json:"active_users"` UsageTotalSeconds int64 `db:"usage_total_seconds" json:"usage_total_seconds"` UsageSshSeconds int64 `db:"usage_ssh_seconds" json:"usage_ssh_seconds"` UsageSftpSeconds int64 `db:"usage_sftp_seconds" json:"usage_sftp_seconds"` UsageReconnectingPtySeconds int64 `db:"usage_reconnecting_pty_seconds" json:"usage_reconnecting_pty_seconds"` UsageVscodeSeconds int64 `db:"usage_vscode_seconds" json:"usage_vscode_seconds"` UsageJetbrainsSeconds int64 `db:"usage_jetbrains_seconds" json:"usage_jetbrains_seconds"` }
type GetTemplateParameterInsightsRow ¶
type GetTemplateParameterInsightsRow struct { Num int64 `db:"num" json:"num"` TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"` Name string `db:"name" json:"name"` Type string `db:"type" json:"type"` DisplayName string `db:"display_name" json:"display_name"` Description string `db:"description" json:"description"` Options json.RawMessage `db:"options" json:"options"` Value string `db:"value" json:"value"` Count int64 `db:"count" json:"count"` }
type GetTemplateUsageStatsParams ¶ added in v2.10.0
type GetTemplateVersionsByTemplateIDParams ¶
type GetTemplateVersionsByTemplateIDParams struct { TemplateID uuid.UUID `db:"template_id" json:"template_id"` Archived sql.NullBool `db:"archived" json:"archived"` AfterID uuid.UUID `db:"after_id" json:"after_id"` OffsetOpt int32 `db:"offset_opt" json:"offset_opt"` LimitOpt int32 `db:"limit_opt" json:"limit_opt"` }
type GetTemplatesWithFilterParams ¶
type GetTemplatesWithFilterParams struct { Deleted bool `db:"deleted" json:"deleted"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` ExactName string `db:"exact_name" json:"exact_name"` FuzzyName string `db:"fuzzy_name" json:"fuzzy_name"` IDs []uuid.UUID `db:"ids" json:"ids"` Deprecated sql.NullBool `db:"deprecated" json:"deprecated"` }
type GetUserActivityInsightsParams ¶ added in v2.2.0
type GetUserActivityInsightsRow ¶ added in v2.2.0
type GetUserActivityInsightsRow struct { UserID uuid.UUID `db:"user_id" json:"user_id"` Username string `db:"username" json:"username"` AvatarURL string `db:"avatar_url" json:"avatar_url"` TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"` UsageSeconds int64 `db:"usage_seconds" json:"usage_seconds"` }
type GetUserLatencyInsightsRow ¶
type GetUserLatencyInsightsRow struct { UserID uuid.UUID `db:"user_id" json:"user_id"` Username string `db:"username" json:"username"` AvatarURL string `db:"avatar_url" json:"avatar_url"` TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"` WorkspaceConnectionLatency50 float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"` WorkspaceConnectionLatency95 float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"` }
type GetUserStatusCountsParams ¶ added in v2.19.0
type GetUserStatusCountsRow ¶ added in v2.19.0
type GetUserStatusCountsRow struct { Date time.Time `db:"date" json:"date"` Status UserStatus `db:"status" json:"status"` Count int64 `db:"count" json:"count"` }
type GetUserWorkspaceBuildParametersParams ¶ added in v2.8.0
type GetUserWorkspaceBuildParametersRow ¶ added in v2.8.0
type GetUsersParams ¶
type GetUsersParams struct { AfterID uuid.UUID `db:"after_id" json:"after_id"` Search string `db:"search" json:"search"` Status []UserStatus `db:"status" json:"status"` RbacRole []string `db:"rbac_role" json:"rbac_role"` LastSeenBefore time.Time `db:"last_seen_before" json:"last_seen_before"` LastSeenAfter time.Time `db:"last_seen_after" json:"last_seen_after"` CreatedBefore time.Time `db:"created_before" json:"created_before"` CreatedAfter time.Time `db:"created_after" json:"created_after"` IncludeSystem bool `db:"include_system" json:"include_system"` GithubComUserID int64 `db:"github_com_user_id" json:"github_com_user_id"` OffsetOpt int32 `db:"offset_opt" json:"offset_opt"` LimitOpt int32 `db:"limit_opt" json:"limit_opt"` }
type GetUsersRow ¶
type GetUsersRow struct { ID uuid.UUID `db:"id" json:"id"` Email string `db:"email" json:"email"` Username string `db:"username" json:"username"` HashedPassword []byte `db:"hashed_password" json:"hashed_password"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Status UserStatus `db:"status" json:"status"` RBACRoles pq.StringArray `db:"rbac_roles" json:"rbac_roles"` LoginType LoginType `db:"login_type" json:"login_type"` AvatarURL string `db:"avatar_url" json:"avatar_url"` Deleted bool `db:"deleted" json:"deleted"` LastSeenAt time.Time `db:"last_seen_at" json:"last_seen_at"` QuietHoursSchedule string `db:"quiet_hours_schedule" json:"quiet_hours_schedule"` Name string `db:"name" json:"name"` GithubComUserID sql.NullInt64 `db:"github_com_user_id" json:"github_com_user_id"` HashedOneTimePasscode []byte `db:"hashed_one_time_passcode" json:"hashed_one_time_passcode"` OneTimePasscodeExpiresAt sql.NullTime `db:"one_time_passcode_expires_at" json:"one_time_passcode_expires_at"` IsSystem bool `db:"is_system" json:"is_system"` Count int64 `db:"count" json:"count"` }
func (GetUsersRow) RBACObject ¶
func (u GetUsersRow) RBACObject() rbac.Object
type GetWebpushVAPIDKeysRow ¶ added in v2.21.0
type GetWorkspaceAgentAndLatestBuildByAuthTokenRow ¶ added in v2.10.0
type GetWorkspaceAgentAndLatestBuildByAuthTokenRow struct { WorkspaceTable WorkspaceTable `db:"workspace_table" json:"workspace_table"` WorkspaceAgent WorkspaceAgent `db:"workspace_agent" json:"workspace_agent"` WorkspaceBuild WorkspaceBuild `db:"workspace_build" json:"workspace_build"` }
type GetWorkspaceAgentLifecycleStateByIDRow ¶
type GetWorkspaceAgentLifecycleStateByIDRow struct { LifecycleState WorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"` StartedAt sql.NullTime `db:"started_at" json:"started_at"` ReadyAt sql.NullTime `db:"ready_at" json:"ready_at"` }
type GetWorkspaceAgentMetadataParams ¶ added in v2.3.1
type GetWorkspaceAgentPortShareParams ¶ added in v2.9.0
type GetWorkspaceAgentPortShareParams struct {}
type GetWorkspaceAgentScriptTimingsByBuildIDRow ¶ added in v2.17.0
type GetWorkspaceAgentScriptTimingsByBuildIDRow struct { ScriptID uuid.UUID `db:"script_id" json:"script_id"` StartedAt time.Time `db:"started_at" json:"started_at"` EndedAt time.Time `db:"ended_at" json:"ended_at"` ExitCode int32 `db:"exit_code" json:"exit_code"` Stage WorkspaceAgentScriptTimingStage `db:"stage" json:"stage"` Status WorkspaceAgentScriptTimingStatus `db:"status" json:"status"` DisplayName string `db:"display_name" json:"display_name"` WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` WorkspaceAgentName string `db:"workspace_agent_name" json:"workspace_agent_name"` }
type GetWorkspaceAgentStatsAndLabelsRow ¶
type GetWorkspaceAgentStatsAndLabelsRow struct { Username string `db:"username" json:"username"` AgentName string `db:"agent_name" json:"agent_name"` WorkspaceName string `db:"workspace_name" json:"workspace_name"` RxBytes int64 `db:"rx_bytes" json:"rx_bytes"` TxBytes int64 `db:"tx_bytes" json:"tx_bytes"` SessionCountVSCode int64 `db:"session_count_vscode" json:"session_count_vscode"` SessionCountSSH int64 `db:"session_count_ssh" json:"session_count_ssh"` SessionCountJetBrains int64 `db:"session_count_jetbrains" json:"session_count_jetbrains"` SessionCountReconnectingPTY int64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"` ConnectionCount int64 `db:"connection_count" json:"connection_count"` ConnectionMedianLatencyMS float64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"` }
type GetWorkspaceAgentStatsRow ¶
type GetWorkspaceAgentStatsRow struct { UserID uuid.UUID `db:"user_id" json:"user_id"` AgentID uuid.UUID `db:"agent_id" json:"agent_id"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` AggregatedFrom time.Time `db:"aggregated_from" json:"aggregated_from"` WorkspaceRxBytes int64 `db:"workspace_rx_bytes" json:"workspace_rx_bytes"` WorkspaceTxBytes int64 `db:"workspace_tx_bytes" json:"workspace_tx_bytes"` WorkspaceConnectionLatency50 float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"` WorkspaceConnectionLatency95 float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"` AgentID_2 uuid.UUID `db:"agent_id_2" json:"agent_id_2"` SessionCountVSCode int64 `db:"session_count_vscode" json:"session_count_vscode"` SessionCountSSH int64 `db:"session_count_ssh" json:"session_count_ssh"` SessionCountJetBrains int64 `db:"session_count_jetbrains" json:"session_count_jetbrains"` SessionCountReconnectingPTY int64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"` }
type GetWorkspaceAgentUsageStatsAndLabelsRow ¶ added in v2.16.0
type GetWorkspaceAgentUsageStatsAndLabelsRow struct { Username string `db:"username" json:"username"` AgentName string `db:"agent_name" json:"agent_name"` WorkspaceName string `db:"workspace_name" json:"workspace_name"` RxBytes int64 `db:"rx_bytes" json:"rx_bytes"` TxBytes int64 `db:"tx_bytes" json:"tx_bytes"` SessionCountVSCode int64 `db:"session_count_vscode" json:"session_count_vscode"` SessionCountSSH int64 `db:"session_count_ssh" json:"session_count_ssh"` SessionCountJetBrains int64 `db:"session_count_jetbrains" json:"session_count_jetbrains"` SessionCountReconnectingPTY int64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"` ConnectionCount int64 `db:"connection_count" json:"connection_count"` ConnectionMedianLatencyMS float64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"` }
type GetWorkspaceAgentUsageStatsRow ¶ added in v2.16.0
type GetWorkspaceAgentUsageStatsRow struct { UserID uuid.UUID `db:"user_id" json:"user_id"` AgentID uuid.UUID `db:"agent_id" json:"agent_id"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` AggregatedFrom time.Time `db:"aggregated_from" json:"aggregated_from"` WorkspaceRxBytes int64 `db:"workspace_rx_bytes" json:"workspace_rx_bytes"` WorkspaceTxBytes int64 `db:"workspace_tx_bytes" json:"workspace_tx_bytes"` WorkspaceConnectionLatency50 float64 `db:"workspace_connection_latency_50" json:"workspace_connection_latency_50"` WorkspaceConnectionLatency95 float64 `db:"workspace_connection_latency_95" json:"workspace_connection_latency_95"` AgentID_2 uuid.UUID `db:"agent_id_2" json:"agent_id_2"` SessionCountVSCode int64 `db:"session_count_vscode" json:"session_count_vscode"` SessionCountSSH int64 `db:"session_count_ssh" json:"session_count_ssh"` SessionCountJetBrains int64 `db:"session_count_jetbrains" json:"session_count_jetbrains"` SessionCountReconnectingPTY int64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"` }
type GetWorkspaceBuildStatsByTemplatesRow ¶ added in v2.16.0
type GetWorkspaceBuildStatsByTemplatesRow struct { TemplateID uuid.UUID `db:"template_id" json:"template_id"` TemplateName string `db:"template_name" json:"template_name"` TemplateDisplayName string `db:"template_display_name" json:"template_display_name"` TemplateOrganizationID uuid.UUID `db:"template_organization_id" json:"template_organization_id"` TotalBuilds int64 `db:"total_builds" json:"total_builds"` FailedBuilds int64 `db:"failed_builds" json:"failed_builds"` }
type GetWorkspaceBuildsByWorkspaceIDParams ¶
type GetWorkspaceBuildsByWorkspaceIDParams struct { WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` Since time.Time `db:"since" json:"since"` AfterID uuid.UUID `db:"after_id" json:"after_id"` OffsetOpt int32 `db:"offset_opt" json:"offset_opt"` LimitOpt int32 `db:"limit_opt" json:"limit_opt"` }
type GetWorkspaceUniqueOwnerCountByTemplateIDsRow ¶ added in v2.5.0
type GetWorkspacesAndAgentsByOwnerIDRow ¶ added in v2.18.0
type GetWorkspacesAndAgentsByOwnerIDRow struct { ID uuid.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` JobStatus ProvisionerJobStatus `db:"job_status" json:"job_status"` Transition WorkspaceTransition `db:"transition" json:"transition"` Agents []AgentIDNamePair `db:"agents" json:"agents"` }
type GetWorkspacesEligibleForTransitionRow ¶ added in v2.18.0
type GetWorkspacesParams ¶
type GetWorkspacesParams struct { ParamNames []string `db:"param_names" json:"param_names"` ParamValues []string `db:"param_values" json:"param_values"` Deleted bool `db:"deleted" json:"deleted"` Status string `db:"status" json:"status"` OwnerID uuid.UUID `db:"owner_id" json:"owner_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` HasParam []string `db:"has_param" json:"has_param"` OwnerUsername string `db:"owner_username" json:"owner_username"` TemplateName string `db:"template_name" json:"template_name"` TemplateIDs []uuid.UUID `db:"template_ids" json:"template_ids"` WorkspaceIds []uuid.UUID `db:"workspace_ids" json:"workspace_ids"` Name string `db:"name" json:"name"` HasAgent string `db:"has_agent" json:"has_agent"` AgentInactiveDisconnectTimeoutSeconds int64 `db:"agent_inactive_disconnect_timeout_seconds" json:"agent_inactive_disconnect_timeout_seconds"` Dormant bool `db:"dormant" json:"dormant"` LastUsedBefore time.Time `db:"last_used_before" json:"last_used_before"` LastUsedAfter time.Time `db:"last_used_after" json:"last_used_after"` UsingActive sql.NullBool `db:"using_active" json:"using_active"` RequesterID uuid.UUID `db:"requester_id" json:"requester_id"` Offset int32 `db:"offset_" json:"offset_"` Limit int32 `db:"limit_" json:"limit_"` WithSummary bool `db:"with_summary" json:"with_summary"` }
type GetWorkspacesRow ¶
type GetWorkspacesRow struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OwnerID uuid.UUID `db:"owner_id" json:"owner_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` Deleted bool `db:"deleted" json:"deleted"` Name string `db:"name" json:"name"` AutostartSchedule sql.NullString `db:"autostart_schedule" json:"autostart_schedule"` Ttl sql.NullInt64 `db:"ttl" json:"ttl"` LastUsedAt time.Time `db:"last_used_at" json:"last_used_at"` DormantAt sql.NullTime `db:"dormant_at" json:"dormant_at"` DeletingAt sql.NullTime `db:"deleting_at" json:"deleting_at"` AutomaticUpdates AutomaticUpdates `db:"automatic_updates" json:"automatic_updates"` Favorite bool `db:"favorite" json:"favorite"` NextStartAt sql.NullTime `db:"next_start_at" json:"next_start_at"` OwnerAvatarUrl string `db:"owner_avatar_url" json:"owner_avatar_url"` OwnerUsername string `db:"owner_username" json:"owner_username"` OrganizationName string `db:"organization_name" json:"organization_name"` OrganizationDisplayName string `db:"organization_display_name" json:"organization_display_name"` OrganizationIcon string `db:"organization_icon" json:"organization_icon"` OrganizationDescription string `db:"organization_description" json:"organization_description"` TemplateName string `db:"template_name" json:"template_name"` TemplateDisplayName string `db:"template_display_name" json:"template_display_name"` TemplateIcon string `db:"template_icon" json:"template_icon"` TemplateDescription string `db:"template_description" json:"template_description"` TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"` TemplateVersionName sql.NullString `db:"template_version_name" json:"template_version_name"` LatestBuildCompletedAt sql.NullTime `db:"latest_build_completed_at" json:"latest_build_completed_at"` LatestBuildCanceledAt sql.NullTime `db:"latest_build_canceled_at" json:"latest_build_canceled_at"` LatestBuildError sql.NullString `db:"latest_build_error" json:"latest_build_error"` LatestBuildTransition WorkspaceTransition `db:"latest_build_transition" json:"latest_build_transition"` LatestBuildStatus ProvisionerJobStatus `db:"latest_build_status" json:"latest_build_status"` Count int64 `db:"count" json:"count"` }
type GitSSHKey ¶
type GitSSHKey struct { UserID uuid.UUID `db:"user_id" json:"user_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` PrivateKey string `db:"private_key" json:"private_key"` PublicKey string `db:"public_key" json:"public_key"` }
func (GitSSHKey) RBACObject ¶
type Group ¶
type Group struct { ID uuid.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` AvatarURL string `db:"avatar_url" json:"avatar_url"` QuotaAllowance int32 `db:"quota_allowance" json:"quota_allowance"` // Display name is a custom, human-friendly group name that user can set. This is not required to be unique and can be the empty string. DisplayName string `db:"display_name" json:"display_name"` // Source indicates how the group was created. It can be created by a user manually, or through some system process like OIDC group sync. Source GroupSource `db:"source" json:"source"` }
func (Group) Auditable ¶
func (g Group) Auditable(members []GroupMember) AuditableGroup
Auditable returns an object that can be used in audit logs. Covers both group and group member changes.
func (Group) IsEveryone ¶
func (Group) RBACObject ¶
type GroupMember ¶
type GroupMember struct { UserID uuid.UUID `db:"user_id" json:"user_id"` UserEmail string `db:"user_email" json:"user_email"` UserUsername string `db:"user_username" json:"user_username"` UserHashedPassword []byte `db:"user_hashed_password" json:"user_hashed_password"` UserCreatedAt time.Time `db:"user_created_at" json:"user_created_at"` UserUpdatedAt time.Time `db:"user_updated_at" json:"user_updated_at"` UserStatus UserStatus `db:"user_status" json:"user_status"` UserRbacRoles []string `db:"user_rbac_roles" json:"user_rbac_roles"` UserLoginType LoginType `db:"user_login_type" json:"user_login_type"` UserAvatarUrl string `db:"user_avatar_url" json:"user_avatar_url"` UserDeleted bool `db:"user_deleted" json:"user_deleted"` UserLastSeenAt time.Time `db:"user_last_seen_at" json:"user_last_seen_at"` UserQuietHoursSchedule string `db:"user_quiet_hours_schedule" json:"user_quiet_hours_schedule"` UserName string `db:"user_name" json:"user_name"` UserGithubComUserID sql.NullInt64 `db:"user_github_com_user_id" json:"user_github_com_user_id"` UserIsSystem bool `db:"user_is_system" json:"user_is_system"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` GroupName string `db:"group_name" json:"group_name"` GroupID uuid.UUID `db:"group_id" json:"group_id"` }
Joins group members with user information, organization ID, group name. Includes both regular group members and organization members (as part of the "Everyone" group).
func (GroupMember) RBACObject ¶ added in v2.15.0
func (gm GroupMember) RBACObject() rbac.Object
type GroupMemberTable ¶ added in v2.15.0
type GroupSource ¶
type GroupSource string
const ( GroupSourceUser GroupSource = "user" GroupSourceOidc GroupSource = "oidc" )
func AllGroupSourceValues ¶
func AllGroupSourceValues() []GroupSource
func (*GroupSource) Scan ¶
func (e *GroupSource) Scan(src interface{}) error
func (GroupSource) Valid ¶
func (e GroupSource) Valid() bool
type HealthSettings ¶ added in v2.5.0
type InboxNotification ¶ added in v2.21.0
type InboxNotification struct { ID uuid.UUID `db:"id" json:"id"` UserID uuid.UUID `db:"user_id" json:"user_id"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` Targets []uuid.UUID `db:"targets" json:"targets"` Title string `db:"title" json:"title"` Content string `db:"content" json:"content"` Icon string `db:"icon" json:"icon"` Actions json.RawMessage `db:"actions" json:"actions"` ReadAt sql.NullTime `db:"read_at" json:"read_at"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
func (InboxNotification) RBACObject ¶ added in v2.21.0
func (i InboxNotification) RBACObject() rbac.Object
type InboxNotificationReadStatus ¶ added in v2.21.0
type InboxNotificationReadStatus string
const ( InboxNotificationReadStatusAll InboxNotificationReadStatus = "all" InboxNotificationReadStatusUnread InboxNotificationReadStatus = "unread" InboxNotificationReadStatusRead InboxNotificationReadStatus = "read" )
func AllInboxNotificationReadStatusValues ¶ added in v2.21.0
func AllInboxNotificationReadStatusValues() []InboxNotificationReadStatus
func (*InboxNotificationReadStatus) Scan ¶ added in v2.21.0
func (e *InboxNotificationReadStatus) Scan(src interface{}) error
func (InboxNotificationReadStatus) Valid ¶ added in v2.21.0
func (e InboxNotificationReadStatus) Valid() bool
type InsertAPIKeyParams ¶
type InsertAPIKeyParams struct { ID string `db:"id" json:"id"` LifetimeSeconds int64 `db:"lifetime_seconds" json:"lifetime_seconds"` HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"` IPAddress pqtype.Inet `db:"ip_address" json:"ip_address"` UserID uuid.UUID `db:"user_id" json:"user_id"` LastUsed time.Time `db:"last_used" json:"last_used"` ExpiresAt time.Time `db:"expires_at" json:"expires_at"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` LoginType LoginType `db:"login_type" json:"login_type"` Scope APIKeyScope `db:"scope" json:"scope"` TokenName string `db:"token_name" json:"token_name"` }
type InsertAuditLogParams ¶
type InsertAuditLogParams struct { ID uuid.UUID `db:"id" json:"id"` Time time.Time `db:"time" json:"time"` UserID uuid.UUID `db:"user_id" json:"user_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` Ip pqtype.Inet `db:"ip" json:"ip"` UserAgent sql.NullString `db:"user_agent" json:"user_agent"` ResourceType ResourceType `db:"resource_type" json:"resource_type"` ResourceID uuid.UUID `db:"resource_id" json:"resource_id"` ResourceTarget string `db:"resource_target" json:"resource_target"` Action AuditAction `db:"action" json:"action"` Diff json.RawMessage `db:"diff" json:"diff"` StatusCode int32 `db:"status_code" json:"status_code"` AdditionalFields json.RawMessage `db:"additional_fields" json:"additional_fields"` RequestID uuid.UUID `db:"request_id" json:"request_id"` ResourceIcon string `db:"resource_icon" json:"resource_icon"` }
type InsertCryptoKeyParams ¶ added in v2.16.0
type InsertCryptoKeyParams struct { Feature CryptoKeyFeature `db:"feature" json:"feature"` Sequence int32 `db:"sequence" json:"sequence"` Secret sql.NullString `db:"secret" json:"secret"` StartsAt time.Time `db:"starts_at" json:"starts_at"` SecretKeyID sql.NullString `db:"secret_key_id" json:"secret_key_id"` }
type InsertCustomRoleParams ¶ added in v2.15.0
type InsertCustomRoleParams struct { Name string `db:"name" json:"name"` DisplayName string `db:"display_name" json:"display_name"` OrganizationID uuid.NullUUID `db:"organization_id" json:"organization_id"` SitePermissions CustomRolePermissions `db:"site_permissions" json:"site_permissions"` OrgPermissions CustomRolePermissions `db:"org_permissions" json:"org_permissions"` UserPermissions CustomRolePermissions `db:"user_permissions" json:"user_permissions"` }
type InsertDBCryptKeyParams ¶ added in v2.2.0
type InsertExternalAuthLinkParams ¶ added in v2.2.1
type InsertExternalAuthLinkParams struct { ProviderID string `db:"provider_id" json:"provider_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OAuthAccessToken string `db:"oauth_access_token" json:"oauth_access_token"` OAuthAccessTokenKeyID sql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"` OAuthRefreshToken string `db:"oauth_refresh_token" json:"oauth_refresh_token"` OAuthRefreshTokenKeyID sql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"` OAuthExpiry time.Time `db:"oauth_expiry" json:"oauth_expiry"` OAuthExtra pqtype.NullRawMessage `db:"oauth_extra" json:"oauth_extra"` }
type InsertFileParams ¶
type InsertGitSSHKeyParams ¶
type InsertGitSSHKeyParams struct { UserID uuid.UUID `db:"user_id" json:"user_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` PrivateKey string `db:"private_key" json:"private_key"` PublicKey string `db:"public_key" json:"public_key"` }
type InsertGroupMemberParams ¶
type InsertGroupParams ¶
type InsertGroupParams struct { ID uuid.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` DisplayName string `db:"display_name" json:"display_name"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` AvatarURL string `db:"avatar_url" json:"avatar_url"` QuotaAllowance int32 `db:"quota_allowance" json:"quota_allowance"` }
type InsertInboxNotificationParams ¶ added in v2.21.0
type InsertInboxNotificationParams struct { ID uuid.UUID `db:"id" json:"id"` UserID uuid.UUID `db:"user_id" json:"user_id"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` Targets []uuid.UUID `db:"targets" json:"targets"` Title string `db:"title" json:"title"` Content string `db:"content" json:"content"` Icon string `db:"icon" json:"icon"` Actions json.RawMessage `db:"actions" json:"actions"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
type InsertLicenseParams ¶
type InsertMemoryResourceMonitorParams ¶ added in v2.20.0
type InsertMemoryResourceMonitorParams struct { AgentID uuid.UUID `db:"agent_id" json:"agent_id"` Enabled bool `db:"enabled" json:"enabled"` State WorkspaceAgentMonitorState `db:"state" json:"state"` Threshold int32 `db:"threshold" json:"threshold"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` DebouncedUntil time.Time `db:"debounced_until" json:"debounced_until"` }
type InsertMissingGroupsParams ¶
type InsertMissingGroupsParams struct { OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` Source GroupSource `db:"source" json:"source"` GroupNames []string `db:"group_names" json:"group_names"` }
type InsertOAuth2ProviderAppCodeParams ¶ added in v2.9.0
type InsertOAuth2ProviderAppCodeParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` ExpiresAt time.Time `db:"expires_at" json:"expires_at"` SecretPrefix []byte `db:"secret_prefix" json:"secret_prefix"` HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"` AppID uuid.UUID `db:"app_id" json:"app_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` }
type InsertOAuth2ProviderAppParams ¶ added in v2.6.0
type InsertOAuth2ProviderAppParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Name string `db:"name" json:"name"` Icon string `db:"icon" json:"icon"` CallbackURL string `db:"callback_url" json:"callback_url"` }
type InsertOAuth2ProviderAppSecretParams ¶ added in v2.6.0
type InsertOAuth2ProviderAppSecretParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` SecretPrefix []byte `db:"secret_prefix" json:"secret_prefix"` HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"` DisplaySecret string `db:"display_secret" json:"display_secret"` AppID uuid.UUID `db:"app_id" json:"app_id"` }
type InsertOAuth2ProviderAppTokenParams ¶ added in v2.9.0
type InsertOAuth2ProviderAppTokenParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` ExpiresAt time.Time `db:"expires_at" json:"expires_at"` HashPrefix []byte `db:"hash_prefix" json:"hash_prefix"` RefreshHash []byte `db:"refresh_hash" json:"refresh_hash"` AppSecretID uuid.UUID `db:"app_secret_id" json:"app_secret_id"` APIKeyID string `db:"api_key_id" json:"api_key_id"` }
type InsertOrganizationMemberParams ¶
type InsertOrganizationMemberParams struct { OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Roles []string `db:"roles" json:"roles"` }
type InsertOrganizationParams ¶
type InsertOrganizationParams struct { ID uuid.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` DisplayName string `db:"display_name" json:"display_name"` Description string `db:"description" json:"description"` Icon string `db:"icon" json:"icon"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` }
type InsertPresetParametersParams ¶ added in v2.20.0
type InsertPresetParams ¶ added in v2.20.0
type InsertProvisionerJobLogsParams ¶
type InsertProvisionerJobLogsParams struct { JobID uuid.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"` }
type InsertProvisionerJobParams ¶
type InsertProvisionerJobParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` InitiatorID uuid.UUID `db:"initiator_id" json:"initiator_id"` Provisioner ProvisionerType `db:"provisioner" json:"provisioner"` StorageMethod ProvisionerStorageMethod `db:"storage_method" json:"storage_method"` FileID uuid.UUID `db:"file_id" json:"file_id"` Type ProvisionerJobType `db:"type" json:"type"` Input json.RawMessage `db:"input" json:"input"` Tags StringMap `db:"tags" json:"tags"` TraceMetadata pqtype.NullRawMessage `db:"trace_metadata" json:"trace_metadata"` }
type InsertProvisionerJobTimingsParams ¶ added in v2.15.0
type InsertProvisionerJobTimingsParams struct { JobID uuid.UUID `db:"job_id" json:"job_id"` StartedAt []time.Time `db:"started_at" json:"started_at"` EndedAt []time.Time `db:"ended_at" json:"ended_at"` Stage []ProvisionerJobTimingStage `db:"stage" json:"stage"` Source []string `db:"source" json:"source"` Action []string `db:"action" json:"action"` Resource []string `db:"resource" json:"resource"` }
type InsertProvisionerKeyParams ¶ added in v2.14.0
type InsertProvisionerKeyParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"` Tags StringMap `db:"tags" json:"tags"` Name string `db:"name" json:"name"` }
type InsertReplicaParams ¶
type InsertReplicaParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` StartedAt time.Time `db:"started_at" json:"started_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Hostname string `db:"hostname" json:"hostname"` RegionID int32 `db:"region_id" json:"region_id"` RelayAddress string `db:"relay_address" json:"relay_address"` Version string `db:"version" json:"version"` DatabaseLatency int32 `db:"database_latency" json:"database_latency"` Primary bool `db:"primary" json:"primary"` }
type InsertTelemetryItemIfNotExistsParams ¶ added in v2.19.0
type InsertTemplateParams ¶
type InsertTemplateParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` Name string `db:"name" json:"name"` Provisioner ProvisionerType `db:"provisioner" json:"provisioner"` ActiveVersionID uuid.UUID `db:"active_version_id" json:"active_version_id"` Description string `db:"description" json:"description"` CreatedBy uuid.UUID `db:"created_by" json:"created_by"` Icon string `db:"icon" json:"icon"` UserACL TemplateACL `db:"user_acl" json:"user_acl"` GroupACL TemplateACL `db:"group_acl" json:"group_acl"` DisplayName string `db:"display_name" json:"display_name"` AllowUserCancelWorkspaceJobs bool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"` MaxPortSharingLevel AppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"` }
type InsertTemplateVersionParameterParams ¶
type InsertTemplateVersionParameterParams struct { TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"` Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` Type string `db:"type" json:"type"` Mutable bool `db:"mutable" json:"mutable"` DefaultValue string `db:"default_value" json:"default_value"` Icon string `db:"icon" json:"icon"` Options json.RawMessage `db:"options" json:"options"` ValidationRegex string `db:"validation_regex" json:"validation_regex"` ValidationMin sql.NullInt32 `db:"validation_min" json:"validation_min"` ValidationMax sql.NullInt32 `db:"validation_max" json:"validation_max"` ValidationError string `db:"validation_error" json:"validation_error"` ValidationMonotonic string `db:"validation_monotonic" json:"validation_monotonic"` Required bool `db:"required" json:"required"` DisplayName string `db:"display_name" json:"display_name"` DisplayOrder int32 `db:"display_order" json:"display_order"` Ephemeral bool `db:"ephemeral" json:"ephemeral"` }
type InsertTemplateVersionParams ¶
type InsertTemplateVersionParams struct { ID uuid.UUID `db:"id" json:"id"` TemplateID uuid.NullUUID `db:"template_id" json:"template_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Name string `db:"name" json:"name"` Message string `db:"message" json:"message"` Readme string `db:"readme" json:"readme"` JobID uuid.UUID `db:"job_id" json:"job_id"` CreatedBy uuid.UUID `db:"created_by" json:"created_by"` SourceExampleID sql.NullString `db:"source_example_id" json:"source_example_id"` }
type InsertTemplateVersionTerraformValuesByJobIDParams ¶ added in v2.21.0
type InsertTemplateVersionVariableParams ¶
type InsertTemplateVersionVariableParams struct { TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"` Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` Type string `db:"type" json:"type"` Value string `db:"value" json:"value"` DefaultValue string `db:"default_value" json:"default_value"` Required bool `db:"required" json:"required"` Sensitive bool `db:"sensitive" json:"sensitive"` }
type InsertTemplateVersionWorkspaceTagParams ¶ added in v2.12.0
type InsertUserGroupsByIDParams ¶ added in v2.16.0
type InsertUserLinkParams ¶
type InsertUserLinkParams struct { UserID uuid.UUID `db:"user_id" json:"user_id"` LoginType LoginType `db:"login_type" json:"login_type"` LinkedID string `db:"linked_id" json:"linked_id"` OAuthAccessToken string `db:"oauth_access_token" json:"oauth_access_token"` OAuthAccessTokenKeyID sql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"` OAuthRefreshToken string `db:"oauth_refresh_token" json:"oauth_refresh_token"` OAuthRefreshTokenKeyID sql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"` OAuthExpiry time.Time `db:"oauth_expiry" json:"oauth_expiry"` Claims UserLinkClaims `db:"claims" json:"claims"` }
type InsertUserParams ¶
type InsertUserParams struct { ID uuid.UUID `db:"id" json:"id"` Email string `db:"email" json:"email"` Username string `db:"username" json:"username"` Name string `db:"name" json:"name"` HashedPassword []byte `db:"hashed_password" json:"hashed_password"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` RBACRoles pq.StringArray `db:"rbac_roles" json:"rbac_roles"` LoginType LoginType `db:"login_type" json:"login_type"` Status string `db:"status" json:"status"` }
type InsertVolumeResourceMonitorParams ¶ added in v2.20.0
type InsertVolumeResourceMonitorParams struct { AgentID uuid.UUID `db:"agent_id" json:"agent_id"` Path string `db:"path" json:"path"` Enabled bool `db:"enabled" json:"enabled"` State WorkspaceAgentMonitorState `db:"state" json:"state"` Threshold int32 `db:"threshold" json:"threshold"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` DebouncedUntil time.Time `db:"debounced_until" json:"debounced_until"` }
type InsertWebpushSubscriptionParams ¶ added in v2.21.0
type InsertWebpushSubscriptionParams struct { UserID uuid.UUID `db:"user_id" json:"user_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` Endpoint string `db:"endpoint" json:"endpoint"` EndpointP256dhKey string `db:"endpoint_p256dh_key" json:"endpoint_p256dh_key"` EndpointAuthKey string `db:"endpoint_auth_key" json:"endpoint_auth_key"` }
type InsertWorkspaceAgentDevcontainersParams ¶ added in v2.21.0
type InsertWorkspaceAgentDevcontainersParams struct { WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` ID []uuid.UUID `db:"id" json:"id"` Name []string `db:"name" json:"name"` WorkspaceFolder []string `db:"workspace_folder" json:"workspace_folder"` ConfigPath []string `db:"config_path" json:"config_path"` }
type InsertWorkspaceAgentLogSourcesParams ¶ added in v2.2.0
type InsertWorkspaceAgentLogSourcesParams struct { WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` ID []uuid.UUID `db:"id" json:"id"` DisplayName []string `db:"display_name" json:"display_name"` Icon []string `db:"icon" json:"icon"` }
type InsertWorkspaceAgentLogsParams ¶
type InsertWorkspaceAgentLogsParams struct { AgentID uuid.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"` LogSourceID uuid.UUID `db:"log_source_id" json:"log_source_id"` OutputLength int32 `db:"output_length" json:"output_length"` }
type InsertWorkspaceAgentMetadataParams ¶
type InsertWorkspaceAgentMetadataParams struct { WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` DisplayName string `db:"display_name" json:"display_name"` Key string `db:"key" json:"key"` Script string `db:"script" json:"script"` Timeout int64 `db:"timeout" json:"timeout"` Interval int64 `db:"interval" json:"interval"` DisplayOrder int32 `db:"display_order" json:"display_order"` }
type InsertWorkspaceAgentParams ¶
type InsertWorkspaceAgentParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Name string `db:"name" json:"name"` ResourceID uuid.UUID `db:"resource_id" json:"resource_id"` AuthToken uuid.UUID `db:"auth_token" json:"auth_token"` AuthInstanceID sql.NullString `db:"auth_instance_id" json:"auth_instance_id"` Architecture string `db:"architecture" json:"architecture"` EnvironmentVariables pqtype.NullRawMessage `db:"environment_variables" json:"environment_variables"` OperatingSystem string `db:"operating_system" json:"operating_system"` Directory string `db:"directory" json:"directory"` InstanceMetadata pqtype.NullRawMessage `db:"instance_metadata" json:"instance_metadata"` ResourceMetadata pqtype.NullRawMessage `db:"resource_metadata" json:"resource_metadata"` ConnectionTimeoutSeconds int32 `db:"connection_timeout_seconds" json:"connection_timeout_seconds"` TroubleshootingURL string `db:"troubleshooting_url" json:"troubleshooting_url"` MOTDFile string `db:"motd_file" json:"motd_file"` DisplayApps []DisplayApp `db:"display_apps" json:"display_apps"` DisplayOrder int32 `db:"display_order" json:"display_order"` }
type InsertWorkspaceAgentScriptTimingsParams ¶ added in v2.16.0
type InsertWorkspaceAgentScriptTimingsParams struct { ScriptID uuid.UUID `db:"script_id" json:"script_id"` StartedAt time.Time `db:"started_at" json:"started_at"` EndedAt time.Time `db:"ended_at" json:"ended_at"` ExitCode int32 `db:"exit_code" json:"exit_code"` Stage WorkspaceAgentScriptTimingStage `db:"stage" json:"stage"` Status WorkspaceAgentScriptTimingStatus `db:"status" json:"status"` }
type InsertWorkspaceAgentScriptsParams ¶ added in v2.2.0
type InsertWorkspaceAgentScriptsParams struct { WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` LogSourceID []uuid.UUID `db:"log_source_id" json:"log_source_id"` LogPath []string `db:"log_path" json:"log_path"` Script []string `db:"script" json:"script"` Cron []string `db:"cron" json:"cron"` StartBlocksLogin []bool `db:"start_blocks_login" json:"start_blocks_login"` RunOnStart []bool `db:"run_on_start" json:"run_on_start"` RunOnStop []bool `db:"run_on_stop" json:"run_on_stop"` TimeoutSeconds []int32 `db:"timeout_seconds" json:"timeout_seconds"` DisplayName []string `db:"display_name" json:"display_name"` ID []uuid.UUID `db:"id" json:"id"` }
type InsertWorkspaceAgentStatsParams ¶
type InsertWorkspaceAgentStatsParams struct { ID []uuid.UUID `db:"id" json:"id"` CreatedAt []time.Time `db:"created_at" json:"created_at"` UserID []uuid.UUID `db:"user_id" json:"user_id"` WorkspaceID []uuid.UUID `db:"workspace_id" json:"workspace_id"` TemplateID []uuid.UUID `db:"template_id" json:"template_id"` AgentID []uuid.UUID `db:"agent_id" json:"agent_id"` ConnectionsByProto json.RawMessage `db:"connections_by_proto" json:"connections_by_proto"` ConnectionCount []int64 `db:"connection_count" json:"connection_count"` RxPackets []int64 `db:"rx_packets" json:"rx_packets"` RxBytes []int64 `db:"rx_bytes" json:"rx_bytes"` TxPackets []int64 `db:"tx_packets" json:"tx_packets"` TxBytes []int64 `db:"tx_bytes" json:"tx_bytes"` SessionCountVSCode []int64 `db:"session_count_vscode" json:"session_count_vscode"` SessionCountJetBrains []int64 `db:"session_count_jetbrains" json:"session_count_jetbrains"` SessionCountReconnectingPTY []int64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"` SessionCountSSH []int64 `db:"session_count_ssh" json:"session_count_ssh"` ConnectionMedianLatencyMS []float64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"` Usage []bool `db:"usage" json:"usage"` }
type InsertWorkspaceAppParams ¶
type InsertWorkspaceAppParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` AgentID uuid.UUID `db:"agent_id" json:"agent_id"` Slug string `db:"slug" json:"slug"` DisplayName string `db:"display_name" json:"display_name"` Icon string `db:"icon" json:"icon"` Command sql.NullString `db:"command" json:"command"` Url sql.NullString `db:"url" json:"url"` External bool `db:"external" json:"external"` Subdomain bool `db:"subdomain" json:"subdomain"` SharingLevel AppSharingLevel `db:"sharing_level" json:"sharing_level"` HealthcheckUrl string `db:"healthcheck_url" json:"healthcheck_url"` HealthcheckInterval int32 `db:"healthcheck_interval" json:"healthcheck_interval"` HealthcheckThreshold int32 `db:"healthcheck_threshold" json:"healthcheck_threshold"` Health WorkspaceAppHealth `db:"health" json:"health"` DisplayOrder int32 `db:"display_order" json:"display_order"` Hidden bool `db:"hidden" json:"hidden"` OpenIn WorkspaceAppOpenIn `db:"open_in" json:"open_in"` }
type InsertWorkspaceAppStatsParams ¶
type InsertWorkspaceAppStatsParams struct { UserID []uuid.UUID `db:"user_id" json:"user_id"` WorkspaceID []uuid.UUID `db:"workspace_id" json:"workspace_id"` AgentID []uuid.UUID `db:"agent_id" json:"agent_id"` AccessMethod []string `db:"access_method" json:"access_method"` SlugOrPort []string `db:"slug_or_port" json:"slug_or_port"` SessionID []uuid.UUID `db:"session_id" json:"session_id"` SessionStartedAt []time.Time `db:"session_started_at" json:"session_started_at"` SessionEndedAt []time.Time `db:"session_ended_at" json:"session_ended_at"` Requests []int32 `db:"requests" json:"requests"` }
type InsertWorkspaceAppStatusParams ¶ added in v2.21.0
type InsertWorkspaceAppStatusParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` AgentID uuid.UUID `db:"agent_id" json:"agent_id"` AppID uuid.UUID `db:"app_id" json:"app_id"` State WorkspaceAppStatusState `db:"state" json:"state"` Message string `db:"message" json:"message"` NeedsUserAttention bool `db:"needs_user_attention" json:"needs_user_attention"` Uri sql.NullString `db:"uri" json:"uri"` Icon sql.NullString `db:"icon" json:"icon"` }
type InsertWorkspaceBuildParams ¶
type InsertWorkspaceBuildParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"` BuildNumber int32 `db:"build_number" json:"build_number"` Transition WorkspaceTransition `db:"transition" json:"transition"` InitiatorID uuid.UUID `db:"initiator_id" json:"initiator_id"` JobID uuid.UUID `db:"job_id" json:"job_id"` ProvisionerState []byte `db:"provisioner_state" json:"provisioner_state"` Deadline time.Time `db:"deadline" json:"deadline"` MaxDeadline time.Time `db:"max_deadline" json:"max_deadline"` Reason BuildReason `db:"reason" json:"reason"` TemplateVersionPresetID uuid.NullUUID `db:"template_version_preset_id" json:"template_version_preset_id"` }
type InsertWorkspaceModuleParams ¶ added in v2.18.0
type InsertWorkspaceModuleParams struct { ID uuid.UUID `db:"id" json:"id"` JobID uuid.UUID `db:"job_id" json:"job_id"` Transition WorkspaceTransition `db:"transition" json:"transition"` Source string `db:"source" json:"source"` Version string `db:"version" json:"version"` Key string `db:"key" json:"key"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
type InsertWorkspaceParams ¶
type InsertWorkspaceParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OwnerID uuid.UUID `db:"owner_id" json:"owner_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` Name string `db:"name" json:"name"` AutostartSchedule sql.NullString `db:"autostart_schedule" json:"autostart_schedule"` Ttl sql.NullInt64 `db:"ttl" json:"ttl"` LastUsedAt time.Time `db:"last_used_at" json:"last_used_at"` AutomaticUpdates AutomaticUpdates `db:"automatic_updates" json:"automatic_updates"` NextStartAt sql.NullTime `db:"next_start_at" json:"next_start_at"` }
type InsertWorkspaceProxyParams ¶
type InsertWorkspaceProxyParams struct { ID uuid.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` DisplayName string `db:"display_name" json:"display_name"` Icon string `db:"icon" json:"icon"` DerpEnabled bool `db:"derp_enabled" json:"derp_enabled"` DerpOnly bool `db:"derp_only" json:"derp_only"` TokenHashedSecret []byte `db:"token_hashed_secret" json:"token_hashed_secret"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` }
type InsertWorkspaceResourceParams ¶
type InsertWorkspaceResourceParams struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` JobID uuid.UUID `db:"job_id" json:"job_id"` Transition WorkspaceTransition `db:"transition" json:"transition"` Type string `db:"type" json:"type"` Name string `db:"name" json:"name"` Hide bool `db:"hide" json:"hide"` Icon string `db:"icon" json:"icon"` InstanceType sql.NullString `db:"instance_type" json:"instance_type"` DailyCost int32 `db:"daily_cost" json:"daily_cost"` ModulePath sql.NullString `db:"module_path" json:"module_path"` }
type JfrogXrayScan ¶ added in v2.8.0
type JfrogXrayScan struct { AgentID uuid.UUID `db:"agent_id" json:"agent_id"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` Critical int32 `db:"critical" json:"critical"` High int32 `db:"high" json:"high"` Medium int32 `db:"medium" json:"medium"` ResultsUrl string `db:"results_url" json:"results_url"` }
type License ¶
type License struct { ID int32 `db:"id" json:"id"` UploadedAt time.Time `db:"uploaded_at" json:"uploaded_at"` JWT string `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. Exp time.Time `db:"exp" json:"exp"` UUID uuid.UUID `db:"uuid" json:"uuid"` }
func (License) RBACObject ¶
type LogSource ¶
type LogSource string
func AllLogSourceValues ¶
func AllLogSourceValues() []LogSource
type LoginType ¶
type LoginType string
Specifies the method of authentication. "none" is a special case in which no authentication method is allowed.
func AllLoginTypeValues ¶
func AllLoginTypeValues() []LoginType
type MarkAllInboxNotificationsAsReadParams ¶ added in v2.21.0
type NameOrganizationPair ¶ added in v2.13.0
type NameOrganizationPair struct { Name string `db:"name" json:"name"` // OrganizationID if unset will assume a null column value OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` }
NameOrganizationPair is used as a lookup tuple for custom role rows.
func (*NameOrganizationPair) Scan ¶ added in v2.13.0
func (*NameOrganizationPair) Scan(_ interface{}) error
func (NameOrganizationPair) Value ¶ added in v2.13.0
func (a NameOrganizationPair) Value() (driver.Value, error)
Value returns the tuple **literal** To get the literal value to return, you can use the expression syntax in a psql shell.
SELECT ('customrole'::text,'ece79dac-926e-44ca-9790-2ff7c5eb6e0c'::uuid); To see 'null' option. Using the nil uuid as null to avoid empty string literals for null. SELECT ('customrole',00000000-0000-0000-0000-000000000000);
This value is usually used as an array, NameOrganizationPair[]. You can see what that literal is as well, with proper quoting.
SELECT ARRAY[('customrole'::text,'ece79dac-926e-44ca-9790-2ff7c5eb6e0c'::uuid)];
type NotificationMessage ¶ added in v2.13.0
type NotificationMessage struct { ID uuid.UUID `db:"id" json:"id"` NotificationTemplateID uuid.UUID `db:"notification_template_id" json:"notification_template_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` Method NotificationMethod `db:"method" json:"method"` Status NotificationMessageStatus `db:"status" json:"status"` StatusReason sql.NullString `db:"status_reason" json:"status_reason"` CreatedBy string `db:"created_by" json:"created_by"` Payload []byte `db:"payload" json:"payload"` AttemptCount sql.NullInt32 `db:"attempt_count" json:"attempt_count"` Targets []uuid.UUID `db:"targets" json:"targets"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt sql.NullTime `db:"updated_at" json:"updated_at"` LeasedUntil sql.NullTime `db:"leased_until" json:"leased_until"` NextRetryAfter sql.NullTime `db:"next_retry_after" json:"next_retry_after"` QueuedSeconds sql.NullFloat64 `db:"queued_seconds" json:"queued_seconds"` // Auto-generated by insert/update trigger, used to prevent duplicate notifications from being enqueued on the same day DedupeHash sql.NullString `db:"dedupe_hash" json:"dedupe_hash"` }
type NotificationMessageStatus ¶ added in v2.13.0
type NotificationMessageStatus string
const ( NotificationMessageStatusPending NotificationMessageStatus = "pending" NotificationMessageStatusLeased NotificationMessageStatus = "leased" NotificationMessageStatusSent NotificationMessageStatus = "sent" NotificationMessageStatusPermanentFailure NotificationMessageStatus = "permanent_failure" NotificationMessageStatusTemporaryFailure NotificationMessageStatus = "temporary_failure" NotificationMessageStatusUnknown NotificationMessageStatus = "unknown" NotificationMessageStatusInhibited NotificationMessageStatus = "inhibited" )
func AllNotificationMessageStatusValues ¶ added in v2.13.0
func AllNotificationMessageStatusValues() []NotificationMessageStatus
func (*NotificationMessageStatus) Scan ¶ added in v2.13.0
func (e *NotificationMessageStatus) Scan(src interface{}) error
func (NotificationMessageStatus) Valid ¶ added in v2.13.0
func (e NotificationMessageStatus) Valid() bool
type NotificationMethod ¶ added in v2.13.0
type NotificationMethod string
const ( NotificationMethodSmtp NotificationMethod = "smtp" NotificationMethodWebhook NotificationMethod = "webhook" NotificationMethodInbox NotificationMethod = "inbox" )
func AllNotificationMethodValues ¶ added in v2.13.0
func AllNotificationMethodValues() []NotificationMethod
func (*NotificationMethod) Scan ¶ added in v2.13.0
func (e *NotificationMethod) Scan(src interface{}) error
func (NotificationMethod) Valid ¶ added in v2.13.0
func (e NotificationMethod) Valid() bool
type NotificationPreference ¶ added in v2.15.0
type NotificationPreference struct { UserID uuid.UUID `db:"user_id" json:"user_id"` NotificationTemplateID uuid.UUID `db:"notification_template_id" json:"notification_template_id"` Disabled bool `db:"disabled" json:"disabled"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` }
type NotificationReportGeneratorLog ¶ added in v2.16.0
type NotificationReportGeneratorLog struct { NotificationTemplateID uuid.UUID `db:"notification_template_id" json:"notification_template_id"` LastGeneratedAt time.Time `db:"last_generated_at" json:"last_generated_at"` }
Log of generated reports for users.
type NotificationTemplate ¶ added in v2.13.0
type NotificationTemplate struct { ID uuid.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` TitleTemplate string `db:"title_template" json:"title_template"` BodyTemplate string `db:"body_template" json:"body_template"` Actions []byte `db:"actions" json:"actions"` Group sql.NullString `db:"group" json:"group"` // NULL defers to the deployment-level method Method NullNotificationMethod `db:"method" json:"method"` Kind NotificationTemplateKind `db:"kind" json:"kind"` EnabledByDefault bool `db:"enabled_by_default" json:"enabled_by_default"` }
Templates from which to create notification messages.
type NotificationTemplateKind ¶ added in v2.15.0
type NotificationTemplateKind string
const (
NotificationTemplateKindSystem NotificationTemplateKind = "system"
)
func AllNotificationTemplateKindValues ¶ added in v2.15.0
func AllNotificationTemplateKindValues() []NotificationTemplateKind
func (*NotificationTemplateKind) Scan ¶ added in v2.15.0
func (e *NotificationTemplateKind) Scan(src interface{}) error
func (NotificationTemplateKind) Valid ¶ added in v2.15.0
func (e NotificationTemplateKind) Valid() bool
type NotificationsSettings ¶ added in v2.14.0
type NullAPIKeyScope ¶
type NullAPIKeyScope struct { APIKeyScope APIKeyScope `json:"api_key_scope"` Valid bool `json:"valid"` // Valid is true if APIKeyScope is not NULL }
func (*NullAPIKeyScope) Scan ¶
func (ns *NullAPIKeyScope) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullAppSharingLevel ¶
type NullAppSharingLevel struct { AppSharingLevel AppSharingLevel `json:"app_sharing_level"` Valid bool `json:"valid"` // Valid is true if AppSharingLevel is not NULL }
func (*NullAppSharingLevel) Scan ¶
func (ns *NullAppSharingLevel) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullAuditAction ¶
type NullAuditAction struct { AuditAction AuditAction `json:"audit_action"` Valid bool `json:"valid"` // Valid is true if AuditAction is not NULL }
func (*NullAuditAction) Scan ¶
func (ns *NullAuditAction) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullAutomaticUpdates ¶ added in v2.3.0
type NullAutomaticUpdates struct { AutomaticUpdates AutomaticUpdates `json:"automatic_updates"` Valid bool `json:"valid"` // Valid is true if AutomaticUpdates is not NULL }
func (*NullAutomaticUpdates) Scan ¶ added in v2.3.0
func (ns *NullAutomaticUpdates) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullBuildReason ¶
type NullBuildReason struct { BuildReason BuildReason `json:"build_reason"` Valid bool `json:"valid"` // Valid is true if BuildReason is not NULL }
func (*NullBuildReason) Scan ¶
func (ns *NullBuildReason) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullCryptoKeyFeature ¶ added in v2.16.0
type NullCryptoKeyFeature struct { CryptoKeyFeature CryptoKeyFeature `json:"crypto_key_feature"` Valid bool `json:"valid"` // Valid is true if CryptoKeyFeature is not NULL }
func (*NullCryptoKeyFeature) Scan ¶ added in v2.16.0
func (ns *NullCryptoKeyFeature) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullDisplayApp ¶ added in v2.1.5
type NullDisplayApp struct { DisplayApp DisplayApp `json:"display_app"` Valid bool `json:"valid"` // Valid is true if DisplayApp is not NULL }
func (*NullDisplayApp) Scan ¶ added in v2.1.5
func (ns *NullDisplayApp) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullGroupSource ¶
type NullGroupSource struct { GroupSource GroupSource `json:"group_source"` Valid bool `json:"valid"` // Valid is true if GroupSource is not NULL }
func (*NullGroupSource) Scan ¶
func (ns *NullGroupSource) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullInboxNotificationReadStatus ¶ added in v2.21.0
type NullInboxNotificationReadStatus struct { InboxNotificationReadStatus InboxNotificationReadStatus `json:"inbox_notification_read_status"` Valid bool `json:"valid"` // Valid is true if InboxNotificationReadStatus is not NULL }
func (*NullInboxNotificationReadStatus) Scan ¶ added in v2.21.0
func (ns *NullInboxNotificationReadStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullLogLevel ¶
type NullLogLevel struct { LogLevel LogLevel `json:"log_level"` Valid bool `json:"valid"` // Valid is true if LogLevel is not NULL }
func (*NullLogLevel) Scan ¶
func (ns *NullLogLevel) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullLogSource ¶
type NullLogSource struct { LogSource LogSource `json:"log_source"` Valid bool `json:"valid"` // Valid is true if LogSource is not NULL }
func (*NullLogSource) Scan ¶
func (ns *NullLogSource) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullLoginType ¶
type NullLoginType struct { LoginType LoginType `json:"login_type"` Valid bool `json:"valid"` // Valid is true if LoginType is not NULL }
func (*NullLoginType) Scan ¶
func (ns *NullLoginType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullNotificationMessageStatus ¶ added in v2.13.0
type NullNotificationMessageStatus struct { NotificationMessageStatus NotificationMessageStatus `json:"notification_message_status"` Valid bool `json:"valid"` // Valid is true if NotificationMessageStatus is not NULL }
func (*NullNotificationMessageStatus) Scan ¶ added in v2.13.0
func (ns *NullNotificationMessageStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullNotificationMethod ¶ added in v2.13.0
type NullNotificationMethod struct { NotificationMethod NotificationMethod `json:"notification_method"` Valid bool `json:"valid"` // Valid is true if NotificationMethod is not NULL }
func (*NullNotificationMethod) Scan ¶ added in v2.13.0
func (ns *NullNotificationMethod) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullNotificationTemplateKind ¶ added in v2.15.0
type NullNotificationTemplateKind struct { NotificationTemplateKind NotificationTemplateKind `json:"notification_template_kind"` Valid bool `json:"valid"` // Valid is true if NotificationTemplateKind is not NULL }
func (*NullNotificationTemplateKind) Scan ¶ added in v2.15.0
func (ns *NullNotificationTemplateKind) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullParameterDestinationScheme ¶
type NullParameterDestinationScheme struct { ParameterDestinationScheme ParameterDestinationScheme `json:"parameter_destination_scheme"` Valid bool `json:"valid"` // Valid is true if ParameterDestinationScheme is not NULL }
func (*NullParameterDestinationScheme) Scan ¶
func (ns *NullParameterDestinationScheme) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullParameterScope ¶
type NullParameterScope struct { ParameterScope ParameterScope `json:"parameter_scope"` Valid bool `json:"valid"` // Valid is true if ParameterScope is not NULL }
func (*NullParameterScope) Scan ¶
func (ns *NullParameterScope) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullParameterSourceScheme ¶
type NullParameterSourceScheme struct { ParameterSourceScheme ParameterSourceScheme `json:"parameter_source_scheme"` Valid bool `json:"valid"` // Valid is true if ParameterSourceScheme is not NULL }
func (*NullParameterSourceScheme) Scan ¶
func (ns *NullParameterSourceScheme) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullParameterTypeSystem ¶
type NullParameterTypeSystem struct { ParameterTypeSystem ParameterTypeSystem `json:"parameter_type_system"` Valid bool `json:"valid"` // Valid is true if ParameterTypeSystem is not NULL }
func (*NullParameterTypeSystem) Scan ¶
func (ns *NullParameterTypeSystem) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullPortShareProtocol ¶ added in v2.9.0
type NullPortShareProtocol struct {}
func (*NullPortShareProtocol) Scan ¶ added in v2.9.0
func (ns *NullPortShareProtocol) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullProvisionerDaemonStatus ¶ added in v2.19.0
type NullProvisionerDaemonStatus struct { ProvisionerDaemonStatus ProvisionerDaemonStatus `json:"provisioner_daemon_status"` Valid bool `json:"valid"` // Valid is true if ProvisionerDaemonStatus is not NULL }
func (*NullProvisionerDaemonStatus) Scan ¶ added in v2.19.0
func (ns *NullProvisionerDaemonStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullProvisionerJobStatus ¶ added in v2.3.0
type NullProvisionerJobStatus struct { ProvisionerJobStatus ProvisionerJobStatus `json:"provisioner_job_status"` Valid bool `json:"valid"` // Valid is true if ProvisionerJobStatus is not NULL }
func (*NullProvisionerJobStatus) Scan ¶ added in v2.3.0
func (ns *NullProvisionerJobStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullProvisionerJobTimingStage ¶ added in v2.15.0
type NullProvisionerJobTimingStage struct { ProvisionerJobTimingStage ProvisionerJobTimingStage `json:"provisioner_job_timing_stage"` Valid bool `json:"valid"` // Valid is true if ProvisionerJobTimingStage is not NULL }
func (*NullProvisionerJobTimingStage) Scan ¶ added in v2.15.0
func (ns *NullProvisionerJobTimingStage) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullProvisionerJobType ¶
type NullProvisionerJobType struct { ProvisionerJobType ProvisionerJobType `json:"provisioner_job_type"` Valid bool `json:"valid"` // Valid is true if ProvisionerJobType is not NULL }
func (*NullProvisionerJobType) Scan ¶
func (ns *NullProvisionerJobType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullProvisionerStorageMethod ¶
type NullProvisionerStorageMethod struct { ProvisionerStorageMethod ProvisionerStorageMethod `json:"provisioner_storage_method"` Valid bool `json:"valid"` // Valid is true if ProvisionerStorageMethod is not NULL }
func (*NullProvisionerStorageMethod) Scan ¶
func (ns *NullProvisionerStorageMethod) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullProvisionerType ¶
type NullProvisionerType struct { ProvisionerType ProvisionerType `json:"provisioner_type"` Valid bool `json:"valid"` // Valid is true if ProvisionerType is not NULL }
func (*NullProvisionerType) Scan ¶
func (ns *NullProvisionerType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullResourceType ¶
type NullResourceType struct { ResourceType ResourceType `json:"resource_type"` Valid bool `json:"valid"` // Valid is true if ResourceType is not NULL }
func (*NullResourceType) Scan ¶
func (ns *NullResourceType) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullStartupScriptBehavior ¶
type NullStartupScriptBehavior struct { StartupScriptBehavior StartupScriptBehavior `json:"startup_script_behavior"` Valid bool `json:"valid"` // Valid is true if StartupScriptBehavior is not NULL }
func (*NullStartupScriptBehavior) Scan ¶
func (ns *NullStartupScriptBehavior) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullTailnetStatus ¶ added in v2.4.0
type NullTailnetStatus struct { TailnetStatus TailnetStatus `json:"tailnet_status"` Valid bool `json:"valid"` // Valid is true if TailnetStatus is not NULL }
func (*NullTailnetStatus) Scan ¶ added in v2.4.0
func (ns *NullTailnetStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullUserStatus ¶
type NullUserStatus struct { UserStatus UserStatus `json:"user_status"` Valid bool `json:"valid"` // Valid is true if UserStatus is not NULL }
func (*NullUserStatus) Scan ¶
func (ns *NullUserStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWorkspaceAgentLifecycleState ¶
type NullWorkspaceAgentLifecycleState struct { WorkspaceAgentLifecycleState WorkspaceAgentLifecycleState `json:"workspace_agent_lifecycle_state"` Valid bool `json:"valid"` // Valid is true if WorkspaceAgentLifecycleState is not NULL }
func (*NullWorkspaceAgentLifecycleState) Scan ¶
func (ns *NullWorkspaceAgentLifecycleState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWorkspaceAgentMonitorState ¶ added in v2.20.0
type NullWorkspaceAgentMonitorState struct { WorkspaceAgentMonitorState WorkspaceAgentMonitorState `json:"workspace_agent_monitor_state"` Valid bool `json:"valid"` // Valid is true if WorkspaceAgentMonitorState is not NULL }
func (*NullWorkspaceAgentMonitorState) Scan ¶ added in v2.20.0
func (ns *NullWorkspaceAgentMonitorState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWorkspaceAgentScriptTimingStage ¶ added in v2.16.0
type NullWorkspaceAgentScriptTimingStage struct { WorkspaceAgentScriptTimingStage WorkspaceAgentScriptTimingStage `json:"workspace_agent_script_timing_stage"` Valid bool `json:"valid"` // Valid is true if WorkspaceAgentScriptTimingStage is not NULL }
func (*NullWorkspaceAgentScriptTimingStage) Scan ¶ added in v2.16.0
func (ns *NullWorkspaceAgentScriptTimingStage) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWorkspaceAgentScriptTimingStatus ¶ added in v2.16.0
type NullWorkspaceAgentScriptTimingStatus struct { WorkspaceAgentScriptTimingStatus WorkspaceAgentScriptTimingStatus `json:"workspace_agent_script_timing_status"` Valid bool `json:"valid"` // Valid is true if WorkspaceAgentScriptTimingStatus is not NULL }
func (*NullWorkspaceAgentScriptTimingStatus) Scan ¶ added in v2.16.0
func (ns *NullWorkspaceAgentScriptTimingStatus) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWorkspaceAgentSubsystem ¶
type NullWorkspaceAgentSubsystem struct { WorkspaceAgentSubsystem WorkspaceAgentSubsystem `json:"workspace_agent_subsystem"` Valid bool `json:"valid"` // Valid is true if WorkspaceAgentSubsystem is not NULL }
func (*NullWorkspaceAgentSubsystem) Scan ¶
func (ns *NullWorkspaceAgentSubsystem) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWorkspaceAppHealth ¶
type NullWorkspaceAppHealth struct { WorkspaceAppHealth WorkspaceAppHealth `json:"workspace_app_health"` Valid bool `json:"valid"` // Valid is true if WorkspaceAppHealth is not NULL }
func (*NullWorkspaceAppHealth) Scan ¶
func (ns *NullWorkspaceAppHealth) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWorkspaceAppOpenIn ¶ added in v2.19.0
type NullWorkspaceAppOpenIn struct { WorkspaceAppOpenIn WorkspaceAppOpenIn `json:"workspace_app_open_in"` Valid bool `json:"valid"` // Valid is true if WorkspaceAppOpenIn is not NULL }
func (*NullWorkspaceAppOpenIn) Scan ¶ added in v2.19.0
func (ns *NullWorkspaceAppOpenIn) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWorkspaceAppStatusState ¶ added in v2.21.0
type NullWorkspaceAppStatusState struct { WorkspaceAppStatusState WorkspaceAppStatusState `json:"workspace_app_status_state"` Valid bool `json:"valid"` // Valid is true if WorkspaceAppStatusState is not NULL }
func (*NullWorkspaceAppStatusState) Scan ¶ added in v2.21.0
func (ns *NullWorkspaceAppStatusState) Scan(value interface{}) error
Scan implements the Scanner interface.
type NullWorkspaceTransition ¶
type NullWorkspaceTransition struct { WorkspaceTransition WorkspaceTransition `json:"workspace_transition"` Valid bool `json:"valid"` // Valid is true if WorkspaceTransition is not NULL }
func (*NullWorkspaceTransition) Scan ¶
func (ns *NullWorkspaceTransition) Scan(value interface{}) error
Scan implements the Scanner interface.
type OAuth2ProviderApp ¶ added in v2.6.0
type OAuth2ProviderApp struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Name string `db:"name" json:"name"` Icon string `db:"icon" json:"icon"` CallbackURL string `db:"callback_url" json:"callback_url"` }
A table used to configure apps that can use Coder as an OAuth2 provider, the reverse of what we are calling external authentication.
func (OAuth2ProviderApp) RBACObject ¶ added in v2.9.0
func (OAuth2ProviderApp) RBACObject() rbac.Object
type OAuth2ProviderAppCode ¶ added in v2.9.0
type OAuth2ProviderAppCode struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` ExpiresAt time.Time `db:"expires_at" json:"expires_at"` SecretPrefix []byte `db:"secret_prefix" json:"secret_prefix"` HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"` UserID uuid.UUID `db:"user_id" json:"user_id"` AppID uuid.UUID `db:"app_id" json:"app_id"` }
Codes are meant to be exchanged for access tokens.
func (OAuth2ProviderAppCode) RBACObject ¶ added in v2.9.0
func (c OAuth2ProviderAppCode) RBACObject() rbac.Object
type OAuth2ProviderAppSecret ¶ added in v2.6.0
type OAuth2ProviderAppSecret struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` LastUsedAt sql.NullTime `db:"last_used_at" json:"last_used_at"` HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"` // The tail end of the original secret so secrets can be differentiated. DisplaySecret string `db:"display_secret" json:"display_secret"` AppID uuid.UUID `db:"app_id" json:"app_id"` SecretPrefix []byte `db:"secret_prefix" json:"secret_prefix"` }
func (OAuth2ProviderAppSecret) RBACObject ¶ added in v2.9.0
func (OAuth2ProviderAppSecret) RBACObject() rbac.Object
type OAuth2ProviderAppToken ¶ added in v2.9.0
type OAuth2ProviderAppToken struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` ExpiresAt time.Time `db:"expires_at" json:"expires_at"` HashPrefix []byte `db:"hash_prefix" json:"hash_prefix"` // Refresh tokens provide a way to refresh an access token (API key). An expired API key can be refreshed if this token is not yet expired, meaning this expiry can outlive an API key. RefreshHash []byte `db:"refresh_hash" json:"refresh_hash"` AppSecretID uuid.UUID `db:"app_secret_id" json:"app_secret_id"` APIKeyID string `db:"api_key_id" json:"api_key_id"` }
type OIDCClaimFieldValuesParams ¶ added in v2.18.0
type Organization ¶
type Organization struct { ID uuid.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` IsDefault bool `db:"is_default" json:"is_default"` DisplayName string `db:"display_name" json:"display_name"` Icon string `db:"icon" json:"icon"` Deleted bool `db:"deleted" json:"deleted"` }
func (Organization) RBACObject ¶
func (o Organization) RBACObject() rbac.Object
type OrganizationMember ¶
type OrganizationMember struct { UserID uuid.UUID `db:"user_id" json:"user_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Roles []string `db:"roles" json:"roles"` }
func (OrganizationMember) Auditable ¶ added in v2.13.0
func (m OrganizationMember) Auditable(username string) AuditableOrganizationMember
func (OrganizationMember) RBACObject ¶
func (m OrganizationMember) RBACObject() rbac.Object
type OrganizationMembersParams ¶ added in v2.13.0
type OrganizationMembersRow ¶ added in v2.13.0
type OrganizationMembersRow struct { OrganizationMember OrganizationMember `db:"organization_member" json:"organization_member"` Username string `db:"username" json:"username"` AvatarURL string `db:"avatar_url" json:"avatar_url"` Name string `db:"name" json:"name"` Email string `db:"email" json:"email"` GlobalRoles pq.StringArray `db:"global_roles" json:"global_roles"` }
func (OrganizationMembersRow) RBACObject ¶ added in v2.13.0
func (m OrganizationMembersRow) RBACObject() rbac.Object
type PGLock ¶ added in v2.17.0
type PGLock struct { // LockType see: https://www.postgresql.org/docs/current/monitoring-stats.html#WAIT-EVENT-LOCK-TABLE LockType *string `db:"locktype"` Database *string `db:"database"` // oid Relation *string `db:"relation"` // oid RelationName *string `db:"relation_name"` Page *int `db:"page"` Tuple *int `db:"tuple"` VirtualXID *string `db:"virtualxid"` TransactionID *string `db:"transactionid"` // xid ClassID *string `db:"classid"` // oid ObjID *string `db:"objid"` // oid ObjSubID *int `db:"objsubid"` VirtualTransaction *string `db:"virtualtransaction"` PID int `db:"pid"` Mode *string `db:"mode"` Granted bool `db:"granted"` FastPath *bool `db:"fastpath"` WaitStart *time.Time `db:"waitstart"` }
PGLock docs see: https://www.postgresql.org/docs/current/view-pg-locks.html#VIEW-PG-LOCKS
type PGLocks ¶ added in v2.17.0
type PGLocks []PGLock
func (PGLocks) Difference ¶ added in v2.17.0
Difference returns the difference between two sets of locks. This is helpful to determine what changed between the two sets.
type PaginatedOrganizationMembersParams ¶ added in v2.21.0
type PaginatedOrganizationMembersRow ¶ added in v2.21.0
type PaginatedOrganizationMembersRow struct { OrganizationMember OrganizationMember `db:"organization_member" json:"organization_member"` Username string `db:"username" json:"username"` AvatarURL string `db:"avatar_url" json:"avatar_url"` Name string `db:"name" json:"name"` Email string `db:"email" json:"email"` GlobalRoles pq.StringArray `db:"global_roles" json:"global_roles"` Count int64 `db:"count" json:"count"` }
func (PaginatedOrganizationMembersRow) RBACObject ¶ added in v2.21.0
func (m PaginatedOrganizationMembersRow) RBACObject() rbac.Object
type ParameterDestinationScheme ¶
type ParameterDestinationScheme string
const ( ParameterDestinationSchemeNone ParameterDestinationScheme = "none" ParameterDestinationSchemeEnvironmentVariable ParameterDestinationScheme = "environment_variable" ParameterDestinationSchemeProvisionerVariable ParameterDestinationScheme = "provisioner_variable" )
func AllParameterDestinationSchemeValues ¶
func AllParameterDestinationSchemeValues() []ParameterDestinationScheme
func (*ParameterDestinationScheme) Scan ¶
func (e *ParameterDestinationScheme) Scan(src interface{}) error
func (ParameterDestinationScheme) Valid ¶
func (e ParameterDestinationScheme) Valid() bool
type ParameterSchema ¶
type ParameterSchema struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` JobID uuid.UUID `db:"job_id" json:"job_id"` Name string `db:"name" json:"name"` Description string `db:"description" json:"description"` DefaultSourceScheme ParameterSourceScheme `db:"default_source_scheme" json:"default_source_scheme"` DefaultSourceValue string `db:"default_source_value" json:"default_source_value"` AllowOverrideSource bool `db:"allow_override_source" json:"allow_override_source"` DefaultDestinationScheme ParameterDestinationScheme `db:"default_destination_scheme" json:"default_destination_scheme"` AllowOverrideDestination bool `db:"allow_override_destination" json:"allow_override_destination"` DefaultRefresh string `db:"default_refresh" json:"default_refresh"` RedisplayValue bool `db:"redisplay_value" json:"redisplay_value"` ValidationError string `db:"validation_error" json:"validation_error"` ValidationCondition string `db:"validation_condition" json:"validation_condition"` ValidationTypeSystem ParameterTypeSystem `db:"validation_type_system" json:"validation_type_system"` ValidationValueType string `db:"validation_value_type" json:"validation_value_type"` Index int32 `db:"index" json:"index"` }
type ParameterScope ¶
type ParameterScope string
const ( ParameterScopeTemplate ParameterScope = "template" ParameterScopeImportJob ParameterScope = "import_job" ParameterScopeWorkspace ParameterScope = "workspace" )
func AllParameterScopeValues ¶
func AllParameterScopeValues() []ParameterScope
func (*ParameterScope) Scan ¶
func (e *ParameterScope) Scan(src interface{}) error
func (ParameterScope) Valid ¶
func (e ParameterScope) Valid() bool
type ParameterSourceScheme ¶
type ParameterSourceScheme string
const ( ParameterSourceSchemeNone ParameterSourceScheme = "none" ParameterSourceSchemeData ParameterSourceScheme = "data" )
func AllParameterSourceSchemeValues ¶
func AllParameterSourceSchemeValues() []ParameterSourceScheme
func (*ParameterSourceScheme) Scan ¶
func (e *ParameterSourceScheme) Scan(src interface{}) error
func (ParameterSourceScheme) Valid ¶
func (e ParameterSourceScheme) Valid() bool
type ParameterTypeSystem ¶
type ParameterTypeSystem string
const ( ParameterTypeSystemNone ParameterTypeSystem = "none" ParameterTypeSystemHCL ParameterTypeSystem = "hcl" )
func AllParameterTypeSystemValues ¶
func AllParameterTypeSystemValues() []ParameterTypeSystem
func (*ParameterTypeSystem) Scan ¶
func (e *ParameterTypeSystem) Scan(src interface{}) error
func (ParameterTypeSystem) Valid ¶
func (e ParameterTypeSystem) Valid() bool
type ParameterValue ¶
type ParameterValue struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Scope ParameterScope `db:"scope" json:"scope"` ScopeID uuid.UUID `db:"scope_id" json:"scope_id"` Name string `db:"name" json:"name"` SourceScheme ParameterSourceScheme `db:"source_scheme" json:"source_scheme"` SourceValue string `db:"source_value" json:"source_value"` DestinationScheme ParameterDestinationScheme `db:"destination_scheme" json:"destination_scheme"` }
type PortShareProtocol ¶ added in v2.9.0
type PortShareProtocol string
const ()
func AllPortShareProtocolValues ¶ added in v2.9.0
func AllPortShareProtocolValues() []PortShareProtocol
func (*PortShareProtocol) Scan ¶ added in v2.9.0
func (e *PortShareProtocol) Scan(src interface{}) error
func (PortShareProtocol) Valid ¶ added in v2.9.0
func (e PortShareProtocol) Valid() bool
type ProvisionerDaemon ¶
type ProvisionerDaemon struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` Name string `db:"name" json:"name"` Provisioners []ProvisionerType `db:"provisioners" json:"provisioners"` ReplicaID uuid.NullUUID `db:"replica_id" json:"replica_id"` Tags StringMap `db:"tags" json:"tags"` LastSeenAt sql.NullTime `db:"last_seen_at" json:"last_seen_at"` Version string `db:"version" json:"version"` // The API version of the provisioner daemon APIVersion string `db:"api_version" json:"api_version"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` KeyID uuid.UUID `db:"key_id" json:"key_id"` }
func (ProvisionerDaemon) RBACObject ¶
func (p ProvisionerDaemon) RBACObject() rbac.Object
type ProvisionerDaemonStatus ¶ added in v2.19.0
type ProvisionerDaemonStatus string
The status of a provisioner daemon.
const ( ProvisionerDaemonStatusOffline ProvisionerDaemonStatus = "offline" ProvisionerDaemonStatusIdle ProvisionerDaemonStatus = "idle" ProvisionerDaemonStatusBusy ProvisionerDaemonStatus = "busy" )
func AllProvisionerDaemonStatusValues ¶ added in v2.19.0
func AllProvisionerDaemonStatusValues() []ProvisionerDaemonStatus
func (*ProvisionerDaemonStatus) Scan ¶ added in v2.19.0
func (e *ProvisionerDaemonStatus) Scan(src interface{}) error
func (ProvisionerDaemonStatus) Valid ¶ added in v2.19.0
func (e ProvisionerDaemonStatus) Valid() bool
type ProvisionerJob ¶
type ProvisionerJob struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` StartedAt sql.NullTime `db:"started_at" json:"started_at"` CanceledAt sql.NullTime `db:"canceled_at" json:"canceled_at"` CompletedAt sql.NullTime `db:"completed_at" json:"completed_at"` Error sql.NullString `db:"error" json:"error"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` InitiatorID uuid.UUID `db:"initiator_id" json:"initiator_id"` Provisioner ProvisionerType `db:"provisioner" json:"provisioner"` StorageMethod ProvisionerStorageMethod `db:"storage_method" json:"storage_method"` Type ProvisionerJobType `db:"type" json:"type"` Input json.RawMessage `db:"input" json:"input"` WorkerID uuid.NullUUID `db:"worker_id" json:"worker_id"` FileID uuid.UUID `db:"file_id" json:"file_id"` Tags StringMap `db:"tags" json:"tags"` ErrorCode sql.NullString `db:"error_code" json:"error_code"` TraceMetadata pqtype.NullRawMessage `db:"trace_metadata" json:"trace_metadata"` // Computed column to track the status of the job. JobStatus ProvisionerJobStatus `db:"job_status" json:"job_status"` }
func (ProvisionerJob) Finished ¶ added in v2.3.0
func (p ProvisionerJob) Finished() bool
func (ProvisionerJob) FinishedAt ¶ added in v2.3.0
func (p ProvisionerJob) FinishedAt() time.Time
func (ProvisionerJob) RBACObject ¶ added in v2.19.0
func (p ProvisionerJob) RBACObject() rbac.Object
type ProvisionerJobLog ¶
type ProvisionerJobLog struct { JobID uuid.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"` ID int64 `db:"id" json:"id"` }
type ProvisionerJobStat ¶ added in v2.15.0
type ProvisionerJobStat struct { JobID uuid.UUID `db:"job_id" json:"job_id"` JobStatus ProvisionerJobStatus `db:"job_status" json:"job_status"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` WorkerID uuid.NullUUID `db:"worker_id" json:"worker_id"` Error sql.NullString `db:"error" json:"error"` ErrorCode sql.NullString `db:"error_code" json:"error_code"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` QueuedSecs float64 `db:"queued_secs" json:"queued_secs"` CompletionSecs float64 `db:"completion_secs" json:"completion_secs"` CanceledSecs float64 `db:"canceled_secs" json:"canceled_secs"` InitSecs float64 `db:"init_secs" json:"init_secs"` PlanSecs float64 `db:"plan_secs" json:"plan_secs"` GraphSecs float64 `db:"graph_secs" json:"graph_secs"` ApplySecs float64 `db:"apply_secs" json:"apply_secs"` }
type ProvisionerJobStatus ¶ added in v2.3.0
type ProvisionerJobStatus string
Computed status of a provisioner job. Jobs could be stuck in a hung state, these states do not guarantee any transition to another state.
const ( ProvisionerJobStatusPending ProvisionerJobStatus = "pending" ProvisionerJobStatusRunning ProvisionerJobStatus = "running" ProvisionerJobStatusSucceeded ProvisionerJobStatus = "succeeded" ProvisionerJobStatusCanceling ProvisionerJobStatus = "canceling" ProvisionerJobStatusCanceled ProvisionerJobStatus = "canceled" ProvisionerJobStatusFailed ProvisionerJobStatus = "failed" ProvisionerJobStatusUnknown ProvisionerJobStatus = "unknown" )
func AllProvisionerJobStatusValues ¶ added in v2.3.0
func AllProvisionerJobStatusValues() []ProvisionerJobStatus
func (*ProvisionerJobStatus) Scan ¶ added in v2.3.0
func (e *ProvisionerJobStatus) Scan(src interface{}) error
func (ProvisionerJobStatus) Valid ¶ added in v2.3.0
func (e ProvisionerJobStatus) Valid() bool
type ProvisionerJobTiming ¶ added in v2.15.0
type ProvisionerJobTiming struct { JobID uuid.UUID `db:"job_id" json:"job_id"` StartedAt time.Time `db:"started_at" json:"started_at"` EndedAt time.Time `db:"ended_at" json:"ended_at"` Stage ProvisionerJobTimingStage `db:"stage" json:"stage"` Source string `db:"source" json:"source"` Action string `db:"action" json:"action"` Resource string `db:"resource" json:"resource"` }
type ProvisionerJobTimingStage ¶ added in v2.15.0
type ProvisionerJobTimingStage string
const ( ProvisionerJobTimingStageInit ProvisionerJobTimingStage = "init" ProvisionerJobTimingStagePlan ProvisionerJobTimingStage = "plan" ProvisionerJobTimingStageGraph ProvisionerJobTimingStage = "graph" ProvisionerJobTimingStageApply ProvisionerJobTimingStage = "apply" )
func AllProvisionerJobTimingStageValues ¶ added in v2.15.0
func AllProvisionerJobTimingStageValues() []ProvisionerJobTimingStage
func (*ProvisionerJobTimingStage) Scan ¶ added in v2.15.0
func (e *ProvisionerJobTimingStage) Scan(src interface{}) error
func (ProvisionerJobTimingStage) Valid ¶ added in v2.15.0
func (e ProvisionerJobTimingStage) Valid() bool
type ProvisionerJobType ¶
type ProvisionerJobType string
const ( ProvisionerJobTypeTemplateVersionImport ProvisionerJobType = "template_version_import" ProvisionerJobTypeWorkspaceBuild ProvisionerJobType = "workspace_build" ProvisionerJobTypeTemplateVersionDryRun ProvisionerJobType = "template_version_dry_run" )
func AllProvisionerJobTypeValues ¶
func AllProvisionerJobTypeValues() []ProvisionerJobType
func (*ProvisionerJobType) Scan ¶
func (e *ProvisionerJobType) Scan(src interface{}) error
func (ProvisionerJobType) Valid ¶
func (e ProvisionerJobType) Valid() bool
type ProvisionerKey ¶ added in v2.14.0
type ProvisionerKey struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` Name string `db:"name" json:"name"` HashedSecret []byte `db:"hashed_secret" json:"hashed_secret"` Tags StringMap `db:"tags" json:"tags"` }
func (ProvisionerKey) RBACObject ¶ added in v2.14.0
func (p ProvisionerKey) RBACObject() rbac.Object
RBACObject for a provisioner key is the same as a provisioner daemon. Keys == provisioners from a RBAC perspective.
type ProvisionerStorageMethod ¶
type ProvisionerStorageMethod string
const (
ProvisionerStorageMethodFile ProvisionerStorageMethod = "file"
)
func AllProvisionerStorageMethodValues ¶
func AllProvisionerStorageMethodValues() []ProvisionerStorageMethod
func (*ProvisionerStorageMethod) Scan ¶
func (e *ProvisionerStorageMethod) Scan(src interface{}) error
func (ProvisionerStorageMethod) Valid ¶
func (e ProvisionerStorageMethod) Valid() bool
type ProvisionerType ¶
type ProvisionerType string
const ( ProvisionerTypeEcho ProvisionerType = "echo" ProvisionerTypeTerraform ProvisionerType = "terraform" )
func AllProvisionerTypeValues ¶
func AllProvisionerTypeValues() []ProvisionerType
func (*ProvisionerType) Scan ¶
func (e *ProvisionerType) Scan(src interface{}) error
func (ProvisionerType) Valid ¶
func (e ProvisionerType) Valid() bool
type RegisterWorkspaceProxyParams ¶
type RegisterWorkspaceProxyParams struct { Url string `db:"url" json:"url"` WildcardHostname string `db:"wildcard_hostname" json:"wildcard_hostname"` DerpEnabled bool `db:"derp_enabled" json:"derp_enabled"` DerpOnly bool `db:"derp_only" json:"derp_only"` Version string `db:"version" json:"version"` ID uuid.UUID `db:"id" json:"id"` }
type RemoveUserFromGroupsParams ¶ added in v2.16.0
type Replica ¶
type Replica struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` StartedAt time.Time `db:"started_at" json:"started_at"` StoppedAt sql.NullTime `db:"stopped_at" json:"stopped_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Hostname string `db:"hostname" json:"hostname"` RegionID int32 `db:"region_id" json:"region_id"` RelayAddress string `db:"relay_address" json:"relay_address"` DatabaseLatency int32 `db:"database_latency" json:"database_latency"` Version string `db:"version" json:"version"` Error string `db:"error" json:"error"` Primary bool `db:"primary" json:"primary"` }
type ResourceType ¶
type ResourceType string
const ( ResourceTypeOrganization ResourceType = "organization" ResourceTypeTemplate ResourceType = "template" ResourceTypeTemplateVersion ResourceType = "template_version" ResourceTypeUser ResourceType = "user" ResourceTypeWorkspace ResourceType = "workspace" ResourceTypeGitSshKey ResourceType = "git_ssh_key" ResourceTypeApiKey ResourceType = "api_key" ResourceTypeGroup ResourceType = "group" ResourceTypeWorkspaceBuild ResourceType = "workspace_build" ResourceTypeLicense ResourceType = "license" ResourceTypeWorkspaceProxy ResourceType = "workspace_proxy" ResourceTypeConvertLogin ResourceType = "convert_login" ResourceTypeHealthSettings ResourceType = "health_settings" ResourceTypeOauth2ProviderApp ResourceType = "oauth2_provider_app" ResourceTypeOauth2ProviderAppSecret ResourceType = "oauth2_provider_app_secret" ResourceTypeCustomRole ResourceType = "custom_role" ResourceTypeOrganizationMember ResourceType = "organization_member" ResourceTypeNotificationsSettings ResourceType = "notifications_settings" ResourceTypeNotificationTemplate ResourceType = "notification_template" ResourceTypeIdpSyncSettingsOrganization ResourceType = "idp_sync_settings_organization" ResourceTypeIdpSyncSettingsGroup ResourceType = "idp_sync_settings_group" ResourceTypeIdpSyncSettingsRole ResourceType = "idp_sync_settings_role" ResourceTypeWorkspaceAgent ResourceType = "workspace_agent" ResourceTypeWorkspaceApp ResourceType = "workspace_app" )
func AllResourceTypeValues ¶
func AllResourceTypeValues() []ResourceType
func (*ResourceType) Scan ¶
func (e *ResourceType) Scan(src interface{}) error
func (ResourceType) Valid ¶
func (e ResourceType) Valid() bool
type SiteConfig ¶
type StartupScriptBehavior ¶
type StartupScriptBehavior string
const ( StartupScriptBehaviorBlocking StartupScriptBehavior = "blocking" StartupScriptBehaviorNonBlocking StartupScriptBehavior = "non-blocking" )
func AllStartupScriptBehaviorValues ¶
func AllStartupScriptBehaviorValues() []StartupScriptBehavior
func (*StartupScriptBehavior) Scan ¶
func (e *StartupScriptBehavior) Scan(src interface{}) error
func (StartupScriptBehavior) Valid ¶
func (e StartupScriptBehavior) Valid() bool
type Store ¶
type Store interface { Ping(ctx context.Context) (time.Duration, error) PGLocks(ctx context.Context) (PGLocks, error) InTx(func(Store) error, *TxOptions) error // contains filtered or unexported methods }
Store contains all queryable database functions. It extends the generated interface to add transaction support.
type StringMapOfInt ¶ added in v2.10.0
func (*StringMapOfInt) Scan ¶ added in v2.10.0
func (m *StringMapOfInt) Scan(src interface{}) error
type TailnetAgent ¶
type TailnetClient ¶
type TailnetClientSubscription ¶ added in v2.2.0
type TailnetCoordinator ¶
type TailnetCoordinator struct { ID uuid.UUID `db:"id" json:"id"` HeartbeatAt time.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
type TailnetPeer ¶ added in v2.4.0
type TailnetStatus ¶ added in v2.4.0
type TailnetStatus string
const ( TailnetStatusOk TailnetStatus = "ok" TailnetStatusLost TailnetStatus = "lost" )
func AllTailnetStatusValues ¶ added in v2.4.0
func AllTailnetStatusValues() []TailnetStatus
func (*TailnetStatus) Scan ¶ added in v2.4.0
func (e *TailnetStatus) Scan(src interface{}) error
func (TailnetStatus) Valid ¶ added in v2.4.0
func (e TailnetStatus) Valid() bool
type TailnetTunnel ¶ added in v2.4.0
type TelemetryItem ¶ added in v2.19.0
type Template ¶
type Template struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` Deleted bool `db:"deleted" json:"deleted"` Name string `db:"name" json:"name"` Provisioner ProvisionerType `db:"provisioner" json:"provisioner"` ActiveVersionID uuid.UUID `db:"active_version_id" json:"active_version_id"` Description string `db:"description" json:"description"` DefaultTTL int64 `db:"default_ttl" json:"default_ttl"` CreatedBy uuid.UUID `db:"created_by" json:"created_by"` Icon string `db:"icon" json:"icon"` UserACL TemplateACL `db:"user_acl" json:"user_acl"` GroupACL TemplateACL `db:"group_acl" json:"group_acl"` DisplayName string `db:"display_name" json:"display_name"` AllowUserCancelWorkspaceJobs bool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"` AllowUserAutostart bool `db:"allow_user_autostart" json:"allow_user_autostart"` AllowUserAutostop bool `db:"allow_user_autostop" json:"allow_user_autostop"` FailureTTL int64 `db:"failure_ttl" json:"failure_ttl"` TimeTilDormant int64 `db:"time_til_dormant" json:"time_til_dormant"` TimeTilDormantAutoDelete int64 `db:"time_til_dormant_autodelete" json:"time_til_dormant_autodelete"` AutostopRequirementDaysOfWeek int16 `db:"autostop_requirement_days_of_week" json:"autostop_requirement_days_of_week"` AutostopRequirementWeeks int64 `db:"autostop_requirement_weeks" json:"autostop_requirement_weeks"` AutostartBlockDaysOfWeek int16 `db:"autostart_block_days_of_week" json:"autostart_block_days_of_week"` RequireActiveVersion bool `db:"require_active_version" json:"require_active_version"` Deprecated string `db:"deprecated" json:"deprecated"` ActivityBump int64 `db:"activity_bump" json:"activity_bump"` MaxPortSharingLevel AppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"` CreatedByAvatarURL string `db:"created_by_avatar_url" json:"created_by_avatar_url"` CreatedByUsername string `db:"created_by_username" json:"created_by_username"` OrganizationName string `db:"organization_name" json:"organization_name"` OrganizationDisplayName string `db:"organization_display_name" json:"organization_display_name"` OrganizationIcon string `db:"organization_icon" json:"organization_icon"` }
Joins in the display name information such as username, avatar, and organization name.
func (Template) AutostartAllowedDays ¶ added in v2.3.1
AutostartAllowedDays returns the inverse of 'AutostartBlockDaysOfWeek'. It is more useful to have the days that are allowed to autostart from a UX POV. The database prefers the 0 value being 'all days allowed'.
func (Template) RBACObject ¶
type TemplateACL ¶
TemplateACL is a map of ids to permissions.
func (*TemplateACL) Scan ¶
func (t *TemplateACL) Scan(src interface{}) error
type TemplateGroup ¶
type TemplateTable ¶
type TemplateTable struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` Deleted bool `db:"deleted" json:"deleted"` Name string `db:"name" json:"name"` Provisioner ProvisionerType `db:"provisioner" json:"provisioner"` ActiveVersionID uuid.UUID `db:"active_version_id" json:"active_version_id"` Description string `db:"description" json:"description"` // The default duration for autostop for workspaces created from this template. DefaultTTL int64 `db:"default_ttl" json:"default_ttl"` CreatedBy uuid.UUID `db:"created_by" json:"created_by"` Icon string `db:"icon" json:"icon"` UserACL TemplateACL `db:"user_acl" json:"user_acl"` GroupACL TemplateACL `db:"group_acl" json:"group_acl"` // Display name is a custom, human-friendly template name that user can set. DisplayName string `db:"display_name" json:"display_name"` // Allow users to cancel in-progress workspace jobs. AllowUserCancelWorkspaceJobs bool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"` // Allow users to specify an autostart schedule for workspaces (enterprise). AllowUserAutostart bool `db:"allow_user_autostart" json:"allow_user_autostart"` // Allow users to specify custom autostop values for workspaces (enterprise). AllowUserAutostop bool `db:"allow_user_autostop" json:"allow_user_autostop"` FailureTTL int64 `db:"failure_ttl" json:"failure_ttl"` TimeTilDormant int64 `db:"time_til_dormant" json:"time_til_dormant"` TimeTilDormantAutoDelete int64 `db:"time_til_dormant_autodelete" json:"time_til_dormant_autodelete"` // 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. AutostopRequirementDaysOfWeek int16 `db:"autostop_requirement_days_of_week" json:"autostop_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. AutostopRequirementWeeks int64 `db:"autostop_requirement_weeks" json:"autostop_requirement_weeks"` // A bitmap of days of week that autostart of a workspace is not allowed. Default allows all days. This is intended as a cost savings measure to prevent auto start on weekends (for example). AutostartBlockDaysOfWeek int16 `db:"autostart_block_days_of_week" json:"autostart_block_days_of_week"` RequireActiveVersion bool `db:"require_active_version" json:"require_active_version"` // If set to a non empty string, the template will no longer be able to be used. The message will be displayed to the user. Deprecated string `db:"deprecated" json:"deprecated"` ActivityBump int64 `db:"activity_bump" json:"activity_bump"` MaxPortSharingLevel AppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"` }
type TemplateUsageStat ¶ added in v2.10.0
type TemplateUsageStat struct { // Start time of the usage period. StartTime time.Time `db:"start_time" json:"start_time"` // End time of the usage period. EndTime time.Time `db:"end_time" json:"end_time"` // ID of the template being used. TemplateID uuid.UUID `db:"template_id" json:"template_id"` // ID of the user using the template. UserID uuid.UUID `db:"user_id" json:"user_id"` // Median latency the user is experiencing, in milliseconds. Null means no value was recorded. MedianLatencyMs sql.NullFloat64 `db:"median_latency_ms" json:"median_latency_ms"` // Total minutes the user has been using the template. UsageMins int16 `db:"usage_mins" json:"usage_mins"` // Total minutes the user has been using SSH. SshMins int16 `db:"ssh_mins" json:"ssh_mins"` // Total minutes the user has been using SFTP. SftpMins int16 `db:"sftp_mins" json:"sftp_mins"` // Total minutes the user has been using the reconnecting PTY. ReconnectingPtyMins int16 `db:"reconnecting_pty_mins" json:"reconnecting_pty_mins"` // Total minutes the user has been using VSCode. VscodeMins int16 `db:"vscode_mins" json:"vscode_mins"` // Total minutes the user has been using JetBrains. JetbrainsMins int16 `db:"jetbrains_mins" json:"jetbrains_mins"` // Object with app names as keys and total minutes used as values. Null means no app usage was recorded. AppUsageMins StringMapOfInt `db:"app_usage_mins" json:"app_usage_mins"` }
Records aggregated usage statistics for templates/users. All usage is rounded up to the nearest minute.
type TemplateUser ¶
type TemplateVersion ¶
type TemplateVersion struct { ID uuid.UUID `db:"id" json:"id"` TemplateID uuid.NullUUID `db:"template_id" json:"template_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Name string `db:"name" json:"name"` Readme string `db:"readme" json:"readme"` JobID uuid.UUID `db:"job_id" json:"job_id"` CreatedBy uuid.UUID `db:"created_by" json:"created_by"` ExternalAuthProviders json.RawMessage `db:"external_auth_providers" json:"external_auth_providers"` Message string `db:"message" json:"message"` Archived bool `db:"archived" json:"archived"` SourceExampleID sql.NullString `db:"source_example_id" json:"source_example_id"` CreatedByAvatarURL string `db:"created_by_avatar_url" json:"created_by_avatar_url"` CreatedByUsername string `db:"created_by_username" json:"created_by_username"` }
Joins in the username + avatar url of the created by user.
func (TemplateVersion) RBACObject ¶
func (TemplateVersion) RBACObject(template Template) rbac.Object
func (TemplateVersion) RBACObjectNoTemplate ¶
func (v TemplateVersion) RBACObjectNoTemplate() rbac.Object
RBACObjectNoTemplate is for orphaned template versions.
type TemplateVersionParameter ¶
type TemplateVersionParameter struct { TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"` // Parameter name Name string `db:"name" json:"name"` // Parameter description Description string `db:"description" json:"description"` // Parameter type Type string `db:"type" json:"type"` // Is parameter mutable? Mutable bool `db:"mutable" json:"mutable"` // Default value DefaultValue string `db:"default_value" json:"default_value"` // Icon Icon string `db:"icon" json:"icon"` // Additional options Options json.RawMessage `db:"options" json:"options"` // Validation: regex pattern ValidationRegex string `db:"validation_regex" json:"validation_regex"` // Validation: minimum length of value ValidationMin sql.NullInt32 `db:"validation_min" json:"validation_min"` // Validation: maximum length of value ValidationMax sql.NullInt32 `db:"validation_max" json:"validation_max"` // Validation: error displayed when the regex does not match. ValidationError string `db:"validation_error" json:"validation_error"` // Validation: consecutive values preserve the monotonic order ValidationMonotonic string `db:"validation_monotonic" json:"validation_monotonic"` // Is parameter required? Required bool `db:"required" json:"required"` // Display name of the rich parameter DisplayName string `db:"display_name" json:"display_name"` // Specifies the order in which to display parameters in user interfaces. DisplayOrder int32 `db:"display_order" json:"display_order"` // The value of an ephemeral parameter will not be preserved between consecutive workspace builds. Ephemeral bool `db:"ephemeral" json:"ephemeral"` }
type TemplateVersionPreset ¶ added in v2.20.0
type TemplateVersionPresetParameter ¶ added in v2.20.0
type TemplateVersionTable ¶
type TemplateVersionTable struct { ID uuid.UUID `db:"id" json:"id"` TemplateID uuid.NullUUID `db:"template_id" json:"template_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Name string `db:"name" json:"name"` Readme string `db:"readme" json:"readme"` JobID uuid.UUID `db:"job_id" json:"job_id"` CreatedBy uuid.UUID `db:"created_by" json:"created_by"` // IDs of External auth providers for a specific template version ExternalAuthProviders json.RawMessage `db:"external_auth_providers" json:"external_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. Message string `db:"message" json:"message"` Archived bool `db:"archived" json:"archived"` SourceExampleID sql.NullString `db:"source_example_id" json:"source_example_id"` }
type TemplateVersionTerraformValue ¶ added in v2.21.0
type TemplateVersionVariable ¶
type TemplateVersionVariable struct { TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"` // Variable name Name string `db:"name" json:"name"` // Variable description Description string `db:"description" json:"description"` // Variable type Type string `db:"type" json:"type"` // Variable value Value string `db:"value" json:"value"` // Variable default value DefaultValue string `db:"default_value" json:"default_value"` // Required variables needs a default value or a value provided by template admin Required bool `db:"required" json:"required"` // Sensitive variables have their values redacted in logs or site UI Sensitive bool `db:"sensitive" json:"sensitive"` }
type TemplateVersionWorkspaceTag ¶ added in v2.12.0
type TxOptions ¶ added in v2.17.0
type TxOptions struct { // Isolation is the transaction isolation level. // If zero, the driver or database's default level is used. Isolation sql.IsolationLevel ReadOnly bool // -- Coder specific metadata -- // TxIdentifier is a unique identifier for the transaction to be used // in metrics. Can be any string. TxIdentifier string // contains filtered or unexported fields }
TxOptions is used to pass some execution metadata to the callers. Ideally we could throw this into a context, but no context is used for transactions. So instead, the return context is attached to the options passed in. This metadata should not be returned in the method signature, because it is only used for metric tracking. It should never be used by business logic.
func DefaultTXOptions ¶ added in v2.17.0
func DefaultTXOptions() *TxOptions
func (TxOptions) ExecutionCount ¶ added in v2.17.0
type UnarchiveTemplateVersionParams ¶ added in v2.3.0
type UniqueConstraint ¶
type UniqueConstraint string
UniqueConstraint represents a named unique constraint on a table.
const ( UniqueAgentStatsPkey UniqueConstraint = "agent_stats_pkey" // ALTER TABLE ONLY workspace_agent_stats ADD CONSTRAINT agent_stats_pkey PRIMARY KEY (id); UniqueAPIKeysPkey UniqueConstraint = "api_keys_pkey" // ALTER TABLE ONLY api_keys ADD CONSTRAINT api_keys_pkey PRIMARY KEY (id); UniqueAuditLogsPkey UniqueConstraint = "audit_logs_pkey" // ALTER TABLE ONLY audit_logs ADD CONSTRAINT audit_logs_pkey PRIMARY KEY (id); UniqueCryptoKeysPkey UniqueConstraint = "crypto_keys_pkey" // ALTER TABLE ONLY crypto_keys ADD CONSTRAINT crypto_keys_pkey PRIMARY KEY (feature, sequence); UniqueCustomRolesUniqueKey UniqueConstraint = "custom_roles_unique_key" // ALTER TABLE ONLY custom_roles ADD CONSTRAINT custom_roles_unique_key UNIQUE (name, organization_id); UniqueDbcryptKeysActiveKeyDigestKey UniqueConstraint = "dbcrypt_keys_active_key_digest_key" // ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_active_key_digest_key UNIQUE (active_key_digest); UniqueDbcryptKeysPkey UniqueConstraint = "dbcrypt_keys_pkey" // ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_pkey PRIMARY KEY (number); UniqueDbcryptKeysRevokedKeyDigestKey UniqueConstraint = "dbcrypt_keys_revoked_key_digest_key" // ALTER TABLE ONLY dbcrypt_keys ADD CONSTRAINT dbcrypt_keys_revoked_key_digest_key UNIQUE (revoked_key_digest); UniqueFilesHashCreatedByKey UniqueConstraint = "files_hash_created_by_key" // ALTER TABLE ONLY files ADD CONSTRAINT files_hash_created_by_key UNIQUE (hash, created_by); UniqueFilesPkey UniqueConstraint = "files_pkey" // ALTER TABLE ONLY files ADD CONSTRAINT files_pkey PRIMARY KEY (id); UniqueGitAuthLinksProviderIDUserIDKey UniqueConstraint = "git_auth_links_provider_id_user_id_key" // ALTER TABLE ONLY external_auth_links ADD CONSTRAINT git_auth_links_provider_id_user_id_key UNIQUE (provider_id, user_id); UniqueGitSSHKeysPkey UniqueConstraint = "gitsshkeys_pkey" // ALTER TABLE ONLY gitsshkeys ADD CONSTRAINT gitsshkeys_pkey PRIMARY KEY (user_id); UniqueGroupMembersUserIDGroupIDKey UniqueConstraint = "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); UniqueGroupsNameOrganizationIDKey UniqueConstraint = "groups_name_organization_id_key" // ALTER TABLE ONLY groups ADD CONSTRAINT groups_name_organization_id_key UNIQUE (name, organization_id); UniqueGroupsPkey UniqueConstraint = "groups_pkey" // ALTER TABLE ONLY groups ADD CONSTRAINT groups_pkey PRIMARY KEY (id); UniqueInboxNotificationsPkey UniqueConstraint = "inbox_notifications_pkey" // ALTER TABLE ONLY inbox_notifications ADD CONSTRAINT inbox_notifications_pkey PRIMARY KEY (id); UniqueJfrogXrayScansPkey UniqueConstraint = "jfrog_xray_scans_pkey" // ALTER TABLE ONLY jfrog_xray_scans ADD CONSTRAINT jfrog_xray_scans_pkey PRIMARY KEY (agent_id, workspace_id); UniqueLicensesJWTKey UniqueConstraint = "licenses_jwt_key" // ALTER TABLE ONLY licenses ADD CONSTRAINT licenses_jwt_key UNIQUE (jwt); UniqueLicensesPkey UniqueConstraint = "licenses_pkey" // ALTER TABLE ONLY licenses ADD CONSTRAINT licenses_pkey PRIMARY KEY (id); UniqueNotificationMessagesPkey UniqueConstraint = "notification_messages_pkey" // ALTER TABLE ONLY notification_messages ADD CONSTRAINT notification_messages_pkey PRIMARY KEY (id); UniqueNotificationPreferencesPkey UniqueConstraint = "notification_preferences_pkey" // ALTER TABLE ONLY notification_preferences ADD CONSTRAINT notification_preferences_pkey PRIMARY KEY (user_id, notification_template_id); UniqueNotificationReportGeneratorLogsPkey UniqueConstraint = "notification_report_generator_logs_pkey" // ALTER TABLE ONLY notification_report_generator_logs ADD CONSTRAINT notification_report_generator_logs_pkey PRIMARY KEY (notification_template_id); UniqueNotificationTemplatesNameKey UniqueConstraint = "notification_templates_name_key" // ALTER TABLE ONLY notification_templates ADD CONSTRAINT notification_templates_name_key UNIQUE (name); UniqueNotificationTemplatesPkey UniqueConstraint = "notification_templates_pkey" // ALTER TABLE ONLY notification_templates ADD CONSTRAINT notification_templates_pkey PRIMARY KEY (id); UniqueOauth2ProviderAppCodesPkey UniqueConstraint = "oauth2_provider_app_codes_pkey" // ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_pkey PRIMARY KEY (id); UniqueOauth2ProviderAppCodesSecretPrefixKey UniqueConstraint = "oauth2_provider_app_codes_secret_prefix_key" // ALTER TABLE ONLY oauth2_provider_app_codes ADD CONSTRAINT oauth2_provider_app_codes_secret_prefix_key UNIQUE (secret_prefix); UniqueOauth2ProviderAppSecretsPkey UniqueConstraint = "oauth2_provider_app_secrets_pkey" // ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_pkey PRIMARY KEY (id); UniqueOauth2ProviderAppSecretsSecretPrefixKey UniqueConstraint = "oauth2_provider_app_secrets_secret_prefix_key" // ALTER TABLE ONLY oauth2_provider_app_secrets ADD CONSTRAINT oauth2_provider_app_secrets_secret_prefix_key UNIQUE (secret_prefix); UniqueOauth2ProviderAppTokensHashPrefixKey UniqueConstraint = "oauth2_provider_app_tokens_hash_prefix_key" // ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_hash_prefix_key UNIQUE (hash_prefix); UniqueOauth2ProviderAppTokensPkey UniqueConstraint = "oauth2_provider_app_tokens_pkey" // ALTER TABLE ONLY oauth2_provider_app_tokens ADD CONSTRAINT oauth2_provider_app_tokens_pkey PRIMARY KEY (id); UniqueOauth2ProviderAppsNameKey UniqueConstraint = "oauth2_provider_apps_name_key" // ALTER TABLE ONLY oauth2_provider_apps ADD CONSTRAINT oauth2_provider_apps_name_key UNIQUE (name); UniqueOauth2ProviderAppsPkey UniqueConstraint = "oauth2_provider_apps_pkey" // ALTER TABLE ONLY oauth2_provider_apps ADD CONSTRAINT oauth2_provider_apps_pkey PRIMARY KEY (id); UniqueOrganizationMembersPkey UniqueConstraint = "organization_members_pkey" // ALTER TABLE ONLY organization_members ADD CONSTRAINT organization_members_pkey PRIMARY KEY (organization_id, user_id); UniqueOrganizationsPkey UniqueConstraint = "organizations_pkey" // ALTER TABLE ONLY organizations ADD CONSTRAINT organizations_pkey PRIMARY KEY (id); UniqueParameterSchemasJobIDNameKey UniqueConstraint = "parameter_schemas_job_id_name_key" // ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_job_id_name_key UNIQUE (job_id, name); UniqueParameterSchemasPkey UniqueConstraint = "parameter_schemas_pkey" // ALTER TABLE ONLY parameter_schemas ADD CONSTRAINT parameter_schemas_pkey PRIMARY KEY (id); UniqueParameterValuesPkey UniqueConstraint = "parameter_values_pkey" // ALTER TABLE ONLY parameter_values ADD CONSTRAINT parameter_values_pkey PRIMARY KEY (id); UniqueParameterValuesScopeIDNameKey UniqueConstraint = "parameter_values_scope_id_name_key" // ALTER TABLE ONLY parameter_values ADD CONSTRAINT parameter_values_scope_id_name_key UNIQUE (scope_id, name); UniqueProvisionerDaemonsPkey UniqueConstraint = "provisioner_daemons_pkey" // ALTER TABLE ONLY provisioner_daemons ADD CONSTRAINT provisioner_daemons_pkey PRIMARY KEY (id); UniqueProvisionerJobLogsPkey UniqueConstraint = "provisioner_job_logs_pkey" // ALTER TABLE ONLY provisioner_job_logs ADD CONSTRAINT provisioner_job_logs_pkey PRIMARY KEY (id); UniqueProvisionerJobsPkey UniqueConstraint = "provisioner_jobs_pkey" // ALTER TABLE ONLY provisioner_jobs ADD CONSTRAINT provisioner_jobs_pkey PRIMARY KEY (id); UniqueProvisionerKeysPkey UniqueConstraint = "provisioner_keys_pkey" // ALTER TABLE ONLY provisioner_keys ADD CONSTRAINT provisioner_keys_pkey PRIMARY KEY (id); UniqueSiteConfigsKeyKey UniqueConstraint = "site_configs_key_key" // ALTER TABLE ONLY site_configs ADD CONSTRAINT site_configs_key_key UNIQUE (key); UniqueTailnetAgentsPkey UniqueConstraint = "tailnet_agents_pkey" // ALTER TABLE ONLY tailnet_agents ADD CONSTRAINT tailnet_agents_pkey PRIMARY KEY (id, coordinator_id); UniqueTailnetClientSubscriptionsPkey UniqueConstraint = "tailnet_client_subscriptions_pkey" // ALTER TABLE ONLY tailnet_client_subscriptions ADD CONSTRAINT tailnet_client_subscriptions_pkey PRIMARY KEY (client_id, coordinator_id, agent_id); UniqueTailnetClientsPkey UniqueConstraint = "tailnet_clients_pkey" // ALTER TABLE ONLY tailnet_clients ADD CONSTRAINT tailnet_clients_pkey PRIMARY KEY (id, coordinator_id); UniqueTailnetCoordinatorsPkey UniqueConstraint = "tailnet_coordinators_pkey" // ALTER TABLE ONLY tailnet_coordinators ADD CONSTRAINT tailnet_coordinators_pkey PRIMARY KEY (id); UniqueTailnetPeersPkey UniqueConstraint = "tailnet_peers_pkey" // ALTER TABLE ONLY tailnet_peers ADD CONSTRAINT tailnet_peers_pkey PRIMARY KEY (id, coordinator_id); UniqueTailnetTunnelsPkey UniqueConstraint = "tailnet_tunnels_pkey" // ALTER TABLE ONLY tailnet_tunnels ADD CONSTRAINT tailnet_tunnels_pkey PRIMARY KEY (coordinator_id, src_id, dst_id); UniqueTelemetryItemsPkey UniqueConstraint = "telemetry_items_pkey" // ALTER TABLE ONLY telemetry_items ADD CONSTRAINT telemetry_items_pkey PRIMARY KEY (key); UniqueTemplateUsageStatsPkey UniqueConstraint = "template_usage_stats_pkey" // ALTER TABLE ONLY template_usage_stats ADD CONSTRAINT template_usage_stats_pkey PRIMARY KEY (start_time, template_id, user_id); UniqueTemplateVersionParametersTemplateVersionIDNameKey UniqueConstraint = "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); UniqueTemplateVersionPresetParametersPkey UniqueConstraint = "template_version_preset_parameters_pkey" // ALTER TABLE ONLY template_version_preset_parameters ADD CONSTRAINT template_version_preset_parameters_pkey PRIMARY KEY (id); UniqueTemplateVersionPresetsPkey UniqueConstraint = "template_version_presets_pkey" // ALTER TABLE ONLY template_version_presets ADD CONSTRAINT template_version_presets_pkey PRIMARY KEY (id); UniqueTemplateVersionTerraformValuesTemplateVersionIDKey UniqueConstraint = "template_version_terraform_values_template_version_id_key" // ALTER TABLE ONLY template_version_terraform_values ADD CONSTRAINT template_version_terraform_values_template_version_id_key UNIQUE (template_version_id); UniqueTemplateVersionVariablesTemplateVersionIDNameKey UniqueConstraint = "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); UniqueTemplateVersionWorkspaceTagsTemplateVersionIDKeyKey UniqueConstraint = "template_version_workspace_tags_template_version_id_key_key" // ALTER TABLE ONLY template_version_workspace_tags ADD CONSTRAINT template_version_workspace_tags_template_version_id_key_key UNIQUE (template_version_id, key); UniqueTemplateVersionsPkey UniqueConstraint = "template_versions_pkey" // ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_pkey PRIMARY KEY (id); UniqueTemplateVersionsTemplateIDNameKey UniqueConstraint = "template_versions_template_id_name_key" // ALTER TABLE ONLY template_versions ADD CONSTRAINT template_versions_template_id_name_key UNIQUE (template_id, name); UniqueTemplatesPkey UniqueConstraint = "templates_pkey" // ALTER TABLE ONLY templates ADD CONSTRAINT templates_pkey PRIMARY KEY (id); UniqueUserConfigsPkey UniqueConstraint = "user_configs_pkey" // ALTER TABLE ONLY user_configs ADD CONSTRAINT user_configs_pkey PRIMARY KEY (user_id, key); UniqueUserDeletedPkey UniqueConstraint = "user_deleted_pkey" // ALTER TABLE ONLY user_deleted ADD CONSTRAINT user_deleted_pkey PRIMARY KEY (id); UniqueUserLinksPkey UniqueConstraint = "user_links_pkey" // ALTER TABLE ONLY user_links ADD CONSTRAINT user_links_pkey PRIMARY KEY (user_id, login_type); UniqueUserStatusChangesPkey UniqueConstraint = "user_status_changes_pkey" // ALTER TABLE ONLY user_status_changes ADD CONSTRAINT user_status_changes_pkey PRIMARY KEY (id); UniqueUsersPkey UniqueConstraint = "users_pkey" // ALTER TABLE ONLY users ADD CONSTRAINT users_pkey PRIMARY KEY (id); UniqueWebpushSubscriptionsPkey UniqueConstraint = "webpush_subscriptions_pkey" // ALTER TABLE ONLY webpush_subscriptions ADD CONSTRAINT webpush_subscriptions_pkey PRIMARY KEY (id); UniqueWorkspaceAgentDevcontainersPkey UniqueConstraint = "workspace_agent_devcontainers_pkey" // ALTER TABLE ONLY workspace_agent_devcontainers ADD CONSTRAINT workspace_agent_devcontainers_pkey PRIMARY KEY (id); UniqueWorkspaceAgentLogSourcesPkey UniqueConstraint = "workspace_agent_log_sources_pkey" // ALTER TABLE ONLY workspace_agent_log_sources ADD CONSTRAINT workspace_agent_log_sources_pkey PRIMARY KEY (workspace_agent_id, id); UniqueWorkspaceAgentMemoryResourceMonitorsPkey UniqueConstraint = "workspace_agent_memory_resource_monitors_pkey" // ALTER TABLE ONLY workspace_agent_memory_resource_monitors ADD CONSTRAINT workspace_agent_memory_resource_monitors_pkey PRIMARY KEY (agent_id); UniqueWorkspaceAgentMetadataPkey UniqueConstraint = "workspace_agent_metadata_pkey" // ALTER TABLE ONLY workspace_agent_metadata ADD CONSTRAINT workspace_agent_metadata_pkey PRIMARY KEY (workspace_agent_id, key); UniqueWorkspaceAgentScriptTimingsScriptIDStartedAtKey UniqueConstraint = "workspace_agent_script_timings_script_id_started_at_key" // ALTER TABLE ONLY workspace_agent_script_timings ADD CONSTRAINT workspace_agent_script_timings_script_id_started_at_key UNIQUE (script_id, started_at); UniqueWorkspaceAgentScriptsIDKey UniqueConstraint = "workspace_agent_scripts_id_key" // ALTER TABLE ONLY workspace_agent_scripts ADD CONSTRAINT workspace_agent_scripts_id_key UNIQUE (id); UniqueWorkspaceAgentStartupLogsPkey UniqueConstraint = "workspace_agent_startup_logs_pkey" // ALTER TABLE ONLY workspace_agent_logs ADD CONSTRAINT workspace_agent_startup_logs_pkey PRIMARY KEY (id); UniqueWorkspaceAgentVolumeResourceMonitorsPkey UniqueConstraint = "workspace_agent_volume_resource_monitors_pkey" // ALTER TABLE ONLY workspace_agent_volume_resource_monitors ADD CONSTRAINT workspace_agent_volume_resource_monitors_pkey PRIMARY KEY (agent_id, path); UniqueWorkspaceAgentsPkey UniqueConstraint = "workspace_agents_pkey" // ALTER TABLE ONLY workspace_agents ADD CONSTRAINT workspace_agents_pkey PRIMARY KEY (id); UniqueWorkspaceAppAuditSessionsAgentIDAppIDUserIDIpUseKey UniqueConstraint = "workspace_app_audit_sessions_agent_id_app_id_user_id_ip_use_key" // ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_agent_id_app_id_user_id_ip_use_key UNIQUE (agent_id, app_id, user_id, ip, user_agent, slug_or_port, status_code); UniqueWorkspaceAppAuditSessionsPkey UniqueConstraint = "workspace_app_audit_sessions_pkey" // ALTER TABLE ONLY workspace_app_audit_sessions ADD CONSTRAINT workspace_app_audit_sessions_pkey PRIMARY KEY (id); UniqueWorkspaceAppStatsPkey UniqueConstraint = "workspace_app_stats_pkey" // ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_pkey PRIMARY KEY (id); UniqueWorkspaceAppStatsUserIDAgentIDSessionIDKey UniqueConstraint = "workspace_app_stats_user_id_agent_id_session_id_key" // ALTER TABLE ONLY workspace_app_stats ADD CONSTRAINT workspace_app_stats_user_id_agent_id_session_id_key UNIQUE (user_id, agent_id, session_id); UniqueWorkspaceAppStatusesPkey UniqueConstraint = "workspace_app_statuses_pkey" // ALTER TABLE ONLY workspace_app_statuses ADD CONSTRAINT workspace_app_statuses_pkey PRIMARY KEY (id); UniqueWorkspaceAppsAgentIDSlugIndex UniqueConstraint = "workspace_apps_agent_id_slug_idx" // ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_agent_id_slug_idx UNIQUE (agent_id, slug); UniqueWorkspaceAppsPkey UniqueConstraint = "workspace_apps_pkey" // ALTER TABLE ONLY workspace_apps ADD CONSTRAINT workspace_apps_pkey PRIMARY KEY (id); UniqueWorkspaceBuildParametersWorkspaceBuildIDNameKey UniqueConstraint = "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); UniqueWorkspaceBuildsJobIDKey UniqueConstraint = "workspace_builds_job_id_key" // ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_job_id_key UNIQUE (job_id); UniqueWorkspaceBuildsPkey UniqueConstraint = "workspace_builds_pkey" // ALTER TABLE ONLY workspace_builds ADD CONSTRAINT workspace_builds_pkey PRIMARY KEY (id); UniqueWorkspaceBuildsWorkspaceIDBuildNumberKey UniqueConstraint = "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); UniqueWorkspaceProxiesPkey UniqueConstraint = "workspace_proxies_pkey" // ALTER TABLE ONLY workspace_proxies ADD CONSTRAINT workspace_proxies_pkey PRIMARY KEY (id); UniqueWorkspaceProxiesRegionIDUnique UniqueConstraint = "workspace_proxies_region_id_unique" // ALTER TABLE ONLY workspace_proxies ADD CONSTRAINT workspace_proxies_region_id_unique UNIQUE (region_id); UniqueWorkspaceResourceMetadataName UniqueConstraint = "workspace_resource_metadata_name" // ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_name UNIQUE (workspace_resource_id, key); UniqueWorkspaceResourceMetadataPkey UniqueConstraint = "workspace_resource_metadata_pkey" // ALTER TABLE ONLY workspace_resource_metadata ADD CONSTRAINT workspace_resource_metadata_pkey PRIMARY KEY (id); UniqueWorkspaceResourcesPkey UniqueConstraint = "workspace_resources_pkey" // ALTER TABLE ONLY workspace_resources ADD CONSTRAINT workspace_resources_pkey PRIMARY KEY (id); UniqueWorkspacesPkey UniqueConstraint = "workspaces_pkey" // ALTER TABLE ONLY workspaces ADD CONSTRAINT workspaces_pkey PRIMARY KEY (id); UniqueIndexAPIKeyName UniqueConstraint = "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); UniqueIndexCustomRolesNameLower UniqueConstraint = "idx_custom_roles_name_lower" // CREATE UNIQUE INDEX idx_custom_roles_name_lower ON custom_roles USING btree (lower(name)); UniqueIndexOrganizationNameLower UniqueConstraint = "idx_organization_name_lower" // CREATE UNIQUE INDEX idx_organization_name_lower ON organizations USING btree (lower(name)) WHERE (deleted = false); UniqueIndexProvisionerDaemonsOrgNameOwnerKey UniqueConstraint = "idx_provisioner_daemons_org_name_owner_key" // CREATE UNIQUE INDEX idx_provisioner_daemons_org_name_owner_key ON provisioner_daemons USING btree (organization_id, name, lower(COALESCE((tags ->> 'owner'::text), ”::text))); UniqueIndexUsersEmail UniqueConstraint = "idx_users_email" // CREATE UNIQUE INDEX idx_users_email ON users USING btree (email) WHERE (deleted = false); UniqueIndexUsersUsername UniqueConstraint = "idx_users_username" // CREATE UNIQUE INDEX idx_users_username ON users USING btree (username) WHERE (deleted = false); UniqueNotificationMessagesDedupeHashIndex UniqueConstraint = "notification_messages_dedupe_hash_idx" // CREATE UNIQUE INDEX notification_messages_dedupe_hash_idx ON notification_messages USING btree (dedupe_hash); UniqueOrganizationsSingleDefaultOrg UniqueConstraint = "organizations_single_default_org" // CREATE UNIQUE INDEX organizations_single_default_org ON organizations USING btree (is_default) WHERE (is_default = true); UniqueProvisionerKeysOrganizationIDNameIndex UniqueConstraint = "provisioner_keys_organization_id_name_idx" // CREATE UNIQUE INDEX provisioner_keys_organization_id_name_idx ON provisioner_keys USING btree (organization_id, lower((name)::text)); UniqueTemplateUsageStatsStartTimeTemplateIDUserIDIndex UniqueConstraint = "template_usage_stats_start_time_template_id_user_id_idx" // CREATE UNIQUE INDEX template_usage_stats_start_time_template_id_user_id_idx ON template_usage_stats USING btree (start_time, template_id, user_id); UniqueTemplatesOrganizationIDNameIndex UniqueConstraint = "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); UniqueUserLinksLinkedIDLoginTypeIndex UniqueConstraint = "user_links_linked_id_login_type_idx" // CREATE UNIQUE INDEX user_links_linked_id_login_type_idx ON user_links USING btree (linked_id, login_type) WHERE (linked_id <> ”::text); UniqueUsersEmailLowerIndex UniqueConstraint = "users_email_lower_idx" // CREATE UNIQUE INDEX users_email_lower_idx ON users USING btree (lower(email)) WHERE (deleted = false); UniqueUsersUsernameLowerIndex UniqueConstraint = "users_username_lower_idx" // CREATE UNIQUE INDEX users_username_lower_idx ON users USING btree (lower(username)) WHERE (deleted = false); UniqueWorkspaceAppAuditSessionsUniqueIndex UniqueConstraint = "workspace_app_audit_sessions_unique_index" // CREATE UNIQUE INDEX workspace_app_audit_sessions_unique_index ON workspace_app_audit_sessions USING btree (agent_id, app_id, user_id, ip, user_agent, slug_or_port, status_code); UniqueWorkspaceProxiesLowerNameIndex UniqueConstraint = "workspace_proxies_lower_name_idx" // CREATE UNIQUE INDEX workspace_proxies_lower_name_idx ON workspace_proxies USING btree (lower(name)) WHERE (deleted = false); UniqueWorkspacesOwnerIDLowerIndex UniqueConstraint = "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.
type UpdateAPIKeyByIDParams ¶
type UpdateCryptoKeyDeletesAtParams ¶ added in v2.16.0
type UpdateCryptoKeyDeletesAtParams struct { Feature CryptoKeyFeature `db:"feature" json:"feature"` Sequence int32 `db:"sequence" json:"sequence"` DeletesAt sql.NullTime `db:"deletes_at" json:"deletes_at"` }
type UpdateCustomRoleParams ¶ added in v2.15.0
type UpdateCustomRoleParams struct { DisplayName string `db:"display_name" json:"display_name"` SitePermissions CustomRolePermissions `db:"site_permissions" json:"site_permissions"` OrgPermissions CustomRolePermissions `db:"org_permissions" json:"org_permissions"` UserPermissions CustomRolePermissions `db:"user_permissions" json:"user_permissions"` Name string `db:"name" json:"name"` OrganizationID uuid.NullUUID `db:"organization_id" json:"organization_id"` }
type UpdateExternalAuthLinkParams ¶ added in v2.2.1
type UpdateExternalAuthLinkParams struct { ProviderID string `db:"provider_id" json:"provider_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OAuthAccessToken string `db:"oauth_access_token" json:"oauth_access_token"` OAuthAccessTokenKeyID sql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"` OAuthRefreshToken string `db:"oauth_refresh_token" json:"oauth_refresh_token"` OAuthRefreshTokenKeyID sql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"` OAuthExpiry time.Time `db:"oauth_expiry" json:"oauth_expiry"` OAuthExtra pqtype.NullRawMessage `db:"oauth_extra" json:"oauth_extra"` }
type UpdateExternalAuthLinkRefreshTokenParams ¶ added in v2.18.0
type UpdateExternalAuthLinkRefreshTokenParams struct { OAuthRefreshToken string `db:"oauth_refresh_token" json:"oauth_refresh_token"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` ProviderID string `db:"provider_id" json:"provider_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` OAuthRefreshTokenKeyID string `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"` }
type UpdateGitSSHKeyParams ¶
type UpdateGroupByIDParams ¶
type UpdateInboxNotificationReadStatusParams ¶ added in v2.21.0
type UpdateMemberRolesParams ¶
type UpdateMemoryResourceMonitorParams ¶ added in v2.20.0
type UpdateNotificationTemplateMethodByIDParams ¶ added in v2.15.0
type UpdateNotificationTemplateMethodByIDParams struct { Method NullNotificationMethod `db:"method" json:"method"` ID uuid.UUID `db:"id" json:"id"` }
type UpdateOAuth2ProviderAppByIDParams ¶ added in v2.6.0
type UpdateOAuth2ProviderAppSecretByIDParams ¶ added in v2.6.0
type UpdateOrganizationDeletedByIDParams ¶ added in v2.20.0
type UpdateOrganizationParams ¶ added in v2.12.0
type UpdateOrganizationParams struct { UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Name string `db:"name" json:"name"` DisplayName string `db:"display_name" json:"display_name"` Description string `db:"description" json:"description"` Icon string `db:"icon" json:"icon"` ID uuid.UUID `db:"id" json:"id"` }
type UpdateProvisionerDaemonLastSeenAtParams ¶ added in v2.6.0
type UpdateProvisionerJobWithCompleteByIDParams ¶
type UpdateProvisionerJobWithCompleteByIDParams struct { ID uuid.UUID `db:"id" json:"id"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` CompletedAt sql.NullTime `db:"completed_at" json:"completed_at"` Error sql.NullString `db:"error" json:"error"` ErrorCode sql.NullString `db:"error_code" json:"error_code"` }
type UpdateReplicaParams ¶
type UpdateReplicaParams struct { ID uuid.UUID `db:"id" json:"id"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` StartedAt time.Time `db:"started_at" json:"started_at"` StoppedAt sql.NullTime `db:"stopped_at" json:"stopped_at"` RelayAddress string `db:"relay_address" json:"relay_address"` RegionID int32 `db:"region_id" json:"region_id"` Hostname string `db:"hostname" json:"hostname"` Version string `db:"version" json:"version"` Error string `db:"error" json:"error"` DatabaseLatency int32 `db:"database_latency" json:"database_latency"` Primary bool `db:"primary" json:"primary"` }
type UpdateTailnetPeerStatusByCoordinatorParams ¶ added in v2.15.0
type UpdateTailnetPeerStatusByCoordinatorParams struct { CoordinatorID uuid.UUID `db:"coordinator_id" json:"coordinator_id"` Status TailnetStatus `db:"status" json:"status"` }
type UpdateTemplateACLByIDParams ¶
type UpdateTemplateACLByIDParams struct { GroupACL TemplateACL `db:"group_acl" json:"group_acl"` UserACL TemplateACL `db:"user_acl" json:"user_acl"` ID uuid.UUID `db:"id" json:"id"` }
type UpdateTemplateAccessControlByIDParams ¶ added in v2.3.2
type UpdateTemplateMetaByIDParams ¶
type UpdateTemplateMetaByIDParams struct { ID uuid.UUID `db:"id" json:"id"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Description string `db:"description" json:"description"` Name string `db:"name" json:"name"` Icon string `db:"icon" json:"icon"` DisplayName string `db:"display_name" json:"display_name"` AllowUserCancelWorkspaceJobs bool `db:"allow_user_cancel_workspace_jobs" json:"allow_user_cancel_workspace_jobs"` GroupACL TemplateACL `db:"group_acl" json:"group_acl"` MaxPortSharingLevel AppSharingLevel `db:"max_port_sharing_level" json:"max_port_sharing_level"` }
type UpdateTemplateScheduleByIDParams ¶
type UpdateTemplateScheduleByIDParams struct { ID uuid.UUID `db:"id" json:"id"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` AllowUserAutostart bool `db:"allow_user_autostart" json:"allow_user_autostart"` AllowUserAutostop bool `db:"allow_user_autostop" json:"allow_user_autostop"` DefaultTTL int64 `db:"default_ttl" json:"default_ttl"` ActivityBump int64 `db:"activity_bump" json:"activity_bump"` AutostopRequirementDaysOfWeek int16 `db:"autostop_requirement_days_of_week" json:"autostop_requirement_days_of_week"` AutostopRequirementWeeks int64 `db:"autostop_requirement_weeks" json:"autostop_requirement_weeks"` AutostartBlockDaysOfWeek int16 `db:"autostart_block_days_of_week" json:"autostart_block_days_of_week"` FailureTTL int64 `db:"failure_ttl" json:"failure_ttl"` TimeTilDormant int64 `db:"time_til_dormant" json:"time_til_dormant"` TimeTilDormantAutoDelete int64 `db:"time_til_dormant_autodelete" json:"time_til_dormant_autodelete"` }
type UpdateTemplateVersionExternalAuthProvidersByJobIDParams ¶ added in v2.2.1
type UpdateTemplateWorkspacesLastUsedAtParams ¶ added in v2.1.2
type UpdateUserAppearanceSettingsParams ¶ added in v2.5.1
type UpdateUserGithubComUserIDParams ¶ added in v2.14.0
type UpdateUserHashedOneTimePasscodeParams ¶ added in v2.17.0
type UpdateUserLinkParams ¶
type UpdateUserLinkParams struct { OAuthAccessToken string `db:"oauth_access_token" json:"oauth_access_token"` OAuthAccessTokenKeyID sql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"` OAuthRefreshToken string `db:"oauth_refresh_token" json:"oauth_refresh_token"` OAuthRefreshTokenKeyID sql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"` OAuthExpiry time.Time `db:"oauth_expiry" json:"oauth_expiry"` Claims UserLinkClaims `db:"claims" json:"claims"` UserID uuid.UUID `db:"user_id" json:"user_id"` LoginType LoginType `db:"login_type" json:"login_type"` }
type UpdateUserNotificationPreferencesParams ¶ added in v2.15.0
type UpdateUserProfileParams ¶
type UpdateUserProfileParams struct { ID uuid.UUID `db:"id" json:"id"` Email string `db:"email" json:"email"` Username string `db:"username" json:"username"` AvatarURL string `db:"avatar_url" json:"avatar_url"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Name string `db:"name" json:"name"` }
type UpdateUserRolesParams ¶
type UpdateUserStatusParams ¶
type UpdateUserStatusParams struct { ID uuid.UUID `db:"id" json:"id"` Status UserStatus `db:"status" json:"status"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` }
type UpdateVolumeResourceMonitorParams ¶ added in v2.20.0
type UpdateVolumeResourceMonitorParams struct { AgentID uuid.UUID `db:"agent_id" json:"agent_id"` Path string `db:"path" json:"path"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` State WorkspaceAgentMonitorState `db:"state" json:"state"` DebouncedUntil time.Time `db:"debounced_until" json:"debounced_until"` }
type UpdateWorkspaceAgentConnectionByIDParams ¶
type UpdateWorkspaceAgentConnectionByIDParams struct { ID uuid.UUID `db:"id" json:"id"` FirstConnectedAt sql.NullTime `db:"first_connected_at" json:"first_connected_at"` LastConnectedAt sql.NullTime `db:"last_connected_at" json:"last_connected_at"` LastConnectedReplicaID uuid.NullUUID `db:"last_connected_replica_id" json:"last_connected_replica_id"` DisconnectedAt sql.NullTime `db:"disconnected_at" json:"disconnected_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` }
type UpdateWorkspaceAgentMetadataParams ¶
type UpdateWorkspaceAgentMetadataParams struct { WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` Key []string `db:"key" json:"key"` Value []string `db:"value" json:"value"` Error []string `db:"error" json:"error"` CollectedAt []time.Time `db:"collected_at" json:"collected_at"` }
type UpdateWorkspaceAgentStartupByIDParams ¶
type UpdateWorkspaceAgentStartupByIDParams struct { ID uuid.UUID `db:"id" json:"id"` Version string `db:"version" json:"version"` ExpandedDirectory string `db:"expanded_directory" json:"expanded_directory"` Subsystems []WorkspaceAgentSubsystem `db:"subsystems" json:"subsystems"` APIVersion string `db:"api_version" json:"api_version"` }
type UpdateWorkspaceAppHealthByIDParams ¶
type UpdateWorkspaceAppHealthByIDParams struct { ID uuid.UUID `db:"id" json:"id"` Health WorkspaceAppHealth `db:"health" json:"health"` }
type UpdateWorkspaceAutomaticUpdatesParams ¶ added in v2.3.0
type UpdateWorkspaceAutomaticUpdatesParams struct { ID uuid.UUID `db:"id" json:"id"` AutomaticUpdates AutomaticUpdates `db:"automatic_updates" json:"automatic_updates"` }
type UpdateWorkspaceBuildDeadlineByIDParams ¶ added in v2.2.0
type UpdateWorkspaceBuildProvisionerStateByIDParams ¶ added in v2.2.0
type UpdateWorkspaceDormantDeletingAtParams ¶ added in v2.1.4
type UpdateWorkspaceNextStartAtParams ¶ added in v2.19.0
type UpdateWorkspaceParams ¶
type UpdateWorkspacesDormantDeletingAtByTemplateIDParams ¶ added in v2.1.4
type UpdateWorkspacesTTLByTemplateIDParams ¶ added in v2.19.0
type UpsertJFrogXrayScanByWorkspaceAndAgentIDParams ¶ added in v2.8.0
type UpsertJFrogXrayScanByWorkspaceAndAgentIDParams struct { AgentID uuid.UUID `db:"agent_id" json:"agent_id"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` Critical int32 `db:"critical" json:"critical"` High int32 `db:"high" json:"high"` Medium int32 `db:"medium" json:"medium"` ResultsUrl string `db:"results_url" json:"results_url"` }
type UpsertNotificationReportGeneratorLogParams ¶ added in v2.16.0
type UpsertProvisionerDaemonParams ¶ added in v2.5.1
type UpsertProvisionerDaemonParams struct { CreatedAt time.Time `db:"created_at" json:"created_at"` Name string `db:"name" json:"name"` Provisioners []ProvisionerType `db:"provisioners" json:"provisioners"` Tags StringMap `db:"tags" json:"tags"` LastSeenAt sql.NullTime `db:"last_seen_at" json:"last_seen_at"` Version string `db:"version" json:"version"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` APIVersion string `db:"api_version" json:"api_version"` KeyID uuid.UUID `db:"key_id" json:"key_id"` }
type UpsertRuntimeConfigParams ¶ added in v2.16.0
type UpsertTailnetClientSubscriptionParams ¶ added in v2.2.0
type UpsertTailnetPeerParams ¶ added in v2.4.0
type UpsertTailnetTunnelParams ¶ added in v2.4.0
type UpsertTelemetryItemParams ¶ added in v2.19.0
type UpsertWebpushVAPIDKeysParams ¶ added in v2.21.0
type UpsertWorkspaceAgentPortShareParams ¶ added in v2.9.0
type UpsertWorkspaceAgentPortShareParams struct {}
type UpsertWorkspaceAppAuditSessionParams ¶ added in v2.21.0
type UpsertWorkspaceAppAuditSessionParams struct { ID uuid.UUID `db:"id" json:"id"` AgentID uuid.UUID `db:"agent_id" json:"agent_id"` AppID uuid.UUID `db:"app_id" json:"app_id"` UserID uuid.UUID `db:"user_id" json:"user_id"` Ip string `db:"ip" json:"ip"` UserAgent string `db:"user_agent" json:"user_agent"` SlugOrPort string `db:"slug_or_port" json:"slug_or_port"` StatusCode int32 `db:"status_code" json:"status_code"` StartedAt time.Time `db:"started_at" json:"started_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` StaleIntervalMS int64 `db:"stale_interval_ms" json:"stale_interval_ms"` }
type User ¶
type User struct { ID uuid.UUID `db:"id" json:"id"` Email string `db:"email" json:"email"` Username string `db:"username" json:"username"` HashedPassword []byte `db:"hashed_password" json:"hashed_password"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Status UserStatus `db:"status" json:"status"` RBACRoles pq.StringArray `db:"rbac_roles" json:"rbac_roles"` LoginType LoginType `db:"login_type" json:"login_type"` AvatarURL string `db:"avatar_url" json:"avatar_url"` Deleted bool `db:"deleted" json:"deleted"` LastSeenAt time.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. QuietHoursSchedule string `db:"quiet_hours_schedule" json:"quiet_hours_schedule"` // Name of the Coder user Name string `db:"name" json:"name"` // The GitHub.com numerical user ID. It is used to check if the user has starred the Coder repository. It is also used for filtering users in the users list CLI command, and may become more widely used in the future. GithubComUserID sql.NullInt64 `db:"github_com_user_id" json:"github_com_user_id"` // A hash of the one-time-passcode given to the user. HashedOneTimePasscode []byte `db:"hashed_one_time_passcode" json:"hashed_one_time_passcode"` // The time when the one-time-passcode expires. OneTimePasscodeExpiresAt sql.NullTime `db:"one_time_passcode_expires_at" json:"one_time_passcode_expires_at"` // Determines if a user is a system user, and therefore cannot login or perform normal actions IsSystem bool `db:"is_system" json:"is_system"` }
func ConvertUserRows ¶
func ConvertUserRows(rows []GetUsersRow) []User
func (User) RBACObject ¶
RBACObject returns the RBAC object for the site wide user resource.
type UserConfig ¶ added in v2.21.0
type UserDeleted ¶ added in v2.19.0
type UserDeleted struct { ID uuid.UUID `db:"id" json:"id"` UserID uuid.UUID `db:"user_id" json:"user_id"` DeletedAt time.Time `db:"deleted_at" json:"deleted_at"` }
Tracks when users were deleted
type UserLink ¶
type UserLink struct { UserID uuid.UUID `db:"user_id" json:"user_id"` LoginType LoginType `db:"login_type" json:"login_type"` LinkedID string `db:"linked_id" json:"linked_id"` OAuthAccessToken string `db:"oauth_access_token" json:"oauth_access_token"` OAuthRefreshToken string `db:"oauth_refresh_token" json:"oauth_refresh_token"` OAuthExpiry time.Time `db:"oauth_expiry" json:"oauth_expiry"` // The ID of the key used to encrypt the OAuth access token. If this is NULL, the access token is not encrypted OAuthAccessTokenKeyID sql.NullString `db:"oauth_access_token_key_id" json:"oauth_access_token_key_id"` // The ID of the key used to encrypt the OAuth refresh token. If this is NULL, the refresh token is not encrypted OAuthRefreshTokenKeyID sql.NullString `db:"oauth_refresh_token_key_id" json:"oauth_refresh_token_key_id"` // Claims from the IDP for the linked user. Includes both id_token and userinfo claims. Claims UserLinkClaims `db:"claims" json:"claims"` }
func (UserLink) RBACObject ¶
type UserLinkClaims ¶ added in v2.18.0
type UserLinkClaims struct { IDTokenClaims map[string]interface{} `json:"id_token_claims"` UserInfoClaims map[string]interface{} `json:"user_info_claims"` // MergeClaims are computed in Golang. It is the result of merging // the IDTokenClaims and UserInfoClaims. UserInfoClaims take precedence. MergedClaims map[string]interface{} `json:"merged_claims"` }
UserLinkClaims is the returned IDP claims for a given user link. These claims are fetched at login time. These are the claims that were used for IDP sync.
func (*UserLinkClaims) Scan ¶ added in v2.18.0
func (a *UserLinkClaims) Scan(src interface{}) error
type UserStatus ¶
type UserStatus string
Defines the users status: active, dormant, or suspended.
const ( UserStatusActive UserStatus = "active" UserStatusSuspended UserStatus = "suspended" UserStatusDormant UserStatus = "dormant" )
func AllUserStatusValues ¶
func AllUserStatusValues() []UserStatus
func (*UserStatus) Scan ¶
func (e *UserStatus) Scan(src interface{}) error
func (UserStatus) Valid ¶
func (e UserStatus) Valid() bool
type UserStatusChange ¶ added in v2.19.0
type UserStatusChange struct { ID uuid.UUID `db:"id" json:"id"` UserID uuid.UUID `db:"user_id" json:"user_id"` NewStatus UserStatus `db:"new_status" json:"new_status"` ChangedAt time.Time `db:"changed_at" json:"changed_at"` }
Tracks the history of user status changes
type VisibleUser ¶
type VisibleUser struct { ID uuid.UUID `db:"id" json:"id"` Username string `db:"username" json:"username"` AvatarURL string `db:"avatar_url" json:"avatar_url"` }
Visible fields of users are allowed to be joined with other tables for including context of other resources.
type WebpushSubscription ¶ added in v2.21.0
type WebpushSubscription struct { ID uuid.UUID `db:"id" json:"id"` UserID uuid.UUID `db:"user_id" json:"user_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` Endpoint string `db:"endpoint" json:"endpoint"` EndpointP256dhKey string `db:"endpoint_p256dh_key" json:"endpoint_p256dh_key"` EndpointAuthKey string `db:"endpoint_auth_key" json:"endpoint_auth_key"` }
type Workspace ¶
type Workspace struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OwnerID uuid.UUID `db:"owner_id" json:"owner_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` Deleted bool `db:"deleted" json:"deleted"` Name string `db:"name" json:"name"` AutostartSchedule sql.NullString `db:"autostart_schedule" json:"autostart_schedule"` Ttl sql.NullInt64 `db:"ttl" json:"ttl"` LastUsedAt time.Time `db:"last_used_at" json:"last_used_at"` DormantAt sql.NullTime `db:"dormant_at" json:"dormant_at"` DeletingAt sql.NullTime `db:"deleting_at" json:"deleting_at"` AutomaticUpdates AutomaticUpdates `db:"automatic_updates" json:"automatic_updates"` Favorite bool `db:"favorite" json:"favorite"` NextStartAt sql.NullTime `db:"next_start_at" json:"next_start_at"` OwnerAvatarUrl string `db:"owner_avatar_url" json:"owner_avatar_url"` OwnerUsername string `db:"owner_username" json:"owner_username"` OrganizationName string `db:"organization_name" json:"organization_name"` OrganizationDisplayName string `db:"organization_display_name" json:"organization_display_name"` OrganizationIcon string `db:"organization_icon" json:"organization_icon"` OrganizationDescription string `db:"organization_description" json:"organization_description"` TemplateName string `db:"template_name" json:"template_name"` TemplateDisplayName string `db:"template_display_name" json:"template_display_name"` TemplateIcon string `db:"template_icon" json:"template_icon"` TemplateDescription string `db:"template_description" json:"template_description"` }
Joins in the display name information such as username, avatar, and organization name.
func ConvertWorkspaceRows ¶
func ConvertWorkspaceRows(rows []GetWorkspacesRow) []Workspace
func (Workspace) RBACObject ¶
func (Workspace) WorkspaceTable ¶ added in v2.17.0
func (w Workspace) WorkspaceTable() WorkspaceTable
WorkspaceTable converts a Workspace to it's reduced version. A more generalized solution is to use json marshaling to consistently keep these two structs in sync. That would be a lot of overhead, and a more costly unit test is written to make sure these match up.
type WorkspaceAgent ¶
type WorkspaceAgent struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` Name string `db:"name" json:"name"` FirstConnectedAt sql.NullTime `db:"first_connected_at" json:"first_connected_at"` LastConnectedAt sql.NullTime `db:"last_connected_at" json:"last_connected_at"` DisconnectedAt sql.NullTime `db:"disconnected_at" json:"disconnected_at"` ResourceID uuid.UUID `db:"resource_id" json:"resource_id"` AuthToken uuid.UUID `db:"auth_token" json:"auth_token"` AuthInstanceID sql.NullString `db:"auth_instance_id" json:"auth_instance_id"` Architecture string `db:"architecture" json:"architecture"` EnvironmentVariables pqtype.NullRawMessage `db:"environment_variables" json:"environment_variables"` OperatingSystem string `db:"operating_system" json:"operating_system"` InstanceMetadata pqtype.NullRawMessage `db:"instance_metadata" json:"instance_metadata"` ResourceMetadata pqtype.NullRawMessage `db:"resource_metadata" json:"resource_metadata"` Directory string `db:"directory" json:"directory"` // Version tracks the version of the currently running workspace agent. Workspace agents register their version upon start. Version string `db:"version" json:"version"` LastConnectedReplicaID uuid.NullUUID `db:"last_connected_replica_id" json:"last_connected_replica_id"` // Connection timeout in seconds, 0 means disabled. ConnectionTimeoutSeconds int32 `db:"connection_timeout_seconds" json:"connection_timeout_seconds"` // URL for troubleshooting the agent. TroubleshootingURL string `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. MOTDFile string `db:"motd_file" json:"motd_file"` // The current lifecycle state reported by the workspace agent. LifecycleState WorkspaceAgentLifecycleState `db:"lifecycle_state" json:"lifecycle_state"` // The resolved path of a user-specified directory. e.g. ~/coder -> /home/coder/coder ExpandedDirectory string `db:"expanded_directory" json:"expanded_directory"` // Total length of startup logs LogsLength int32 `db:"logs_length" json:"logs_length"` // Whether the startup logs overflowed in length LogsOverflowed bool `db:"logs_overflowed" json:"logs_overflowed"` // The time the agent entered the starting lifecycle state StartedAt sql.NullTime `db:"started_at" json:"started_at"` // The time the agent entered the ready or start_error lifecycle state ReadyAt sql.NullTime `db:"ready_at" json:"ready_at"` Subsystems []WorkspaceAgentSubsystem `db:"subsystems" json:"subsystems"` DisplayApps []DisplayApp `db:"display_apps" json:"display_apps"` APIVersion string `db:"api_version" json:"api_version"` // Specifies the order in which to display agents in user interfaces. DisplayOrder int32 `db:"display_order" json:"display_order"` }
func (WorkspaceAgent) Status ¶
func (a WorkspaceAgent) Status(inactiveTimeout time.Duration) WorkspaceAgentConnectionStatus
type WorkspaceAgentDevcontainer ¶ added in v2.21.0
type WorkspaceAgentDevcontainer struct { // Unique identifier ID uuid.UUID `db:"id" json:"id"` // Workspace agent foreign key WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` // Creation timestamp CreatedAt time.Time `db:"created_at" json:"created_at"` // Workspace folder WorkspaceFolder string `db:"workspace_folder" json:"workspace_folder"` // Path to devcontainer.json. ConfigPath string `db:"config_path" json:"config_path"` // The name of the Dev Container. Name string `db:"name" json:"name"` }
Workspace agent devcontainer configuration
type WorkspaceAgentLifecycleState ¶
type WorkspaceAgentLifecycleState string
const ( WorkspaceAgentLifecycleStateCreated WorkspaceAgentLifecycleState = "created" WorkspaceAgentLifecycleStateStarting WorkspaceAgentLifecycleState = "starting" WorkspaceAgentLifecycleStateStartTimeout WorkspaceAgentLifecycleState = "start_timeout" WorkspaceAgentLifecycleStateStartError WorkspaceAgentLifecycleState = "start_error" WorkspaceAgentLifecycleStateReady WorkspaceAgentLifecycleState = "ready" WorkspaceAgentLifecycleStateShuttingDown WorkspaceAgentLifecycleState = "shutting_down" WorkspaceAgentLifecycleStateShutdownTimeout WorkspaceAgentLifecycleState = "shutdown_timeout" WorkspaceAgentLifecycleStateShutdownError WorkspaceAgentLifecycleState = "shutdown_error" WorkspaceAgentLifecycleStateOff WorkspaceAgentLifecycleState = "off" )
func AllWorkspaceAgentLifecycleStateValues ¶
func AllWorkspaceAgentLifecycleStateValues() []WorkspaceAgentLifecycleState
func (*WorkspaceAgentLifecycleState) Scan ¶
func (e *WorkspaceAgentLifecycleState) Scan(src interface{}) error
func (WorkspaceAgentLifecycleState) Valid ¶
func (e WorkspaceAgentLifecycleState) Valid() bool
type WorkspaceAgentLog ¶
type WorkspaceAgentLog struct { AgentID uuid.UUID `db:"agent_id" json:"agent_id"` CreatedAt time.Time `db:"created_at" json:"created_at"` Output string `db:"output" json:"output"` ID int64 `db:"id" json:"id"` Level LogLevel `db:"level" json:"level"` LogSourceID uuid.UUID `db:"log_source_id" json:"log_source_id"` }
type WorkspaceAgentLogSource ¶
type WorkspaceAgentLogSource struct { WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` DisplayName string `db:"display_name" json:"display_name"` Icon string `db:"icon" json:"icon"` }
type WorkspaceAgentMemoryResourceMonitor ¶ added in v2.20.0
type WorkspaceAgentMemoryResourceMonitor struct { AgentID uuid.UUID `db:"agent_id" json:"agent_id"` Enabled bool `db:"enabled" json:"enabled"` Threshold int32 `db:"threshold" json:"threshold"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` State WorkspaceAgentMonitorState `db:"state" json:"state"` DebouncedUntil time.Time `db:"debounced_until" json:"debounced_until"` }
type WorkspaceAgentMetadatum ¶
type WorkspaceAgentMetadatum struct { WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` DisplayName string `db:"display_name" json:"display_name"` Key string `db:"key" json:"key"` Script string `db:"script" json:"script"` Value string `db:"value" json:"value"` Error string `db:"error" json:"error"` Timeout int64 `db:"timeout" json:"timeout"` Interval int64 `db:"interval" json:"interval"` CollectedAt time.Time `db:"collected_at" json:"collected_at"` // Specifies the order in which to display agent metadata in user interfaces. DisplayOrder int32 `db:"display_order" json:"display_order"` }
type WorkspaceAgentMonitorState ¶ added in v2.20.0
type WorkspaceAgentMonitorState string
const ( WorkspaceAgentMonitorStateOK WorkspaceAgentMonitorState = "OK" WorkspaceAgentMonitorStateNOK WorkspaceAgentMonitorState = "NOK" )
func AllWorkspaceAgentMonitorStateValues ¶ added in v2.20.0
func AllWorkspaceAgentMonitorStateValues() []WorkspaceAgentMonitorState
func (*WorkspaceAgentMonitorState) Scan ¶ added in v2.20.0
func (e *WorkspaceAgentMonitorState) Scan(src interface{}) error
func (WorkspaceAgentMonitorState) Valid ¶ added in v2.20.0
func (e WorkspaceAgentMonitorState) Valid() bool
type WorkspaceAgentPortShare ¶ added in v2.9.0
type WorkspaceAgentPortShare struct {}
type WorkspaceAgentScript ¶ added in v2.2.0
type WorkspaceAgentScript struct { WorkspaceAgentID uuid.UUID `db:"workspace_agent_id" json:"workspace_agent_id"` LogSourceID uuid.UUID `db:"log_source_id" json:"log_source_id"` LogPath string `db:"log_path" json:"log_path"` CreatedAt time.Time `db:"created_at" json:"created_at"` Script string `db:"script" json:"script"` Cron string `db:"cron" json:"cron"` StartBlocksLogin bool `db:"start_blocks_login" json:"start_blocks_login"` RunOnStart bool `db:"run_on_start" json:"run_on_start"` RunOnStop bool `db:"run_on_stop" json:"run_on_stop"` TimeoutSeconds int32 `db:"timeout_seconds" json:"timeout_seconds"` DisplayName string `db:"display_name" json:"display_name"` ID uuid.UUID `db:"id" json:"id"` }
type WorkspaceAgentScriptTiming ¶ added in v2.16.0
type WorkspaceAgentScriptTiming struct { ScriptID uuid.UUID `db:"script_id" json:"script_id"` StartedAt time.Time `db:"started_at" json:"started_at"` EndedAt time.Time `db:"ended_at" json:"ended_at"` ExitCode int32 `db:"exit_code" json:"exit_code"` Stage WorkspaceAgentScriptTimingStage `db:"stage" json:"stage"` Status WorkspaceAgentScriptTimingStatus `db:"status" json:"status"` }
type WorkspaceAgentScriptTimingStage ¶ added in v2.16.0
type WorkspaceAgentScriptTimingStage string
What stage the script was ran in.
const ( WorkspaceAgentScriptTimingStageStart WorkspaceAgentScriptTimingStage = "start" WorkspaceAgentScriptTimingStageStop WorkspaceAgentScriptTimingStage = "stop" WorkspaceAgentScriptTimingStageCron WorkspaceAgentScriptTimingStage = "cron" )
func AllWorkspaceAgentScriptTimingStageValues ¶ added in v2.16.0
func AllWorkspaceAgentScriptTimingStageValues() []WorkspaceAgentScriptTimingStage
func (*WorkspaceAgentScriptTimingStage) Scan ¶ added in v2.16.0
func (e *WorkspaceAgentScriptTimingStage) Scan(src interface{}) error
func (WorkspaceAgentScriptTimingStage) Valid ¶ added in v2.16.0
func (e WorkspaceAgentScriptTimingStage) Valid() bool
type WorkspaceAgentScriptTimingStatus ¶ added in v2.16.0
type WorkspaceAgentScriptTimingStatus string
What the exit status of the script is.
const ( WorkspaceAgentScriptTimingStatusOk WorkspaceAgentScriptTimingStatus = "ok" WorkspaceAgentScriptTimingStatusExitFailure WorkspaceAgentScriptTimingStatus = "exit_failure" WorkspaceAgentScriptTimingStatusTimedOut WorkspaceAgentScriptTimingStatus = "timed_out" WorkspaceAgentScriptTimingStatusPipesLeftOpen WorkspaceAgentScriptTimingStatus = "pipes_left_open" )
func AllWorkspaceAgentScriptTimingStatusValues ¶ added in v2.16.0
func AllWorkspaceAgentScriptTimingStatusValues() []WorkspaceAgentScriptTimingStatus
func (*WorkspaceAgentScriptTimingStatus) Scan ¶ added in v2.16.0
func (e *WorkspaceAgentScriptTimingStatus) Scan(src interface{}) error
func (WorkspaceAgentScriptTimingStatus) Valid ¶ added in v2.16.0
func (e WorkspaceAgentScriptTimingStatus) Valid() bool
type WorkspaceAgentStat ¶
type WorkspaceAgentStat struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UserID uuid.UUID `db:"user_id" json:"user_id"` AgentID uuid.UUID `db:"agent_id" json:"agent_id"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` ConnectionsByProto json.RawMessage `db:"connections_by_proto" json:"connections_by_proto"` ConnectionCount int64 `db:"connection_count" json:"connection_count"` RxPackets int64 `db:"rx_packets" json:"rx_packets"` RxBytes int64 `db:"rx_bytes" json:"rx_bytes"` TxPackets int64 `db:"tx_packets" json:"tx_packets"` TxBytes int64 `db:"tx_bytes" json:"tx_bytes"` ConnectionMedianLatencyMS float64 `db:"connection_median_latency_ms" json:"connection_median_latency_ms"` SessionCountVSCode int64 `db:"session_count_vscode" json:"session_count_vscode"` SessionCountJetBrains int64 `db:"session_count_jetbrains" json:"session_count_jetbrains"` SessionCountReconnectingPTY int64 `db:"session_count_reconnecting_pty" json:"session_count_reconnecting_pty"` SessionCountSSH int64 `db:"session_count_ssh" json:"session_count_ssh"` Usage bool `db:"usage" json:"usage"` }
type WorkspaceAgentStatus ¶
type WorkspaceAgentStatus string
const ( WorkspaceAgentStatusConnecting WorkspaceAgentStatus = "connecting" WorkspaceAgentStatusConnected WorkspaceAgentStatus = "connected" WorkspaceAgentStatusDisconnected WorkspaceAgentStatus = "disconnected" WorkspaceAgentStatusTimeout WorkspaceAgentStatus = "timeout" )
This is also in codersdk/workspaceagents.go and should be kept in sync.
func (WorkspaceAgentStatus) Valid ¶
func (s WorkspaceAgentStatus) Valid() bool
type WorkspaceAgentSubsystem ¶
type WorkspaceAgentSubsystem string
const ( WorkspaceAgentSubsystemEnvbuilder WorkspaceAgentSubsystem = "envbuilder" WorkspaceAgentSubsystemEnvbox WorkspaceAgentSubsystem = "envbox" WorkspaceAgentSubsystemNone WorkspaceAgentSubsystem = "none" WorkspaceAgentSubsystemExectrace WorkspaceAgentSubsystem = "exectrace" )
func AllWorkspaceAgentSubsystemValues ¶
func AllWorkspaceAgentSubsystemValues() []WorkspaceAgentSubsystem
func (*WorkspaceAgentSubsystem) Scan ¶
func (e *WorkspaceAgentSubsystem) Scan(src interface{}) error
func (WorkspaceAgentSubsystem) Valid ¶
func (e WorkspaceAgentSubsystem) Valid() bool
type WorkspaceAgentVolumeResourceMonitor ¶ added in v2.20.0
type WorkspaceAgentVolumeResourceMonitor struct { AgentID uuid.UUID `db:"agent_id" json:"agent_id"` Enabled bool `db:"enabled" json:"enabled"` Threshold int32 `db:"threshold" json:"threshold"` Path string `db:"path" json:"path"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` State WorkspaceAgentMonitorState `db:"state" json:"state"` DebouncedUntil time.Time `db:"debounced_until" json:"debounced_until"` }
type WorkspaceApp ¶
type WorkspaceApp struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` AgentID uuid.UUID `db:"agent_id" json:"agent_id"` DisplayName string `db:"display_name" json:"display_name"` Icon string `db:"icon" json:"icon"` Command sql.NullString `db:"command" json:"command"` Url sql.NullString `db:"url" json:"url"` HealthcheckUrl string `db:"healthcheck_url" json:"healthcheck_url"` HealthcheckInterval int32 `db:"healthcheck_interval" json:"healthcheck_interval"` HealthcheckThreshold int32 `db:"healthcheck_threshold" json:"healthcheck_threshold"` Health WorkspaceAppHealth `db:"health" json:"health"` Subdomain bool `db:"subdomain" json:"subdomain"` SharingLevel AppSharingLevel `db:"sharing_level" json:"sharing_level"` Slug string `db:"slug" json:"slug"` External bool `db:"external" json:"external"` // Specifies the order in which to display agent app in user interfaces. DisplayOrder int32 `db:"display_order" json:"display_order"` // Determines if the app is not shown in user interfaces. Hidden bool `db:"hidden" json:"hidden"` OpenIn WorkspaceAppOpenIn `db:"open_in" json:"open_in"` }
type WorkspaceAppAuditSession ¶ added in v2.21.0
type WorkspaceAppAuditSession struct { // The agent that the workspace app or port forward belongs to. AgentID uuid.UUID `db:"agent_id" json:"agent_id"` // The app that is currently in the workspace app. This is may be uuid.Nil because ports are not associated with an app. AppID uuid.UUID `db:"app_id" json:"app_id"` // The user that is currently using the workspace app. This is may be uuid.Nil if we cannot determine the user. UserID uuid.UUID `db:"user_id" json:"user_id"` // The IP address of the user that is currently using the workspace app. Ip string `db:"ip" json:"ip"` // The user agent of the user that is currently using the workspace app. UserAgent string `db:"user_agent" json:"user_agent"` // The slug or port of the workspace app that the user is currently using. SlugOrPort string `db:"slug_or_port" json:"slug_or_port"` // The HTTP status produced by the token authorization. Defaults to 200 if no status is provided. StatusCode int32 `db:"status_code" json:"status_code"` // The time the user started the session. StartedAt time.Time `db:"started_at" json:"started_at"` // The time the session was last updated. UpdatedAt time.Time `db:"updated_at" json:"updated_at"` ID uuid.UUID `db:"id" json:"id"` }
Audit sessions for workspace apps, the data in this table is ephemeral and is used to deduplicate audit log entries for workspace apps. While a session is active, the same data will not be logged again. This table does not store historical data.
type WorkspaceAppHealth ¶
type WorkspaceAppHealth string
const ( WorkspaceAppHealthDisabled WorkspaceAppHealth = "disabled" WorkspaceAppHealthInitializing WorkspaceAppHealth = "initializing" WorkspaceAppHealthHealthy WorkspaceAppHealth = "healthy" WorkspaceAppHealthUnhealthy WorkspaceAppHealth = "unhealthy" )
func AllWorkspaceAppHealthValues ¶
func AllWorkspaceAppHealthValues() []WorkspaceAppHealth
func (*WorkspaceAppHealth) Scan ¶
func (e *WorkspaceAppHealth) Scan(src interface{}) error
func (WorkspaceAppHealth) Valid ¶
func (e WorkspaceAppHealth) Valid() bool
type WorkspaceAppOpenIn ¶ added in v2.19.0
type WorkspaceAppOpenIn string
const ( WorkspaceAppOpenInTab WorkspaceAppOpenIn = "tab" WorkspaceAppOpenInWindow WorkspaceAppOpenIn = "window" WorkspaceAppOpenInSlimWindow WorkspaceAppOpenIn = "slim-window" )
func AllWorkspaceAppOpenInValues ¶ added in v2.19.0
func AllWorkspaceAppOpenInValues() []WorkspaceAppOpenIn
func (*WorkspaceAppOpenIn) Scan ¶ added in v2.19.0
func (e *WorkspaceAppOpenIn) Scan(src interface{}) error
func (WorkspaceAppOpenIn) Valid ¶ added in v2.19.0
func (e WorkspaceAppOpenIn) Valid() bool
type WorkspaceAppStat ¶
type WorkspaceAppStat struct { // The ID of the record ID int64 `db:"id" json:"id"` // The user who used the workspace app UserID uuid.UUID `db:"user_id" json:"user_id"` // The workspace that the workspace app was used in WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` // The workspace agent that was used AgentID uuid.UUID `db:"agent_id" json:"agent_id"` // The method used to access the workspace app AccessMethod string `db:"access_method" json:"access_method"` // The slug or port used to to identify the app SlugOrPort string `db:"slug_or_port" json:"slug_or_port"` // The unique identifier for the session SessionID uuid.UUID `db:"session_id" json:"session_id"` // The time the session started SessionStartedAt time.Time `db:"session_started_at" json:"session_started_at"` // The time the session ended SessionEndedAt time.Time `db:"session_ended_at" json:"session_ended_at"` // The number of requests made during the session, a number larger than 1 indicates that multiple sessions were rolled up into one Requests int32 `db:"requests" json:"requests"` }
A record of workspace app usage statistics
type WorkspaceAppStatus ¶ added in v2.21.0
type WorkspaceAppStatus struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` AgentID uuid.UUID `db:"agent_id" json:"agent_id"` AppID uuid.UUID `db:"app_id" json:"app_id"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` State WorkspaceAppStatusState `db:"state" json:"state"` NeedsUserAttention bool `db:"needs_user_attention" json:"needs_user_attention"` Message string `db:"message" json:"message"` Uri sql.NullString `db:"uri" json:"uri"` Icon sql.NullString `db:"icon" json:"icon"` }
type WorkspaceAppStatusState ¶ added in v2.21.0
type WorkspaceAppStatusState string
const ( WorkspaceAppStatusStateWorking WorkspaceAppStatusState = "working" WorkspaceAppStatusStateComplete WorkspaceAppStatusState = "complete" WorkspaceAppStatusStateFailure WorkspaceAppStatusState = "failure" )
func AllWorkspaceAppStatusStateValues ¶ added in v2.21.0
func AllWorkspaceAppStatusStateValues() []WorkspaceAppStatusState
func (*WorkspaceAppStatusState) Scan ¶ added in v2.21.0
func (e *WorkspaceAppStatusState) Scan(src interface{}) error
func (WorkspaceAppStatusState) Valid ¶ added in v2.21.0
func (e WorkspaceAppStatusState) Valid() bool
type WorkspaceBuild ¶
type WorkspaceBuild struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"` BuildNumber int32 `db:"build_number" json:"build_number"` Transition WorkspaceTransition `db:"transition" json:"transition"` InitiatorID uuid.UUID `db:"initiator_id" json:"initiator_id"` ProvisionerState []byte `db:"provisioner_state" json:"provisioner_state"` JobID uuid.UUID `db:"job_id" json:"job_id"` Deadline time.Time `db:"deadline" json:"deadline"` Reason BuildReason `db:"reason" json:"reason"` DailyCost int32 `db:"daily_cost" json:"daily_cost"` MaxDeadline time.Time `db:"max_deadline" json:"max_deadline"` TemplateVersionPresetID uuid.NullUUID `db:"template_version_preset_id" json:"template_version_preset_id"` InitiatorByAvatarUrl string `db:"initiator_by_avatar_url" json:"initiator_by_avatar_url"` InitiatorByUsername string `db:"initiator_by_username" json:"initiator_by_username"` }
Joins in the username + avatar url of the initiated by user.
type WorkspaceBuildParameter ¶
type WorkspaceBuildTable ¶
type WorkspaceBuildTable struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` WorkspaceID uuid.UUID `db:"workspace_id" json:"workspace_id"` TemplateVersionID uuid.UUID `db:"template_version_id" json:"template_version_id"` BuildNumber int32 `db:"build_number" json:"build_number"` Transition WorkspaceTransition `db:"transition" json:"transition"` InitiatorID uuid.UUID `db:"initiator_id" json:"initiator_id"` ProvisionerState []byte `db:"provisioner_state" json:"provisioner_state"` JobID uuid.UUID `db:"job_id" json:"job_id"` Deadline time.Time `db:"deadline" json:"deadline"` Reason BuildReason `db:"reason" json:"reason"` DailyCost int32 `db:"daily_cost" json:"daily_cost"` MaxDeadline time.Time `db:"max_deadline" json:"max_deadline"` TemplateVersionPresetID uuid.NullUUID `db:"template_version_preset_id" json:"template_version_preset_id"` }
type WorkspaceModule ¶ added in v2.18.0
type WorkspaceModule struct { ID uuid.UUID `db:"id" json:"id"` JobID uuid.UUID `db:"job_id" json:"job_id"` Transition WorkspaceTransition `db:"transition" json:"transition"` Source string `db:"source" json:"source"` Version string `db:"version" json:"version"` Key string `db:"key" json:"key"` CreatedAt time.Time `db:"created_at" json:"created_at"` }
type WorkspaceProxy ¶
type WorkspaceProxy struct { ID uuid.UUID `db:"id" json:"id"` Name string `db:"name" json:"name"` DisplayName string `db:"display_name" json:"display_name"` // Expects an emoji character. (/emojis/1f1fa-1f1f8.png) Icon string `db:"icon" json:"icon"` // Full url including scheme of the proxy api url: https://us.example.com Url string `db:"url" json:"url"` // Hostname with the wildcard for subdomain based app hosting: *.us.example.com WildcardHostname string `db:"wildcard_hostname" json:"wildcard_hostname"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` // Boolean indicator of a deleted workspace proxy. Proxies are soft-deleted. Deleted bool `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"` RegionID int32 `db:"region_id" json:"region_id"` DerpEnabled bool `db:"derp_enabled" json:"derp_enabled"` // Disables app/terminal proxying for this proxy and only acts as a DERP relay. DerpOnly bool `db:"derp_only" json:"derp_only"` Version string `db:"version" json:"version"` }
func (WorkspaceProxy) IsPrimary ¶
func (w WorkspaceProxy) IsPrimary() bool
func (WorkspaceProxy) RBACObject ¶
func (w WorkspaceProxy) RBACObject() rbac.Object
type WorkspaceResource ¶
type WorkspaceResource struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` JobID uuid.UUID `db:"job_id" json:"job_id"` Transition WorkspaceTransition `db:"transition" json:"transition"` Type string `db:"type" json:"type"` Name string `db:"name" json:"name"` Hide bool `db:"hide" json:"hide"` Icon string `db:"icon" json:"icon"` InstanceType sql.NullString `db:"instance_type" json:"instance_type"` DailyCost int32 `db:"daily_cost" json:"daily_cost"` ModulePath sql.NullString `db:"module_path" json:"module_path"` }
type WorkspaceStatus ¶
type WorkspaceStatus string
const ( WorkspaceStatusPending WorkspaceStatus = "pending" WorkspaceStatusStarting WorkspaceStatus = "starting" WorkspaceStatusRunning WorkspaceStatus = "running" WorkspaceStatusStopping WorkspaceStatus = "stopping" WorkspaceStatusStopped WorkspaceStatus = "stopped" WorkspaceStatusFailed WorkspaceStatus = "failed" WorkspaceStatusCanceling WorkspaceStatus = "canceling" WorkspaceStatusCanceled WorkspaceStatus = "canceled" WorkspaceStatusDeleting WorkspaceStatus = "deleting" WorkspaceStatusDeleted WorkspaceStatus = "deleted" )
func (WorkspaceStatus) Valid ¶
func (s WorkspaceStatus) Valid() bool
type WorkspaceTable ¶ added in v2.17.0
type WorkspaceTable struct { ID uuid.UUID `db:"id" json:"id"` CreatedAt time.Time `db:"created_at" json:"created_at"` UpdatedAt time.Time `db:"updated_at" json:"updated_at"` OwnerID uuid.UUID `db:"owner_id" json:"owner_id"` OrganizationID uuid.UUID `db:"organization_id" json:"organization_id"` TemplateID uuid.UUID `db:"template_id" json:"template_id"` Deleted bool `db:"deleted" json:"deleted"` Name string `db:"name" json:"name"` AutostartSchedule sql.NullString `db:"autostart_schedule" json:"autostart_schedule"` Ttl sql.NullInt64 `db:"ttl" json:"ttl"` LastUsedAt time.Time `db:"last_used_at" json:"last_used_at"` DormantAt sql.NullTime `db:"dormant_at" json:"dormant_at"` DeletingAt sql.NullTime `db:"deleting_at" json:"deleting_at"` AutomaticUpdates AutomaticUpdates `db:"automatic_updates" json:"automatic_updates"` // Favorite is true if the workspace owner has favorited the workspace. Favorite bool `db:"favorite" json:"favorite"` NextStartAt sql.NullTime `db:"next_start_at" json:"next_start_at"` }
func (WorkspaceTable) DormantRBAC ¶ added in v2.17.0
func (w WorkspaceTable) DormantRBAC() rbac.Object
func (WorkspaceTable) RBACObject ¶ added in v2.17.0
func (w WorkspaceTable) RBACObject() rbac.Object
type WorkspaceTransition ¶
type WorkspaceTransition string
const ( WorkspaceTransitionStart WorkspaceTransition = "start" WorkspaceTransitionStop WorkspaceTransition = "stop" WorkspaceTransitionDelete WorkspaceTransition = "delete" )
func AllWorkspaceTransitionValues ¶
func AllWorkspaceTransitionValues() []WorkspaceTransition
func (*WorkspaceTransition) Scan ¶
func (e *WorkspaceTransition) Scan(src interface{}) error
func (WorkspaceTransition) Valid ¶
func (e WorkspaceTransition) 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
|
|
Package gentest contains tests that are run at db generate time.
|
Package gentest contains tests that are run at db generate time. |
psmock
package psmock contains a mocked implementation of the pubsub.Pubsub interface for use in tests
|
package psmock contains a mocked implementation of the pubsub.Pubsub interface for use in tests |