database

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddDeviceParams

type AddDeviceParams struct {
	UserId    int64
	WalletId  int64
	UserAgent string
	PeerId    string
}

type AddPeerParams added in v1.2.0

type AddPeerParams struct {
	UserAgent           string
	PeerId              string
	ForeignKey          string
	EncryptedDkgResults []byte
	Nonce               []byte
}

type AddWalletParams

type AddWalletParams struct {
	UserId              int64
	PublicAddress       string
	EncryptedDkgResults []byte
	Nonce               []byte
}

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 Device

type Device struct {
	ID        int64
	UserID    int64
	WalletID  int64
	PeerID    string
	UserAgent string
}

type DkgParams added in v1.2.0

type DkgParams struct {
	UserAgent           string
	PeerId              string
	ForeignKey          string
	PublicAddress       string
	EncryptedDkgResults []byte
	Nonce               []byte
}

type GetUserSigningParametersRow

type GetUserSigningParametersRow struct {
	ID                  sql.NullInt64
	UserID              sql.NullInt64
	PublicAddress       sql.NullString
	EncryptedDkgResults []byte
	Nonce               []byte
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddDevice

func (q *Queries) AddDevice(ctx context.Context, arg AddDeviceParams) (Device, error)

func (*Queries) AddPeer added in v1.2.0

func (q *Queries) AddPeer(ctx context.Context, arg AddPeerParams) (Device, error)

func (*Queries) AddUser

func (q *Queries) AddUser(ctx context.Context, foreignKey string) (User, error)

----- INSERTS -------

func (*Queries) AddWallet

func (q *Queries) AddWallet(ctx context.Context, arg AddWalletParams) (Wallet, error)

func (*Queries) Dkg added in v1.2.0

func (q *Queries) Dkg(ctx context.Context, arg DkgParams) (Device, error)

func (*Queries) GetFirstUser

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

----- SELECTS -------

func (*Queries) GetUserByAddress

func (q *Queries) GetUserByAddress(ctx context.Context, publicaddress string) (User, error)

func (*Queries) GetUserByForeignKey

func (q *Queries) GetUserByForeignKey(ctx context.Context, foreignkey string) (User, error)

func (*Queries) GetUserDevices

func (q *Queries) GetUserDevices(ctx context.Context, userid int64) ([]Device, error)

func (*Queries) GetUserSigningParameters

func (q *Queries) GetUserSigningParameters(ctx context.Context, foreignkey string) (GetUserSigningParametersRow, error)

func (*Queries) GetUserWallets

func (q *Queries) GetUserWallets(ctx context.Context, userid int64) ([]Wallet, error)

func (*Queries) GetWalletByAddress

func (q *Queries) GetWalletByAddress(ctx context.Context, publicaddress string) (Wallet, error)

func (*Queries) Status

func (q *Queries) Status(ctx context.Context) (interface{}, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID         int64
	ForeignKey string
}

type Wallet

type Wallet struct {
	ID                  int64
	UserID              int64
	PublicAddress       string
	EncryptedDkgResults []byte
	Nonce               []byte
}

Jump to

Keyboard shortcuts

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