primitives

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 4 more Imports: 10 Imported by: 35

Documentation

Index

Constants

View Source
const (
	NumberOfMinutes int = 10
)

Variables

This section is empty.

Functions

func BytesToUint32

func BytesToUint32(data []byte) (ret uint32, err error)

func Uint32ToBytes

func Uint32ToBytes(val uint32) []byte

Types

type AuthSet

type AuthSet struct {
	IdentityList []Identity
	StatusArray  []int
	IdentityMap  map[Identity]int

	PriorityMap           map[Identity]int
	PriorityToIdentityMap map[int]Identity
}

func NewAuthSet

func NewAuthSet() *AuthSet

func (*AuthSet) Add

func (a *AuthSet) Add(id Identity, status int) int

func (*AuthSet) AddHash

func (a *AuthSet) AddHash(id interfaces.IHash, status int) int

func (AuthSet) Copy

func (a AuthSet) Copy() AuthSet

func (*AuthSet) FedIDtoIndex

func (a *AuthSet) FedIDtoIndex(id Identity) int

func (*AuthSet) GetAuds

func (a *AuthSet) GetAuds() []Identity

func (*AuthSet) GetFeds

func (a *AuthSet) GetFeds() []Identity

func (*AuthSet) GetVolunteerPriority

func (a *AuthSet) GetVolunteerPriority(vol Identity) int

func (*AuthSet) Hash

func (a *AuthSet) Hash() Hash

func (*AuthSet) IsLeader

func (a *AuthSet) IsLeader(id Identity) bool

func (*AuthSet) Majority

func (a *AuthSet) Majority() int

func (*AuthSet) New

func (a *AuthSet) New()

func (*AuthSet) ReadString

func (r *AuthSet) ReadString(s string)

func (*AuthSet) Sort

func (a *AuthSet) Sort()

func (*AuthSet) String

func (r *AuthSet) String() string

func (*AuthSet) VMForIdentity

func (a *AuthSet) VMForIdentity(id Identity, location MinuteLocation) int

type AuthorityStatus

type AuthorityStatus int

--------------------------------------------------------------------------------------------------------------------

func (*AuthorityStatus) MarshalJSON

func (i *AuthorityStatus) MarshalJSON() (rval []byte, err error)

func (*AuthorityStatus) ReadString

func (a *AuthorityStatus) ReadString(s string)

func (*AuthorityStatus) String

func (s *AuthorityStatus) String() string

func (*AuthorityStatus) UnmarshalJSON

func (i *AuthorityStatus) UnmarshalJSON(data []byte) error

type Hash

type Hash [sha256.Size]byte

func (*Hash) ReadString

func (h *Hash) ReadString(s string)

func (*Hash) String

func (h *Hash) String() string

type Identity

type Identity [32]byte

func NewIdentityFromInt

func NewIdentityFromInt(u int) Identity

func (*Identity) MarshalJSON

func (i *Identity) MarshalJSON() (rval []byte, err error)

func (*Identity) ReadString

func (i *Identity) ReadString(s string)

func (*Identity) String

func (i *Identity) String() string

func (*Identity) UnmarshalJSON

func (i *Identity) UnmarshalJSON(data []byte) error

type MinuteLocation

type MinuteLocation struct {
	Minute int
	Height int
}

func (*MinuteLocation) ReadString

func (p *MinuteLocation) ReadString(s string)

func (*MinuteLocation) String

func (p *MinuteLocation) String() string

func (*MinuteLocation) Sum

func (m *MinuteLocation) Sum() int

type ProcessListLocation

type ProcessListLocation struct {
	Vm int
	MinuteLocation
}

func (*ProcessListLocation) ReadString

func (p *ProcessListLocation) ReadString(s string)

func (*ProcessListLocation) String

func (p *ProcessListLocation) String() string

Jump to

Keyboard shortcuts

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