sqlite

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2023 License: MIT, Apache-2.0, MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyStore

func NewKeyStore(conn *Conn) storage.KeyStore

Types

type Conn

type Conn struct {
	DB *gorm.DB
}

for sqlite use a single file socket

func NewSQLiteConn

func NewSQLiteConn(cfg *config.DBConfig) (*Conn, error)

type Key

type Key struct {
	types.KeyInfo
	PublicKey []byte
	Address   address.Address
}

type SqlKeyInfo

type SqlKeyInfo types.KeyInfo

func (*SqlKeyInfo) IsValid

func (mki *SqlKeyInfo) IsValid() bool

func (*SqlKeyInfo) Scan

func (mki *SqlKeyInfo) Scan(value interface{}) error

Scan scan value into Jsonb, implements sql.Scanner interface

func (SqlKeyInfo) Value

func (mki SqlKeyInfo) Value() (driver.Value, error)

Value return json value, implement driver.Valuer interface

type TableName

type TableName = string
const (
	TBWallet TableName = "wallets"
)

type Wallet

type Wallet struct {
	gorm.Model
	Address string      `gorm:"type:varchar(255);uniqueIndex"`
	KeyInfo *SqlKeyInfo `gorm:"type:blob;column:private_key;not null"`
}

func (*Wallet) TableName

func (w *Wallet) TableName() string

Jump to

Keyboard shortcuts

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