core

package
v0.0.0-...-83bd8d4 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2017 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitChamber

func InitChamber(ip, serverPort, httpPort string)

func InitPriest

func InitPriest(id int, nodes []NodeInfo) error

Types

type Chamber

type Chamber struct {
}

func NewChamber

func NewChamber() *Chamber

func (*Chamber) DealBallot

func (c *Chamber) DealBallot(ctx context.Context, in *pb.BeginBallot) (*pb.Voted, error)

func (*Chamber) DealPreBallot

func (c *Chamber) DealPreBallot(ctx context.Context, in *pb.NextBallot) (*pb.LastVote, error)

func (*Chamber) RecordDecree

func (c *Chamber) RecordDecree(ctx context.Context, in *pb.Success) (*pb.Empty, error)

func (*Chamber) Synchronize

func (c *Chamber) Synchronize(ctx context.Context, in *pb.Leger) (*pb.Leger, error)

type Leger

type Leger struct {
	Items []LegerItem
}

type LegerItem

type LegerItem struct {
	Id     uint32
	Decree string
	Priest uint32
}

type Messenger

type Messenger struct {
	Destination []NodeInfo
}

type NodeInfo

type NodeInfo struct {
	Id         int
	Ip         string
	ClientPort string
	ServerPort string
	HttpPort   string
}

func NewNodeInfo

func NewNodeInfo(id int, ip, clientPort, serverPort, httpPort string) NodeInfo

type Note

type Note struct {
	Id     uint32
	Decree string
	Priest int
}

type Priest

type Priest struct {
	Id        uint32
	Leger     *Leger
	Notes     []Note
	Messenger *Messenger
}

Jump to

Keyboard shortcuts

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