sqlite

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT, Apache-2.0, MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MTUndefined types.MsgType = ""

Variables

This section is empty.

Functions

func MustParseAddress added in v1.11.0

func MustParseAddress(addr string) address.Address

func NewDB added in v1.11.0

func NewDB(cfg *config.DBConfig) (*gorm.DB, error)

func NewKeyStore

func NewKeyStore(db *gorm.DB) storage.KeyStore

func NewSqliteRecorder added in v1.11.0

func NewSqliteRecorder(db *gorm.DB, cfg *config.SignRecorderConfig) (storage.IRecorder, error)

Types

type Key

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

type RecorderStub added in v1.13.0

type RecorderStub struct {
}

func (*RecorderStub) QueryRecord added in v1.13.0

func (r *RecorderStub) QueryRecord(params *storage.QueryParams) ([]storage.SignRecord, error)

func (*RecorderStub) Record added in v1.13.0

func (r *RecorderStub) Record(record *storage.SignRecord) error

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 SqliteRecorder added in v1.11.0

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

func (*SqliteRecorder) QueryRecord added in v1.11.0

func (s *SqliteRecorder) QueryRecord(params *storage.QueryParams) ([]storage.SignRecord, error)

func (*SqliteRecorder) Record added in v1.11.0

func (s *SqliteRecorder) Record(record *storage.SignRecord) error

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