postgres

package
v0.0.0-...-8bc3ba8 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 ExternalIdentity

type ExternalIdentity struct {
	Uid       uuid.UUID
	PublicKey []byte
}

type Identity

type Identity struct {
	Uid        uuid.UUID
	PrivateKey []byte
	PublicKey  []byte
	Signature  []byte
	AuthToken  string
	Active     bool
}

type Querier

type Querier interface {
	GetExternalIdentityUUIDs(ctx context.Context) ([]uuid.UUID, error)
	GetIdentityUUIDs(ctx context.Context) ([]uuid.UUID, error)
	LoadActiveFlag(ctx context.Context, uid uuid.UUID) (bool, error)
	LoadActiveFlagForUpdate(ctx context.Context, uid uuid.UUID) (bool, error)
	LoadAuthForUpdate(ctx context.Context, uid uuid.UUID) (string, error)
	LoadExternalIdentity(ctx context.Context, uid uuid.UUID) (ExternalIdentity, error)
	LoadIdentity(ctx context.Context, uid uuid.UUID) (Identity, error)
	LoadSignatureForUpdate(ctx context.Context, uid uuid.UUID) ([]byte, error)
	StoreActiveFlag(ctx context.Context, arg StoreActiveFlagParams) error
	StoreAuth(ctx context.Context, arg StoreAuthParams) error
	StoreExternalIdentity(ctx context.Context, arg StoreExternalIdentityParams) error
	StoreIdentity(ctx context.Context, arg StoreIdentityParams) error
	StoreSignature(ctx context.Context, arg StoreSignatureParams) error
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetExternalIdentityUUIDs

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

func (*Queries) GetIdentityUUIDs

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

func (*Queries) LoadActiveFlag

func (q *Queries) LoadActiveFlag(ctx context.Context, uid uuid.UUID) (bool, error)

func (*Queries) LoadActiveFlagForUpdate

func (q *Queries) LoadActiveFlagForUpdate(ctx context.Context, uid uuid.UUID) (bool, error)

func (*Queries) LoadAuthForUpdate

func (q *Queries) LoadAuthForUpdate(ctx context.Context, uid uuid.UUID) (string, error)

func (*Queries) LoadExternalIdentity

func (q *Queries) LoadExternalIdentity(ctx context.Context, uid uuid.UUID) (ExternalIdentity, error)

func (*Queries) LoadIdentity

func (q *Queries) LoadIdentity(ctx context.Context, uid uuid.UUID) (Identity, error)

func (*Queries) LoadSignatureForUpdate

func (q *Queries) LoadSignatureForUpdate(ctx context.Context, uid uuid.UUID) ([]byte, error)

func (*Queries) StoreActiveFlag

func (q *Queries) StoreActiveFlag(ctx context.Context, arg StoreActiveFlagParams) error

func (*Queries) StoreAuth

func (q *Queries) StoreAuth(ctx context.Context, arg StoreAuthParams) error

func (*Queries) StoreExternalIdentity

func (q *Queries) StoreExternalIdentity(ctx context.Context, arg StoreExternalIdentityParams) error

func (*Queries) StoreIdentity

func (q *Queries) StoreIdentity(ctx context.Context, arg StoreIdentityParams) error

func (*Queries) StoreSignature

func (q *Queries) StoreSignature(ctx context.Context, arg StoreSignatureParams) error

func (*Queries) WithTx

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

type StoreActiveFlagParams

type StoreActiveFlagParams struct {
	Active bool
	Uid    uuid.UUID
}

type StoreAuthParams

type StoreAuthParams struct {
	AuthToken string
	Uid       uuid.UUID
}

type StoreExternalIdentityParams

type StoreExternalIdentityParams struct {
	Uid       uuid.UUID
	PublicKey []byte
}

type StoreIdentityParams

type StoreIdentityParams struct {
	Uid        uuid.UUID
	PrivateKey []byte
	PublicKey  []byte
	Signature  []byte
	AuthToken  string
	Active     bool
}

type StoreSignatureParams

type StoreSignatureParams struct {
	Signature []byte
	Uid       uuid.UUID
}

Jump to

Keyboard shortcuts

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