Documentation ¶
Index ¶
- type Client
- type NetClient
- func (c *NetClient) GetAllPossibleRecipients() []*config.ClientConfig
- func (c *NetClient) GetOwnDetails() *config.ClientConfig
- func (c *NetClient) GetReceivedMessages() [][]byte
- func (c *NetClient) OutQueue() chan<- []byte
- func (c *NetClient) ReadInNetworkFromTopology(topologyData *models.Topology) error
- func (c *NetClient) SendMessage(message []byte, recipient config.ClientConfig) error
- func (c *NetClient) Shutdown()
- func (c *NetClient) Start() error
- func (c *NetClient) UpdateNetworkView() error
- func (c *NetClient) Wait()
- type ReceivedMessages
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { networker.NetworkClient networker.NetworkServer Start() error SendMessage(message []byte, recipient config.ClientConfig) error ReadInNetworkFromTopology(pkiName string) error }
TODO: what is the point of this interface currently? Client is the client networking interface
type NetClient ¶
type NetClient struct { *clientcore.CryptoClient // contains filtered or unexported fields }
NetClient is a queuing TCP network client for the mixnet.
func NewClient ¶
func NewClient(cfg *clientConfig.Config) (*NetClient, error)
NewClient constructor function to create an new client object. Returns a new client object or an error, if occurred.
func NewTestClient ¶
func NewTestClient(cfg *clientConfig.Config, prvKey *sphinx.PrivateKey, pubKey *sphinx.PublicKey) (*NetClient, error)
NewTestClient constructs a client object, which can be used for testing. The object contains the crypto core and the top-level of client, but does not involve networking and starting a listener. TODO: similar issue as with 'NewClient' - need to create some config struct with the parameters
func (*NetClient) GetAllPossibleRecipients ¶
func (c *NetClient) GetAllPossibleRecipients() []*config.ClientConfig
GetAllPossibleRecipients returns slice containing all recipients at all available providers
func (*NetClient) GetOwnDetails ¶
func (c *NetClient) GetOwnDetails() *config.ClientConfig
func (*NetClient) GetReceivedMessages ¶
func (*NetClient) OutQueue ¶
OutQueue returns a reference to the client's outQueue. It's a queue which holds outgoing packets while their order is randomised.
func (*NetClient) ReadInNetworkFromTopology ¶
ReadInNetworkFromTopology reads in the public information about active mixes from the topology and stores them locally. In case the connection or fetching data from the PKI went wrong, an error is returned.
func (*NetClient) SendMessage ¶
func (c *NetClient) SendMessage(message []byte, recipient config.ClientConfig) error
SendMessage responsible for sending a real message. Takes as input the message bytes and the public information about the destination.
func (*NetClient) Shutdown ¶
func (c *NetClient) Shutdown()
Shutdown cleanly shuts down a given client instance. TODO: create daemon to call this upon sigterm or something
func (*NetClient) Start ¶
Start reads the network and users information from the topology and starts the listening server. Returns an error signalling whenever any operation was unsuccessful.