vote

package
v0.0.0-...-e5ce005 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckIntegrity

func CheckIntegrity(cb func(v Vote))

func Status

func Status() map[string]int

Types

type Vote

type Vote struct {
	Index         int64               `json:"index" gorm:"primaryKey"`
	Timestamp     int64               `json:"timestamp"`
	PrevHash      string              `json:"prev_hash"`
	Hash          string              `json:"hash"`
	VoterAddress  string              `json:"voter_address"`
	Voter         voter.Voter         `json:"voter" gorm:"foreignKey:voter_address"`
	CandidateCode string              `json:"candidate_code"`
	Candidate     candidate.Candidate `json:"candidate" gorm:"foreignKey:candidate_code"`
	Year          int                 `json:"year"`
}

func New

func New(pvkStr, candidateCode, sk string) (*Vote, error)

Jump to

Keyboard shortcuts

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