Documentation ¶
Index ¶
- Constants
- type Block
- type BlockData
- type Chain
- func (t Chain) AddBlock(id string, addData map[string]interface{}, modifyData map[string]interface{}, ...) (ChainMaker, error)
- func (t Chain) Delete(id string) error
- func (t Chain) GetBlocks() []Block
- func (t Chain) GetHashString() string
- func (t Chain) Load(id string) (ChainMaker, error)
- func (t Chain) New(id string, data map[string]interface{}) (ChainMaker, error)
- func (t Chain) SetStore(store kekstore.Storer) Chain
- type ChainMaker
- type Signature
Constants ¶
View Source
const KEK_PATH = "k/"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct { PrevHash string `json:"prev_hash"` Index int `json:"index"` Kekspace interface{} `json:"space"` Timestamp int64 `json:"timestamp"` Data BlockData `json:"data"` Hash string `json:"hash"` Signature Signature `json:"signature"` }
func (Block) HashString ¶
func (Block) ValidateHash ¶
type Chain ¶
type Chain struct { Blocks []Block `json:"blocks"` CurHash string `json:"current_hash"` Index int `json:"index"` // contains filtered or unexported fields }
func (Chain) GetHashString ¶
type ChainMaker ¶
type ChainMaker interface { New(itemId string, data map[string]interface{}) (ChainMaker, error) GetHashString() string AddBlock(itemId string, addData map[string]interface{}, modifyData map[string]interface{}, deleteData map[string]interface{}) (ChainMaker, error) Load(path string) (ChainMaker, error) Delete(id string) error GetBlocks() []Block }
Click to show internal directories.
Click to hide internal directories.