chaindb

package
v0.0.0-...-685a3eb Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GagentDb

type GagentDb struct {
	ChainRow []*GagentDbRow `hcl:"timestamp,block"`
}

func NewGagentDb

func NewGagentDb() *GagentDb

* Initialize the database

func (*GagentDb) AddRow

func (db *GagentDb) AddRow(row *GagentDbRow)

* Add a new row to the chaindb

func (*GagentDb) LoadHCL

func (db *GagentDb) LoadHCL(ChainDBPath string) error

* Load the database from disk

func (*GagentDb) SetCurrHash

func (db *GagentDb) SetCurrHash()

* Set current hash of the database

func (*GagentDb) SetPrevHash

func (db *GagentDb) SetPrevHash()

* Set previous hash of the database

func (*GagentDb) WriteHCL

func (db *GagentDb) WriteHCL(ChainDBPath string) error

* Write the database to an HCL file

type GagentDbRow

type GagentDbRow struct {
	Timestamp  time.Time       `hcl:"timestamp"`
	DBName     string          `hcl:"chainid,optional"`
	Agent      gs.AgentDetails `hcl:"agent,block"`
	DbCurrHash [32]byte        `hcl:"currhash"`
	DbPrevHash [32]byte        `hcl:"prevhash"`
}

Jump to

Keyboard shortcuts

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