database

package
v0.0.0-...-4744f9f Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddPasskeyParams

type AddPasskeyParams struct {
	Kthid string
	Name  string
	Data  string
}

type CreateInviteParams

type CreateInviteParams struct {
	Name      string
	ExpiresAt pgtype.Timestamp
	MaxUses   pgtype.Int4
}

type CreateUserParams

type CreateUserParams struct {
	Kthid      string
	UgKthid    string
	Email      string
	FirstName  string
	FamilyName string
	YearTag    string
	MemberTo   pgtype.Date
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Invite

type Invite struct {
	ID          uuid.UUID
	Name        string
	CreatedAt   pgtype.Timestamp
	ExpiresAt   pgtype.Timestamp
	MaxUses     pgtype.Int4
	CurrentUses int32
}

type LegacyapiToken

type LegacyapiToken struct {
	ID         uuid.UUID
	Kthid      string
	LastUsedAt pgtype.Timestamp
}

type ListUsersParams

type ListUsersParams struct {
	Limit  int32
	Offset int32
	Search string
	Year   string
}

type OidcClient

type OidcClient struct {
	ID           []byte
	RedirectUris []string
}

type Passkey

type Passkey struct {
	ID    uuid.UUID
	Name  string
	Kthid string
	Data  string
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func Connect

func Connect(ctx context.Context) (*Queries, func() *sql.DB, error)

func ConnectAndMigrate

func ConnectAndMigrate(ctx context.Context) (*Queries, error)

func New

func New(db DBTX) *Queries

func (*Queries) AddPasskey

func (q *Queries) AddPasskey(ctx context.Context, arg AddPasskeyParams) (uuid.UUID, error)

func (*Queries) Begin

func (q *Queries) Begin(ctx context.Context) (*Queries, error)

func (*Queries) Commit

func (q *Queries) Commit(ctx context.Context) error

func (*Queries) CreateClient

func (q *Queries) CreateClient(ctx context.Context, id []byte) (OidcClient, error)

func (*Queries) CreateInvite

func (q *Queries) CreateInvite(ctx context.Context, arg CreateInviteParams) (Invite, error)

func (*Queries) CreateSession

func (q *Queries) CreateSession(ctx context.Context, kthid string) (uuid.UUID, error)

func (*Queries) CreateToken

func (q *Queries) CreateToken(ctx context.Context, kthid string) (uuid.UUID, error)

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) error

func (*Queries) DeleteClient

func (q *Queries) DeleteClient(ctx context.Context, id []byte) error

func (*Queries) DeleteInvite

func (q *Queries) DeleteInvite(ctx context.Context, id uuid.UUID) error

func (*Queries) DeleteToken

func (q *Queries) DeleteToken(ctx context.Context, kthid string) error

func (*Queries) GetAllYears

func (q *Queries) GetAllYears(ctx context.Context) ([]string, error)

func (*Queries) GetClient

func (q *Queries) GetClient(ctx context.Context, id []byte) (OidcClient, error)

func (*Queries) GetInvite

func (q *Queries) GetInvite(ctx context.Context, id uuid.UUID) (Invite, error)

func (*Queries) GetSession

func (q *Queries) GetSession(ctx context.Context, id uuid.UUID) (string, error)

func (*Queries) GetToken

func (q *Queries) GetToken(ctx context.Context, id uuid.UUID) (string, error)

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, kthid string) (User, error)

func (*Queries) IncrementInviteUses

func (q *Queries) IncrementInviteUses(ctx context.Context, id uuid.UUID) error

func (*Queries) ListClients

func (q *Queries) ListClients(ctx context.Context) ([]OidcClient, error)

func (*Queries) ListInvites

func (q *Queries) ListInvites(ctx context.Context) ([]Invite, error)

func (*Queries) ListPasskeysByUser

func (q *Queries) ListPasskeysByUser(ctx context.Context, kthid string) ([]Passkey, error)

func (*Queries) ListUsers

func (q *Queries) ListUsers(ctx context.Context, arg ListUsersParams) ([]User, error)

func (*Queries) RemovePasskey

func (q *Queries) RemovePasskey(ctx context.Context, arg RemovePasskeyParams) error

func (*Queries) RemoveSession

func (q *Queries) RemoveSession(ctx context.Context, id uuid.UUID) error

func (*Queries) Rollback

func (q *Queries) Rollback(ctx context.Context) error

func (*Queries) StoreWebAuthnSessionData

func (q *Queries) StoreWebAuthnSessionData(ctx context.Context, arg StoreWebAuthnSessionDataParams) error

func (*Queries) TakeWebAuthnSessionData

func (q *Queries) TakeWebAuthnSessionData(ctx context.Context, kthid string) ([]byte, error)

func (*Queries) Tx

func (q *Queries) Tx(ctx context.Context, f func(db *Queries) error) error

func (*Queries) UpdateClient

func (q *Queries) UpdateClient(ctx context.Context, arg UpdateClientParams) (OidcClient, error)

func (*Queries) UpdateInvite

func (q *Queries) UpdateInvite(ctx context.Context, arg UpdateInviteParams) (Invite, error)

func (*Queries) UserSetMemberTo

func (q *Queries) UserSetMemberTo(ctx context.Context, arg UserSetMemberToParams) error

func (*Queries) UserSetNameChangeRequest

func (q *Queries) UserSetNameChangeRequest(ctx context.Context, arg UserSetNameChangeRequestParams) (User, error)

func (*Queries) UserSetYear

func (q *Queries) UserSetYear(ctx context.Context, arg UserSetYearParams) (User, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type RemovePasskeyParams

type RemovePasskeyParams struct {
	Kthid string
	ID    uuid.UUID
}

type Session

type Session struct {
	ID         uuid.UUID
	Kthid      string
	LastUsedAt pgtype.Timestamp
}

type StoreWebAuthnSessionDataParams

type StoreWebAuthnSessionDataParams struct {
	Kthid string
	Data  []byte
}

type UpdateClientParams

type UpdateClientParams struct {
	ID           []byte
	RedirectUris []string
}

type UpdateInviteParams

type UpdateInviteParams struct {
	ID        uuid.UUID
	Name      string
	ExpiresAt pgtype.Timestamp
	MaxUses   pgtype.Int4
}

type User

type User struct {
	Kthid                   string
	UgKthid                 string
	Email                   string
	FirstName               string
	FamilyName              string
	YearTag                 string
	MemberTo                pgtype.Date
	WebauthnID              []byte
	FirstNameChangeRequest  string
	FamilyNameChangeRequest string
}

type UserSetMemberToParams

type UserSetMemberToParams struct {
	Kthid    string
	MemberTo pgtype.Date
}

type UserSetNameChangeRequestParams

type UserSetNameChangeRequestParams struct {
	Kthid                   string
	FirstNameChangeRequest  string
	FamilyNameChangeRequest string
}

type UserSetYearParams

type UserSetYearParams struct {
	Kthid   string
	YearTag string
}

type WebauthnSessionDatum

type WebauthnSessionDatum struct {
	Kthid string
	Data  []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL