Documentation
¶
Index ¶
Constants ¶
const ( Trace uint8 = iota Debug Info Warn Silent )
Levels for implementing the debug and trace message functionality.
const ( MethodGet = "Get" MethodPut = "Put" MethodError = "Error" MethodSnapshot = "Snapshot" MethodTerm = "Terminate" )
Method constants
Variables ¶
This section is empty.
Functions ¶
func LogLevel ¶
func LogLevel() string
LogLevel returns a string representation of the current level
func SetLogLevel ¶
func SetLogLevel(level uint8)
SetLogLevel modifies the log level for messages at runtime. Ensures that the highest level that can be set is the silent level.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client connects to the a replica and makes requests.
type Leader ¶
type Leader struct {
Replica
}
Leader defines a server that can respond to both Get and Put requests and publishes state to all replica subscribers.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message represents a message that can be read off the wire.
func RecvMessage ¶
RecvMessage off the socket, serializing correctly. If route is true, then the message is read with the identity, otherwise it is treated as a subscription message.
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
Network defines all sockets for the local process.
type Replica ¶
type Replica struct {
PID uint16 `json:"pid"` // the precedence id of the peer
Name string `json:"name"` // unique name of the peer
Addr string `json:"address"` // the network address of the peer
Host string `json:"host"` // the hostname of the peer
IPAddr string `json:"ipaddr"` // the ip address of the peer
Updates uint16 `json:"updates"` // the port the replica publishes updates on
Snapshots uint16 `json:"snapshots"` // the port the replica fetches snapshots on
Requests uint16 `json:"requests"` // the port the replica handles requests on
// contains filtered or unexported fields
}
Replica defines a peer on the network that can respond to Get requests and synchronizes state by subscribing to the leader.