client

package
v0.0.0-...-23600c6 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NextKey

func NextKey(shared int, seq int) [keys.KeySize]byte

Types

type AckMessage

type AckMessage struct {
	Sender []byte
	Seq    int
}

func (AckMessage) GetSender

func (m AckMessage) GetSender() *[]byte

func (AckMessage) GetSeq

func (m AckMessage) GetSeq() int

type Client

type Client struct {
	// contains filtered or unexported fields
}

func InitClient

func InitClient(addresses []string, seq int, sendShared int, recvShared int) *Client

func (*Client) Ack

func (c *Client) Ack() error

func (*Client) GetSeq

func (c *Client) GetSeq() int

func (*Client) IncrementSeq

func (c *Client) IncrementSeq()

func (*Client) Recv

func (c *Client) Recv() (Message, error)

func (*Client) RecvAck

func (c *Client) RecvAck() (bool, error)

func (*Client) RecvBack

func (c *Client) RecvBack(back int) (Message, error)

func (*Client) Send

func (c *Client) Send(text string) error

func (*Client) SendAndFinish

func (c *Client) SendAndFinish(text string) error

func (*Client) WaitAck

func (c *Client) WaitAck() error

type Message

type Message interface {
	GetSender() *[]byte
	GetSeq() int
}

type TextMessage

type TextMessage struct {
	Sender []byte
	Seq    int

	Text string
}

func (TextMessage) GetSender

func (m TextMessage) GetSender() *[]byte

func (TextMessage) GetSeq

func (m TextMessage) GetSeq() int

func (TextMessage) GetText

func (m TextMessage) GetText() string

Jump to

Keyboard shortcuts

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