queries

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgType

type AlgType string
const (
	AlgTypeRS256  AlgType = "RS256"
	AlgTypeRS512  AlgType = "RS512"
	AlgTypeES256  AlgType = "ES256"
	AlgTypeES256K AlgType = "ES256K"
	AlgTypeEdDSA  AlgType = "EdDSA"
)

func (*AlgType) Scan

func (e *AlgType) Scan(src interface{}) error

type Apikey

type Apikey struct {
	ID    int64                 `json:"id"`
	Sec   []byte                `json:"sec"`
	Key   []byte                `json:"key"`
	Sub   sql.NullString        `json:"sub"`
	Alg   NullAlgType           `json:"alg"`
	Exp   sql.NullTime          `json:"exp"`
	Name  sql.NullString        `json:"name"`
	Extra pqtype.NullRawMessage `json:"extra"`
}

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
}

type GetApiKeyForVerifyRow

type GetApiKeyForVerifyRow struct {
	ID    int64                 `json:"id"`
	Sec   []byte                `json:"sec"`
	Key   []byte                `json:"key"`
	Sub   sql.NullString        `json:"sub"`
	Alg   NullAlgType           `json:"alg"`
	Extra pqtype.NullRawMessage `json:"extra"`
}

type InsertApiKeyParams

type InsertApiKeyParams struct {
	Sec   []byte                `json:"sec"`
	Key   []byte                `json:"key"`
	Sub   sql.NullString        `json:"sub"`
	Alg   NullAlgType           `json:"alg"`
	Exp   sql.NullTime          `json:"exp"`
	Name  sql.NullString        `json:"name"`
	Extra pqtype.NullRawMessage `json:"extra"`
}

type NullAlgType

type NullAlgType struct {
	AlgType AlgType `json:"alg_type"`
	Valid   bool    `json:"valid"` // Valid is true if AlgType is not NULL
}

func (*NullAlgType) Scan

func (ns *NullAlgType) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullAlgType) Value

func (ns NullAlgType) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) GetApiKey

func (q *Queries) GetApiKey(ctx context.Context, db DBTX, id int64) (Apikey, error)

func (*Queries) GetApiKeyForVerify

func (q *Queries) GetApiKeyForVerify(ctx context.Context, db DBTX, id int64) (GetApiKeyForVerifyRow, error)

func (*Queries) InsertApiKey

func (q *Queries) InsertApiKey(ctx context.Context, db DBTX, arg InsertApiKeyParams) (int64, error)

func (*Queries) SearchApiKeys

func (q *Queries) SearchApiKeys(ctx context.Context, db DBTX, sub sql.NullString) ([]SearchApiKeysRow, error)

type SearchApiKeysRow added in v0.1.4

type SearchApiKeysRow struct {
	ID   int64          `json:"id"`
	Sec  []byte         `json:"sec"`
	Key  []byte         `json:"key"`
	Sub  sql.NullString `json:"sub"`
	Alg  NullAlgType    `json:"alg"`
	Exp  sql.NullTime   `json:"exp"`
	Name sql.NullString `json:"name"`
}

Jump to

Keyboard shortcuts

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