client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2019 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

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 (c *NetClient) GetReceivedMessages() [][]byte

func (*NetClient) OutQueue

func (c *NetClient) OutQueue() chan<- []byte

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

func (c *NetClient) ReadInNetworkFromTopology(topologyData *models.Topology) error

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

func (c *NetClient) Start() error

Start reads the network and users information from the topology and starts the listening server. Returns an error signalling whenever any operation was unsuccessful.

func (*NetClient) UpdateNetworkView

func (c *NetClient) UpdateNetworkView() error

func (*NetClient) Wait

func (c *NetClient) Wait()

Wait waits till the client is terminated for any reason.

type ReceivedMessages

type ReceivedMessages struct {
	sync.Mutex
	// contains filtered or unexported fields
}

Directories

Path Synopsis
rpc

Jump to

Keyboard shortcuts

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