proposal

package
v0.0.0-...-daaf58e Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SerializeToCSV

func SerializeToCSV(proposal Id) []string

Convert to array of strings for storage in CSV file

Types

type Id

type Id struct {
	RoleId   uint64
	Sequence uint64
	Chosen   bool
}

Proposal ID struct to enable uniqueness

func Chosen

func Chosen() Id

Returns a proposal ID flagged as chosen

func ConstructProposalId

func ConstructProposalId(roleId uint64, sequence uint64) Id

Creates a proposal ID from a role and sequence number

func Default

func Default() Id

Returns the default proposal ID; will be outranked by every other proposal ID

func DeserializeFromCSV

func DeserializeFromCSV(record []string) (Id, error)

Recover proposal ID from an array of strings

func (*Id) IsChosen

func (this *Id) IsChosen() bool

Checks for chosen flag

func (*Id) IsGreaterThan

func (this *Id) IsGreaterThan(other Id) bool

Comparison operator

func (Id) String

func (this Id) String() string

Custom string formatter for ID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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