Documentation
¶
Index ¶
- type ApplyProjectMemberProjectionParams
- type CopyTeamAliasesToNamespaceParams
- type CreateTeamAPIKeyParams
- type CreateTeamMembershipParams
- type DBTX
- type DeleteTeamAPIKeyParams
- type DeleteTeamMemberParams
- type GetTeamAPIKeysWithCreatorRow
- type GetTeamByAPIKeyRow
- type GetTeamByTeamAndUserParams
- type GetTeamByTeamAndUserRow
- type GetTeamByTeamIDRow
- type GetTeamsWithUsersTeamsRow
- type GetUserIdentitiesByUserIDsAndIssuersParams
- type GetUserIdentitiesByUserIDsAndIssuersRow
- type GetUserIdentityParams
- type GetUserIdentityRow
- type GetUserTeamsWithLimitsRow
- type InsertManagedTeamParams
- type InsertManagedTeamRow
- type Queries
- func (q *Queries) ApplyProjectMemberProjection(ctx context.Context, arg ApplyProjectMemberProjectionParams) (bool, error)
- func (q *Queries) CopyTeamAliasesToNamespace(ctx context.Context, arg CopyTeamAliasesToNamespaceParams) ([]string, error)
- func (q *Queries) CreateTeamAPIKey(ctx context.Context, arg CreateTeamAPIKeyParams) (TeamApiKey, error)
- func (q *Queries) CreateTeamMembership(ctx context.Context, arg CreateTeamMembershipParams) error
- func (q *Queries) DeletePublicUser(ctx context.Context, id uuid.UUID) error
- func (q *Queries) DeleteTeamAPIKey(ctx context.Context, arg DeleteTeamAPIKeyParams) ([]string, error)
- func (q *Queries) DeleteTeamMember(ctx context.Context, arg DeleteTeamMemberParams) error
- func (q *Queries) GetTeamAPIKeyHashes(ctx context.Context, teamID uuid.UUID) ([]string, error)
- func (q *Queries) GetTeamAPIKeysWithCreator(ctx context.Context, teamID uuid.UUID) ([]GetTeamAPIKeysWithCreatorRow, error)
- func (q *Queries) GetTeamByAPIKey(ctx context.Context, apiKeyHash string) (GetTeamByAPIKeyRow, error)
- func (q *Queries) GetTeamByTeamAndUser(ctx context.Context, arg GetTeamByTeamAndUserParams) (GetTeamByTeamAndUserRow, error)
- func (q *Queries) GetTeamByTeamID(ctx context.Context, id uuid.UUID) (GetTeamByTeamIDRow, error)
- func (q *Queries) GetTeamMemberIDs(ctx context.Context, teamID uuid.UUID) ([]uuid.UUID, error)
- func (q *Queries) GetTeamsWithUsersTeams(ctx context.Context, userID uuid.UUID) ([]GetTeamsWithUsersTeamsRow, error)
- func (q *Queries) GetUserIdentitiesByUserIDsAndIssuers(ctx context.Context, arg GetUserIdentitiesByUserIDsAndIssuersParams) ([]GetUserIdentitiesByUserIDsAndIssuersRow, error)
- func (q *Queries) GetUserIdentity(ctx context.Context, arg GetUserIdentityParams) (GetUserIdentityRow, error)
- func (q *Queries) GetUserTeamsWithLimits(ctx context.Context, userID uuid.UUID) ([]GetUserTeamsWithLimitsRow, error)
- func (q *Queries) InsertManagedTeam(ctx context.Context, arg InsertManagedTeamParams) (InsertManagedTeamRow, error)
- func (q *Queries) LockManagedTeam(ctx context.Context, id uuid.UUID) (string, error)
- func (q *Queries) UpdateLastTimeUsed(ctx context.Context, apiKeyHash string) error
- func (q *Queries) UpdateManagedTeam(ctx context.Context, arg UpdateManagedTeamParams) (UpdateManagedTeamRow, error)
- func (q *Queries) UpdateTeamApiKey(ctx context.Context, arg UpdateTeamApiKeyParams) (uuid.UUID, error)
- func (q *Queries) UpsertPublicIdentity(ctx context.Context, arg UpsertPublicIdentityParams) (uuid.UUID, error)
- func (q *Queries) UpsertPublicUser(ctx context.Context, id uuid.UUID) error
- func (q *Queries) UpsertTeamMember(ctx context.Context, arg UpsertTeamMemberParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type TeamApiKey
- type UpdateManagedTeamParams
- type UpdateManagedTeamRow
- type UpdateTeamApiKeyParams
- type UpsertPublicIdentityParams
- type UpsertTeamMemberParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateTeamAPIKeyParams ¶
type DeleteTeamMemberParams ¶
type GetTeamByAPIKeyRow ¶
type GetTeamByAPIKeyRow struct {
ID uuid.UUID
CreatedAt time.Time
IsBlocked bool
Name string
Email string
IsBanned bool
BlockedReason *string
ClusterID *uuid.UUID
SandboxSchedulingLabels []string
SsoOrganizationID *uuid.UUID
SsoAutoJoin bool
DeletedAt *time.Time
Slug string
SandboxDefaultAllowPublicTraffic *bool
MaxLengthHours int64
ConcurrentSandboxes int64
ConcurrentTemplateBuilds int64
MaxVcpu int64
MaxRamMb int64
DiskMb int64
EventsTtlDays int64
DefaultFreeDiskSizeMb int64
MaxDiskSizeMb int64
MaxFreeDiskSizeMb int64
ApiTeamRpsList int64
ApiTeamRpsDelete int64
MaxSecrets int64
}
type GetTeamByTeamAndUserRow ¶
type GetTeamByTeamAndUserRow struct {
ID uuid.UUID
CreatedAt time.Time
IsBlocked bool
Name string
Email string
IsBanned bool
BlockedReason *string
ClusterID *uuid.UUID
SandboxSchedulingLabels []string
SsoOrganizationID *uuid.UUID
SsoAutoJoin bool
DeletedAt *time.Time
Slug string
SandboxDefaultAllowPublicTraffic *bool
MaxLengthHours int64
ConcurrentSandboxes int64
ConcurrentTemplateBuilds int64
MaxVcpu int64
MaxRamMb int64
DiskMb int64
EventsTtlDays int64
DefaultFreeDiskSizeMb int64
MaxDiskSizeMb int64
MaxFreeDiskSizeMb int64
ApiTeamRpsList int64
ApiTeamRpsDelete int64
MaxSecrets int64
}
type GetTeamByTeamIDRow ¶
type GetTeamByTeamIDRow struct {
ID uuid.UUID
CreatedAt time.Time
IsBlocked bool
Name string
Email string
IsBanned bool
BlockedReason *string
ClusterID *uuid.UUID
SandboxSchedulingLabels []string
SsoOrganizationID *uuid.UUID
SsoAutoJoin bool
DeletedAt *time.Time
Slug string
SandboxDefaultAllowPublicTraffic *bool
MaxLengthHours int64
ConcurrentSandboxes int64
ConcurrentTemplateBuilds int64
MaxVcpu int64
MaxRamMb int64
DiskMb int64
EventsTtlDays int64
DefaultFreeDiskSizeMb int64
MaxDiskSizeMb int64
MaxFreeDiskSizeMb int64
ApiTeamRpsList int64
ApiTeamRpsDelete int64
MaxSecrets int64
}
type GetUserIdentityParams ¶
type GetUserIdentityRow ¶
type GetUserTeamsWithLimitsRow ¶
type GetUserTeamsWithLimitsRow struct {
ID uuid.UUID
CreatedAt time.Time
IsBlocked bool
Name string
Email string
IsBanned bool
BlockedReason *string
ClusterID *uuid.UUID
SandboxSchedulingLabels []string
SsoOrganizationID *uuid.UUID
SsoAutoJoin bool
DeletedAt *time.Time
Slug string
IsDefault bool
SandboxDefaultAllowPublicTraffic *bool
MaxLengthHours int64
ConcurrentSandboxes int64
ConcurrentTemplateBuilds int64
MaxVcpu int64
MaxRamMb int64
DiskMb int64
EventsTtlDays int64
DefaultFreeDiskSizeMb int64
MaxDiskSizeMb int64
MaxFreeDiskSizeMb int64
ApiTeamRpsList int64
ApiTeamRpsDelete int64
MaxSecrets int64
}
type InsertManagedTeamParams ¶
type InsertManagedTeamRow ¶
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) ApplyProjectMemberProjection ¶
func (*Queries) CopyTeamAliasesToNamespace ¶
func (q *Queries) CopyTeamAliasesToNamespace(ctx context.Context, arg CopyTeamAliasesToNamespaceParams) ([]string, error)
Follows a slug change: every alias the team holds under an earlier namespace is also given under the new one, so a template stays reachable by the new slug while the old names keep working. Aliases without a namespace are global and stay out of it. Where two earlier namespaces hold the same alias, the one under the slug being replaced wins.
Only live templates are copied, and FOR SHARE serializes against a concurrent template delete: the delete either waits and then releases the copies too, or has committed and its template is skipped.
An alias the new namespace already holds is left as it is rather than failing the reconcile, which the caller would only retry. Returns the aliases skipped because the new namespace gives them to another template; the outer select reads the table as it was before the insert.
func (*Queries) CreateTeamAPIKey ¶
func (q *Queries) CreateTeamAPIKey(ctx context.Context, arg CreateTeamAPIKeyParams) (TeamApiKey, error)
func (*Queries) CreateTeamMembership ¶
func (q *Queries) CreateTeamMembership(ctx context.Context, arg CreateTeamMembershipParams) error
func (*Queries) DeletePublicUser ¶
func (*Queries) DeleteTeamAPIKey ¶
func (*Queries) DeleteTeamMember ¶
func (q *Queries) DeleteTeamMember(ctx context.Context, arg DeleteTeamMemberParams) error
func (*Queries) GetTeamAPIKeyHashes ¶
func (*Queries) GetTeamAPIKeysWithCreator ¶
func (*Queries) GetTeamByAPIKey ¶
func (q *Queries) GetTeamByAPIKey(ctx context.Context, apiKeyHash string) (GetTeamByAPIKeyRow, error)
Each lookup resolves the team and its limits in one statement: the pushed project_limits row, else default_limits, which always holds one row. The limit columns repeat across these queries on purpose, so a new limit needs no migration recreating a view or function; TestTeamLookupsReturnEveryDefaultLimit in pkg/tests fails when a lookup misses one.
func (*Queries) GetTeamByTeamAndUser ¶
func (q *Queries) GetTeamByTeamAndUser(ctx context.Context, arg GetTeamByTeamAndUserParams) (GetTeamByTeamAndUserRow, error)
func (*Queries) GetTeamByTeamID ¶
func (*Queries) GetTeamMemberIDs ¶
GetTeamMemberIDs lists the users whose cached auth entry carries this team's data, so invalidating the team can reach all of them.
func (*Queries) GetTeamsWithUsersTeams ¶
func (*Queries) GetUserIdentitiesByUserIDsAndIssuers ¶
func (q *Queries) GetUserIdentitiesByUserIDsAndIssuers(ctx context.Context, arg GetUserIdentitiesByUserIDsAndIssuersParams) ([]GetUserIdentitiesByUserIDsAndIssuersRow, error)
func (*Queries) GetUserIdentity ¶
func (q *Queries) GetUserIdentity(ctx context.Context, arg GetUserIdentityParams) (GetUserIdentityRow, error)
func (*Queries) GetUserTeamsWithLimits ¶
func (*Queries) InsertManagedTeam ¶
func (q *Queries) InsertManagedTeam(ctx context.Context, arg InsertManagedTeamParams) (InsertManagedTeamRow, error)
DO NOTHING covers the case where the lock above found nothing and another request inserted the same id before this ran: no row means that happened. A slug collision is a different constraint and still raises.
func (*Queries) LockManagedTeam ¶
Project reconciliation for the control-plane management interface. The caller supplies the id, so create and reconcile are one request and these are its branches. Taken first, so the branch is decided by whether the project exists rather than by an insert failing. Returns the slug so a reconcile can tell whether it moves.
func (*Queries) UpdateLastTimeUsed ¶
func (*Queries) UpdateManagedTeam ¶
func (q *Queries) UpdateManagedTeam(ctx context.Context, arg UpdateManagedTeamParams) (UpdateManagedTeamRow, error)
Touches only the properties the caller synchronizes. is_blocked stays because an operator's decision must outlive a routine push.
func (*Queries) UpdateTeamApiKey ¶
func (*Queries) UpsertPublicIdentity ¶
func (*Queries) UpsertPublicUser ¶
func (*Queries) UpsertTeamMember ¶
func (q *Queries) UpsertTeamMember(ctx context.Context, arg UpsertTeamMemberParams) error
type TeamApiKey ¶
type UpdateManagedTeamParams ¶
type UpdateManagedTeamRow ¶
type UpdateTeamApiKeyParams ¶
Source Files
¶
- create_team_api_key.sql.go
- db.go
- delete_public_user.sql.go
- delete_team_api_key.sql.go
- get_api_keys.sql.go
- get_team.sql.go
- get_team_api_key_hashes.sql.go
- get_team_member_ids.sql.go
- get_user_identities_by_user_ids.sql.go
- get_user_identity.sql.go
- models.go
- project_member_projections.sql.go
- team_lifecycle.sql.go
- team_management.sql.go
- team_membership_sync.sql.go
- teams_usersteams_join.sql.go
- update_last_time_used.sql.go
- update_team_api_key.sql.go
- upsert_public_identity.sql.go
- upsert_public_user.sql.go