Documentation
¶
Index ¶
- type APIKeyLookupRow
- type ActingHandoffParams
- type AddMemberParams
- type CreateAPIKeyParams
- type CreateAPIKeyRow
- type CreateActingSessionParams
- type CreateEmailTokenParams
- type CreateInvitedUserParams
- type CreateSessionParams
- type DBTX
- type DistributionUsageSinceParams
- type EmailTokenLookupParams
- type EmailTokenLookupRow
- type GetAPIKeyRow
- type GetTenantRow
- type GetUserAccountRow
- type GetUserRow
- type InsertSupportVisitParams
- type InviteLookupRow
- type ListAPIKeysParams
- type ListAPIKeysRow
- type ListInvitesParams
- type ListInvitesRow
- type ListMembersParams
- type ListMembersRow
- type ListMySessionsRow
- type LoginLookupRow
- type MyTenantsRow
- type NoticeExpiringKeysRow
- type Queries
- func (q *Queries) APIKeyLookup(ctx context.Context, keyHash []byte) (APIKeyLookupRow, error)
- func (q *Queries) APIKeyUsed(ctx context.Context, id pgtype.UUID) error
- func (q *Queries) ActingHandoff(ctx context.Context, arg ActingHandoffParams) (pgtype.Timestamptz, error)
- func (q *Queries) AddMember(ctx context.Context, arg AddMemberParams) error
- func (q *Queries) CountAPIKeys(ctx context.Context, pattern string) (int64, error)
- func (q *Queries) CountInvites(ctx context.Context, pattern string) (int64, error)
- func (q *Queries) CountMembers(ctx context.Context, pattern string) (int64, error)
- func (q *Queries) CountOwners(ctx context.Context) (int64, error)
- func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) (CreateAPIKeyRow, error)
- func (q *Queries) CreateActingSession(ctx context.Context, arg CreateActingSessionParams) error
- func (q *Queries) CreateEmailToken(ctx context.Context, arg CreateEmailTokenParams) error
- func (q *Queries) CreateInvitedUser(ctx context.Context, arg CreateInvitedUserParams) (pgtype.UUID, error)
- func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) error
- func (q *Queries) CreateTenant(ctx context.Context, name string) error
- func (q *Queries) DeleteAPIKey(ctx context.Context, id pgtype.UUID) (int64, error)
- func (q *Queries) DeleteAllSessions(ctx context.Context) error
- func (q *Queries) DeleteEmailTokens(ctx context.Context, purpose string) error
- func (q *Queries) DeleteInvite(ctx context.Context, id pgtype.UUID) (int64, error)
- func (q *Queries) DeleteMemberSessions(ctx context.Context, userID pgtype.UUID) error
- func (q *Queries) DeleteOtherSessions(ctx context.Context, keep []byte) (int64, error)
- func (q *Queries) DeleteSession(ctx context.Context, tokenHash []byte) error
- func (q *Queries) DistributionUsageSince(ctx context.Context, arg DistributionUsageSinceParams) (float64, error)
- func (q *Queries) EmailTokenLookup(ctx context.Context, arg EmailTokenLookupParams) (EmailTokenLookupRow, error)
- func (q *Queries) EncodedMinutesThisMonth(ctx context.Context) (float64, error)
- func (q *Queries) GetAPIKey(ctx context.Context, id pgtype.UUID) (GetAPIKeyRow, error)
- func (q *Queries) GetLimits(ctx context.Context) ([]byte, error)
- func (q *Queries) GetTenant(ctx context.Context) (GetTenantRow, error)
- func (q *Queries) GetUser(ctx context.Context, id pgtype.UUID) (GetUserRow, error)
- func (q *Queries) GetUserAccount(ctx context.Context) (GetUserAccountRow, error)
- func (q *Queries) GetUserPasswordHash(ctx context.Context) (string, error)
- func (q *Queries) InsertSupportVisit(ctx context.Context, arg InsertSupportVisitParams) error
- func (q *Queries) InviteLookup(ctx context.Context, tokenHash []byte) (InviteLookupRow, error)
- func (q *Queries) IsMemberEmail(ctx context.Context, email string) (bool, error)
- func (q *Queries) ListAPIKeys(ctx context.Context, arg ListAPIKeysParams) ([]ListAPIKeysRow, error)
- func (q *Queries) ListInvites(ctx context.Context, arg ListInvitesParams) ([]ListInvitesRow, error)
- func (q *Queries) ListMembers(ctx context.Context, arg ListMembersParams) ([]ListMembersRow, error)
- func (q *Queries) ListMySessions(ctx context.Context) ([]ListMySessionsRow, error)
- func (q *Queries) LoginBlocked(ctx context.Context, email string) (bool, error)
- func (q *Queries) LoginFailed(ctx context.Context, email string) error
- func (q *Queries) LoginLookup(ctx context.Context, email string) (LoginLookupRow, error)
- func (q *Queries) LoginSucceeded(ctx context.Context, email string) error
- func (q *Queries) MarkEmailVerified(ctx context.Context, email string) (int64, error)
- func (q *Queries) MemberRole(ctx context.Context, userID pgtype.UUID) (string, error)
- func (q *Queries) MyTenants(ctx context.Context) ([]MyTenantsRow, error)
- func (q *Queries) NoticeExpiringKeys(ctx context.Context) ([]NoticeExpiringKeysRow, error)
- func (q *Queries) RecentEmailToken(ctx context.Context, purpose string) (bool, error)
- func (q *Queries) RecentSupportVisits(ctx context.Context) ([]RecentSupportVisitsRow, error)
- func (q *Queries) RecordUsage(ctx context.Context, arg RecordUsageParams) error
- func (q *Queries) RemoveMember(ctx context.Context, userID pgtype.UUID) (int64, error)
- func (q *Queries) RenameTenant(ctx context.Context, name string) error
- func (q *Queries) RetentionCore(ctx context.Context) ([]RetentionCoreRow, error)
- func (q *Queries) SessionLookup(ctx context.Context, tokenHash []byte) (SessionLookupRow, error)
- func (q *Queries) SessionSeen(ctx context.Context, tokenHash []byte) error
- func (q *Queries) SetMemberRole(ctx context.Context, arg SetMemberRoleParams) (int64, error)
- func (q *Queries) SetUserEmail(ctx context.Context, email string) error
- func (q *Queries) Signup(ctx context.Context, arg SignupParams) (SignupRow, error)
- func (q *Queries) SwitchSessionTenant(ctx context.Context, arg SwitchSessionTenantParams) (int64, error)
- func (q *Queries) UpdateUserContact(ctx context.Context, arg UpdateUserContactParams) error
- func (q *Queries) UpdateUserName(ctx context.Context, name string) error
- func (q *Queries) UpdateUserPassword(ctx context.Context, passwordHash string) error
- func (q *Queries) UpsertInvite(ctx context.Context, arg UpsertInviteParams) (UpsertInviteRow, error)
- func (q *Queries) UsageByRegion(ctx context.Context, arg UsageByRegionParams) ([]UsageByRegionRow, error)
- func (q *Queries) UsageDaily(ctx context.Context, arg UsageDailyParams) ([]UsageDailyRow, error)
- func (q *Queries) UsageTotals(ctx context.Context, arg UsageTotalsParams) ([]UsageTotalsRow, error)
- func (q *Queries) UserIDByEmail(ctx context.Context, email string) (pgtype.UUID, error)
- func (q *Queries) UserSignedIn(ctx context.Context, userID pgtype.UUID) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type RecentSupportVisitsRow
- type RecordUsageParams
- type RetentionCoreRow
- type SessionLookupRow
- type SetMemberRoleParams
- type SignupParams
- type SignupRow
- type SwitchSessionTenantParams
- type UpdateUserContactParams
- type UpsertInviteParams
- type UpsertInviteRow
- type UsageByRegionParams
- type UsageByRegionRow
- type UsageDailyParams
- type UsageDailyRow
- type UsageTotalsParams
- type UsageTotalsRow
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIKeyLookupRow ¶
type ActingHandoffParams ¶
type AddMemberParams ¶
type CreateAPIKeyParams ¶
type CreateAPIKeyRow ¶
type CreateAPIKeyRow struct {
ID pgtype.UUID `json:"id"`
Name string `json:"name"`
Prefix string `json:"prefix"`
Scopes []string `json:"scopes"`
AllowedIps []netip.Prefix `json:"allowed_ips"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type CreateActingSessionParams ¶
type CreateActingSessionParams struct {
TokenHash []byte `json:"token_hash"`
UserID pgtype.UUID `json:"user_id"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
CreatedIp *netip.Addr `json:"created_ip"`
UserAgent string `json:"user_agent"`
AdminID pgtype.UUID `json:"admin_id"`
AdminName pgtype.Text `json:"admin_name"`
}
type CreateEmailTokenParams ¶
type CreateEmailTokenParams struct {
TokenHash []byte `json:"token_hash"`
Purpose string `json:"purpose"`
Email string `json:"email"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}
type CreateInvitedUserParams ¶
type CreateSessionParams ¶
type DistributionUsageSinceParams ¶
type DistributionUsageSinceParams struct {
Meter string `json:"meter"`
DistributionPrefix string `json:"distribution_prefix"`
Since pgtype.Timestamptz `json:"since"`
}
type EmailTokenLookupParams ¶
type EmailTokenLookupRow ¶
type GetAPIKeyRow ¶
type GetAPIKeyRow struct {
ID pgtype.UUID `json:"id"`
Name string `json:"name"`
Prefix string `json:"prefix"`
Scopes []string `json:"scopes"`
AllowedIps []netip.Prefix `json:"allowed_ips"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type GetTenantRow ¶
type GetTenantRow struct {
ID pgtype.UUID `json:"id"`
Name string `json:"name"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type GetUserAccountRow ¶
type GetUserAccountRow struct {
ID pgtype.UUID `json:"id"`
Email string `json:"email"`
Name pgtype.Text `json:"name"`
Phone pgtype.Text `json:"phone"`
Locale string `json:"locale"`
Timezone pgtype.Text `json:"timezone"`
EmailVerifiedAt pgtype.Timestamptz `json:"email_verified_at"`
LastLoginAt pgtype.Timestamptz `json:"last_login_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type GetUserRow ¶
type InviteLookupRow ¶
type ListAPIKeysParams ¶
type ListAPIKeysRow ¶
type ListAPIKeysRow struct {
ID pgtype.UUID `json:"id"`
Name string `json:"name"`
Prefix string `json:"prefix"`
Scopes []string `json:"scopes"`
AllowedIps []netip.Prefix `json:"allowed_ips"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
LastUsedAt pgtype.Timestamptz `json:"last_used_at"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
}
type ListInvitesParams ¶
type ListInvitesRow ¶
type ListInvitesRow struct {
ID pgtype.UUID `json:"id"`
Email string `json:"email"`
Role string `json:"role"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}
type ListMembersParams ¶
type ListMembersRow ¶
type ListMySessionsRow ¶
type ListMySessionsRow struct {
TokenHash []byte `json:"token_hash"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
LastSeenAt pgtype.Timestamptz `json:"last_seen_at"`
Ip string `json:"ip"`
UserAgent string `json:"user_agent"`
ActingAdminName string `json:"acting_admin_name"`
}
type LoginLookupRow ¶
type MyTenantsRow ¶
type MyTenantsRow struct {
ID pgtype.UUID `json:"id"`
Name string `json:"name"`
Role string `json:"role"`
SuspendedAt pgtype.Timestamptz `json:"suspended_at"`
JoinedAt pgtype.Timestamptz `json:"joined_at"`
}
type NoticeExpiringKeysRow ¶
type NoticeExpiringKeysRow struct {
ID pgtype.UUID `json:"id"`
Name string `json:"name"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) APIKeyLookup ¶
func (*Queries) APIKeyUsed ¶
func (*Queries) ActingHandoff ¶
func (q *Queries) ActingHandoff(ctx context.Context, arg ActingHandoffParams) (pgtype.Timestamptz, error)
Trades a support session's one-time code for a new token, once; no row when the code is unknown, used or older than two minutes.
func (*Queries) AddMember ¶
func (q *Queries) AddMember(ctx context.Context, arg AddMemberParams) error
func (*Queries) CountAPIKeys ¶
func (*Queries) CountInvites ¶
func (*Queries) CountMembers ¶
func (*Queries) CreateAPIKey ¶
func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) (CreateAPIKeyRow, error)
func (*Queries) CreateActingSession ¶
func (q *Queries) CreateActingSession(ctx context.Context, arg CreateActingSessionParams) error
A session an Ulka admin uses as the person, with the visit the workspace sees, in the tenant's scope.
func (*Queries) CreateEmailToken ¶
func (q *Queries) CreateEmailToken(ctx context.Context, arg CreateEmailTokenParams) error
func (*Queries) CreateInvitedUser ¶
func (*Queries) CreateSession ¶
func (q *Queries) CreateSession(ctx context.Context, arg CreateSessionParams) error
func (*Queries) CreateTenant ¶
func (*Queries) DeleteAPIKey ¶
func (*Queries) DeleteEmailTokens ¶
func (*Queries) DeleteInvite ¶
func (*Queries) DeleteMemberSessions ¶
func (*Queries) DeleteOtherSessions ¶
func (*Queries) DeleteSession ¶
func (*Queries) DistributionUsageSince ¶
func (q *Queries) DistributionUsageSince(ctx context.Context, arg DistributionUsageSinceParams) (float64, error)
A distribution's traffic since a time, from the CDN meters (keyed distribution|host|country|hour).
func (*Queries) EmailTokenLookup ¶
func (q *Queries) EmailTokenLookup(ctx context.Context, arg EmailTokenLookupParams) (EmailTokenLookupRow, error)
func (*Queries) EncodedMinutesThisMonth ¶
func (*Queries) GetAPIKey ¶
Searches the name and prefix. Newest first, continuing after the (after_at, after_id) row.
func (*Queries) GetUserAccount ¶
func (q *Queries) GetUserAccount(ctx context.Context) (GetUserAccountRow, error)
func (*Queries) GetUserPasswordHash ¶
func (*Queries) InsertSupportVisit ¶
func (q *Queries) InsertSupportVisit(ctx context.Context, arg InsertSupportVisitParams) error
func (*Queries) InviteLookup ¶
func (*Queries) IsMemberEmail ¶
func (*Queries) ListAPIKeys ¶
func (q *Queries) ListAPIKeys(ctx context.Context, arg ListAPIKeysParams) ([]ListAPIKeysRow, error)
func (*Queries) ListInvites ¶
func (q *Queries) ListInvites(ctx context.Context, arg ListInvitesParams) ([]ListInvitesRow, error)
Searches the email. Newest first, continuing after the (after_at, after_id) row.
func (*Queries) ListMembers ¶
func (q *Queries) ListMembers(ctx context.Context, arg ListMembersParams) ([]ListMembersRow, error)
Searches the email and name. Newest first, continuing after the (after_at, after_id) row.
func (*Queries) ListMySessions ¶
func (q *Queries) ListMySessions(ctx context.Context) ([]ListMySessionsRow, error)
Where the caller is signed in, most recently used first.
func (*Queries) LoginBlocked ¶
func (*Queries) LoginFailed ¶
func (*Queries) LoginLookup ¶
func (*Queries) LoginSucceeded ¶
func (*Queries) MarkEmailVerified ¶
func (*Queries) MemberRole ¶
func (*Queries) MyTenants ¶
func (q *Queries) MyTenants(ctx context.Context) ([]MyTenantsRow, error)
func (*Queries) NoticeExpiringKeys ¶
func (q *Queries) NoticeExpiringKeys(ctx context.Context) ([]NoticeExpiringKeysRow, error)
func (*Queries) RecentEmailToken ¶
func (*Queries) RecentSupportVisits ¶
func (q *Queries) RecentSupportVisits(ctx context.Context) ([]RecentSupportVisitsRow, error)
Visits in the last 7 days, newest first, with the person used.
func (*Queries) RecordUsage ¶
func (q *Queries) RecordUsage(ctx context.Context, arg RecordUsageParams) error
func (*Queries) RemoveMember ¶
func (*Queries) RenameTenant ¶
func (*Queries) RetentionCore ¶
func (q *Queries) RetentionCore(ctx context.Context) ([]RetentionCoreRow, error)
func (*Queries) SessionLookup ¶
func (*Queries) SessionSeen ¶
func (*Queries) SetMemberRole ¶
func (*Queries) SetUserEmail ¶
func (*Queries) Signup ¶
RLS applies the tenant filter from app.tenant_id. Tables a user also sees across tenants (tenants, tenant_members, users, sessions) need an explicit filter: with app.user_id set, RLS alone returns more than one tenant's rows.
func (*Queries) SwitchSessionTenant ¶
func (*Queries) UpdateUserContact ¶
func (q *Queries) UpdateUserContact(ctx context.Context, arg UpdateUserContactParams) error
func (*Queries) UpdateUserName ¶
func (*Queries) UpdateUserPassword ¶
func (*Queries) UpsertInvite ¶
func (q *Queries) UpsertInvite(ctx context.Context, arg UpsertInviteParams) (UpsertInviteRow, error)
func (*Queries) UsageByRegion ¶
func (q *Queries) UsageByRegion(ctx context.Context, arg UsageByRegionParams) ([]UsageByRegionRow, error)
func (*Queries) UsageDaily ¶
func (q *Queries) UsageDaily(ctx context.Context, arg UsageDailyParams) ([]UsageDailyRow, error)
func (*Queries) UsageTotals ¶
func (q *Queries) UsageTotals(ctx context.Context, arg UsageTotalsParams) ([]UsageTotalsRow, error)
func (*Queries) UserIDByEmail ¶
func (*Queries) UserSignedIn ¶
type RecentSupportVisitsRow ¶
type RecentSupportVisitsRow struct {
ID pgtype.UUID `json:"id"`
AdminName string `json:"admin_name"`
Reason string `json:"reason"`
StartedAt pgtype.Timestamptz `json:"started_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
Email string `json:"email"`
UserName string `json:"user_name"`
}
type RecordUsageParams ¶
type RetentionCoreRow ¶
type SessionLookupRow ¶
type SetMemberRoleParams ¶
type SignupParams ¶
type UpdateUserContactParams ¶
type UpsertInviteParams ¶
type UpsertInviteRow ¶
type UpsertInviteRow struct {
ID pgtype.UUID `json:"id"`
Email string `json:"email"`
Role string `json:"role"`
CreatedAt pgtype.Timestamptz `json:"created_at"`
ExpiresAt pgtype.Timestamptz `json:"expires_at"`
}
type UsageByRegionParams ¶
type UsageByRegionParams struct {
Since pgtype.Timestamptz `json:"since"`
Until pgtype.Timestamptz `json:"until"`
}
type UsageByRegionRow ¶
type UsageDailyParams ¶
type UsageDailyParams struct {
Since pgtype.Timestamptz `json:"since"`
Until pgtype.Timestamptz `json:"until"`
}
type UsageDailyRow ¶
type UsageTotalsParams ¶
type UsageTotalsParams struct {
Since pgtype.Timestamptz `json:"since"`
Until pgtype.Timestamptz `json:"until"`
}