data

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetFilename

func SetFilename(filename string)

SetFilename set filename

func SetLogger

func SetLogger(loggers *logrus.Entry)

SetLogger set the logger

func Start

func Start()

Start will start the db

Types

type EncryptedRawTransaction added in v1.0.2

type EncryptedRawTransaction struct {
	Hash           []byte `storm:"id"`
	EncodedPayload []byte
	Sender         []byte
	Timestamp      time.Time `storm:"index"`
}

EncryptedRawTransaction holds hash and payload

func FindEncryptedRawTransaction added in v1.0.2

func FindEncryptedRawTransaction(hash []byte) (*EncryptedRawTransaction, error)

FindEncryptedRawTransaction will find a encrypted transaction for a hash

func NewEncryptedRawTransaction added in v1.0.2

func NewEncryptedRawTransaction(encodedPayload []byte, sender []byte) *EncryptedRawTransaction

NewEncryptedRawTransaction will create a new encrypted transaction based on the provided payload

func (*EncryptedRawTransaction) Delete added in v1.0.2

func (et *EncryptedRawTransaction) Delete() error

Delete delete it on the db

func (*EncryptedRawTransaction) Save added in v1.0.2

func (et *EncryptedRawTransaction) Save() error

Save saves into db

type EncryptedTransaction added in v1.0.2

type EncryptedTransaction struct {
	Hash           []byte `storm:"id"`
	EncodedPayload []byte
	Timestamp      time.Time `storm:"index"`
}

EncryptedTransaction holds hash and payload

func CreateEncryptedTransaction

func CreateEncryptedTransaction(hash []byte, encodedPayload []byte, timestamp time.Time) *EncryptedTransaction

CreateEncryptedTransaction will encrypt the transaction

func FindEncryptedTransaction

func FindEncryptedTransaction(hash []byte) (*EncryptedTransaction, error)

FindEncryptedTransaction will find a encrypted transaction for a hash

func NewEncryptedTransaction

func NewEncryptedTransaction(encodedPayload []byte) *EncryptedTransaction

NewEncryptedTransaction will create a new encrypted transaction based on the provided payload

func (*EncryptedTransaction) Delete added in v1.0.2

func (et *EncryptedTransaction) Delete() error

Delete delete it on the db

func (*EncryptedTransaction) Save added in v1.0.2

func (et *EncryptedTransaction) Save() error

Save saves into db

type Peer

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

Peer holds url and pub for a peer

func FindPeer

func FindPeer(publicKey []byte) (*Peer, error)

FindPeer will find a peer

func NewPeer

func NewPeer(pKey []byte, nodeURL string) *Peer

NewPeer create new peer based on pk and url

func Update

func Update(pKey []byte, nodeURL string) *Peer

Update will update a peer

func (*Peer) Delete

func (p *Peer) Delete() error

Delete delete a peer on db

func (*Peer) Save

func (p *Peer) Save() error

Save save a peer into db

Jump to

Keyboard shortcuts

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