Documentation
¶
Index ¶
- Constants
- Variables
- type Connector
- type Courier
- func (e *Courier) CacheReply(reply *commands.ReplicaMessageReply)
- func (e *Courier) HandleReply(reply *commands.ReplicaMessageReply)
- func (e *Courier) OnCommand(cmd cborplugin.Command) error
- func (e *Courier) RegisterConsumer(s *cborplugin.Server)
- func (e *Courier) SetWriteFunc(writeFunc func(cborplugin.Command))
- type CourierBookKeeping
- type GenericConnector
- type PKIWorker
- func (p *PKIWorker) AuthenticateReplicaConnection(c *wire.PeerCredentials) (*pki.ReplicaDescriptor, bool)
- func (p *PKIWorker) ForceFetchPKI() error
- func (p *PKIWorker) HasCurrentPKIDocument() bool
- func (p *PKIWorker) ReplicasCopy() map[[32]byte]*pki.ReplicaDescriptor
- func (p *PKIWorker) SetDocumentForEpoch(epoch uint64, doc *pki.Document, rawDoc []byte)
- type PendingReadRequest
- type Server
Constants ¶
const KeepAliveInterval = 3 * time.Minute
const NumPKIDocsToFetch = 3
Variables ¶
var (
PublishDeadline = vServer.PublishConsensusDeadline
)
Functions ¶
This section is empty.
Types ¶
type Connector ¶
func (*Connector) CloseAllCh ¶
func (co *Connector) CloseAllCh() chan interface{}
func (*Connector) DispatchMessage ¶
func (co *Connector) DispatchMessage(dest uint8, message *commands.ReplicaMessage)
func (*Connector) ForceUpdate ¶
func (co *Connector) ForceUpdate()
func (*Connector) OnClosedConn ¶
func (co *Connector) OnClosedConn(c *outgoingConn)
type Courier ¶
type Courier struct {
// contains filtered or unexported fields
}
Courier handles the CBOR plugin interface for our courier service.
func NewCourier ¶
NewCourier returns a new Courier type.
func (*Courier) CacheReply ¶
func (e *Courier) CacheReply(reply *commands.ReplicaMessageReply)
func (*Courier) HandleReply ¶
func (e *Courier) HandleReply(reply *commands.ReplicaMessageReply)
func (*Courier) OnCommand ¶
func (e *Courier) OnCommand(cmd cborplugin.Command) error
OnCommand is only called when we receive queries from the client via the mixnet
func (*Courier) RegisterConsumer ¶
func (e *Courier) RegisterConsumer(s *cborplugin.Server)
func (*Courier) SetWriteFunc ¶
func (e *Courier) SetWriteFunc(writeFunc func(cborplugin.Command))
type CourierBookKeeping ¶
type CourierBookKeeping struct {
Epoch uint64
QueryType uint8
IntermediateReplicas [2]uint8 // Store the replica IDs that were contacted
EnvelopeReplies [2]*commands.ReplicaMessageReply
}
CourierBookKeeping is used for: 1. deduping writes 2. deduping reads 3. caching replica replies
type GenericConnector ¶
type GenericConnector interface {
Halt()
Server() *Server
OnClosedConn(conn *outgoingConn)
CloseAllCh() chan interface{}
ForceUpdate()
DispatchMessage(dest uint8, message *commands.ReplicaMessage)
}
type PKIWorker ¶
type PKIWorker struct {
worker.Worker
*pki.WorkerBase
// contains filtered or unexported fields
}
func (*PKIWorker) AuthenticateReplicaConnection ¶
func (p *PKIWorker) AuthenticateReplicaConnection(c *wire.PeerCredentials) (*pki.ReplicaDescriptor, bool)
func (*PKIWorker) ForceFetchPKI ¶
ForceFetchPKI forces the PKI worker to fetch a new PKI document for the current epoch. This is useful for integration tests where you want to ensure the courier has the latest PKI document without waiting for the normal fetch cycle.
func (*PKIWorker) HasCurrentPKIDocument ¶
HasCurrentPKIDocument returns true if the courier has a PKI document for the current epoch. This is useful for integration tests to check if the courier is ready.
func (*PKIWorker) ReplicasCopy ¶
func (p *PKIWorker) ReplicasCopy() map[[32]byte]*pki.ReplicaDescriptor
type PendingReadRequest ¶
PendingReadRequest stores information about a read request waiting for immediate reply
type Server ¶
func NewWithDefaultPKI ¶
NewWithDefaultPKI creates a new Server with the default voting PKI client
func NewWithPKI ¶
NewWithPKI creates a new Server with a custom PKI client for testing
func (*Server) ForceConnectorUpdate ¶
func (s *Server) ForceConnectorUpdate()
func (*Server) IdentityPublicKey ¶
IdentityPublicKey returns the server's identity public key
func (*Server) LinkPublicKey ¶
LinkPublicKey returns the server's link public key
func (*Server) LogBackend ¶
func (*Server) SendMessage ¶
func (s *Server) SendMessage(dest uint8, mesg *commands.ReplicaMessage)
func (*Server) StartPlugin ¶
func (s *Server) StartPlugin()
StartPlugin starts the CBOR plugin service which listens for socket connections from the service node.