models

package
v0.0.0-...-c42f474 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	Index     int
	Timestamp time.Time
	BPM       int
	Hash      string
	PrevHash  string
}

func (*Block) CalculateHash

func (b *Block) CalculateHash() string

func (*Block) IsValid

func (b *Block) IsValid(oldBlock *Block) bool

type Blockchain

type Blockchain struct {
	Blocks []*Block
}

func (*Blockchain) Add

func (b *Blockchain) Add(block *Block)

func (*Blockchain) Dump

func (b *Blockchain) Dump()

func (*Blockchain) LastBlock

func (b *Blockchain) LastBlock() *Block

type Message

type Message struct {
	BPM int
}

Jump to

Keyboard shortcuts

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