serviceaccountsql

package
v0.0.0-...-f8970bf Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateAPIKeyParams

type CreateAPIKeyParams struct {
	ApiKey           string
	ServiceAccountID uuid.UUID
}

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 Querier

type Querier interface {
	Create(ctx context.Context, name string) (*ServiceAccount, error)
	CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) error
	Delete(ctx context.Context, id uuid.UUID) error
	GetByApiKey(ctx context.Context, apiKey string) (*ServiceAccount, error)
	GetByIDs(ctx context.Context, ids []uuid.UUID) ([]*ServiceAccount, error)
	GetByName(ctx context.Context, name string) (*ServiceAccount, error)
	List(ctx context.Context) ([]*ServiceAccount, error)
	RemoveApiKeysFromServiceAccount(ctx context.Context, serviceAccountID uuid.UUID) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) Create

func (q *Queries) Create(ctx context.Context, name string) (*ServiceAccount, error)

func (*Queries) CreateAPIKey

func (q *Queries) CreateAPIKey(ctx context.Context, arg CreateAPIKeyParams) error

func (*Queries) Delete

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

func (*Queries) GetByApiKey

func (q *Queries) GetByApiKey(ctx context.Context, apiKey string) (*ServiceAccount, error)

func (*Queries) GetByIDs

func (q *Queries) GetByIDs(ctx context.Context, ids []uuid.UUID) ([]*ServiceAccount, error)

func (*Queries) GetByName

func (q *Queries) GetByName(ctx context.Context, name string) (*ServiceAccount, error)

func (*Queries) List

func (q *Queries) List(ctx context.Context) ([]*ServiceAccount, error)

func (*Queries) RemoveApiKeysFromServiceAccount

func (q *Queries) RemoveApiKeysFromServiceAccount(ctx context.Context, serviceAccountID uuid.UUID) error

func (*Queries) WithTx

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

type ServiceAccount

type ServiceAccount struct {
	ID   uuid.UUID
	Name string
}

Jump to

Keyboard shortcuts

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