reunion: github.com/katzenpost/reunion/commands Index | Files

package commands

import "github.com/katzenpost/reunion/commands"

Package commands provides commands used by the client and server.

Index

Package Files

commands.go

Constants

const (
    // ResponseStatusOK is an ErrorCode value used in responses from the Reunion DB
    // to indicate there was no error with the received query command.
    ResponseStatusOK = 0
    // ResponseStatusInvalidCommand is an ErrorCode value used in responses
    // from the Reunion DB to indicate the command was not accepted.
    ResponseInvalidCommand = 0xFF
)

type Command Uses

type Command interface {
    // ToBytes serializes the command and returns the resulting slice.
    ToBytes() []byte
}

Command interface represents query and response Reunion DB commands.

func FromBytes Uses

func FromBytes(b []byte) (Command, error)

FromBytes de-serializes the command in the buffer b, returning a Command or an error.

type FetchState Uses

type FetchState struct {
    // Epoch specifies the current Reunion epoch.
    Epoch uint64

    // T1Hash is the hash of the T1 message which is linked with a set of received messages.
    T1Hash [sha256.Size]byte
}

FetchState command is used by clients to fetch the current Reunion DB state.

func (*FetchState) ToBytes Uses

func (s *FetchState) ToBytes() []byte

ToBytes serializes the SendT1 command and returns the resulting slice.

type MessageResponse Uses

type MessageResponse struct {
    // ErrorCode indicates a specific error or status OK.
    ErrorCode uint8
}

MessageResponse command is used by the server to send clients the status of the previously received send command (SendT1, SendT2 and, SendT3).

func (*MessageResponse) ToBytes Uses

func (s *MessageResponse) ToBytes() []byte

ToBytes serializes the MessageResponse command and returns the resulting slice.

type SendT1 Uses

type SendT1 struct {
    // Epoch specifies the current Reunion epoch.
    Epoch uint64

    // Payload contains the T1 message.
    Payload []byte
}

SendT1 command is used by clients to send their T1 message to the Reunion DB.

func (*SendT1) ToBytes Uses

func (s *SendT1) ToBytes() []byte

ToBytes serializes the SendT1 command and returns the resulting slice.

type SendT2 Uses

type SendT2 struct {
    // Epoch specifies the current Reunion epoch.
    Epoch uint64

    // SrcT1Hash is the hash of the T1 message sent by this sender.
    SrcT1Hash [sha256.Size]byte

    // DstT1Hash is the hash of the T1 message which this T2 message is replying.
    DstT1Hash [sha256.Size]byte

    // Payload contains the T2 message.
    Payload []byte
}

SendT2 command is used by clients to send their T2 message to the Reunion DB.

func (*SendT2) ToBytes Uses

func (s *SendT2) ToBytes() []byte

ToBytes serializes the SendT2 command and returns the resulting slice.

type SendT3 Uses

type SendT3 struct {
    // Epoch specifies the current Reunion epoch.
    Epoch uint64

    // SrcT1Hash is the hash of the T1 message sent by this sender.
    SrcT1Hash [sha256.Size]byte

    // DstT1Hash is the hash of the T1 message which this T2 message is replying.
    DstT1Hash [sha256.Size]byte

    // Payload contains the T3 message.
    Payload []byte
}

SendT3 command is used by clients to send their T3 message to the Reunion DB.

func (*SendT3) ToBytes Uses

func (s *SendT3) ToBytes() []byte

ToBytes serializes the SendT2 command and returns the resulting slice.

type StateResponse Uses

type StateResponse struct {
    // ErrorCode indicates a specific error or status OK.
    ErrorCode uint8
    // Truncated indicates if the payload was truncated or not.
    Truncated bool
    // LeftOverChunksHint is the number of left over chunks if
    // the payload is truncated.
    LeftOverChunksHint uint32
    // Payload contains the Reunion DB state.
    Payload []byte
}

StateResponse is sent to clients in response to a FetchState command.

func (*StateResponse) ToBytes Uses

func (s *StateResponse) ToBytes() []byte

ToBytes serializes the SendT1 command and returns the resulting slice.

Package commands imports 5 packages (graph) and is imported by 4 packages. Updated 2020-10-25. Refresh now. Tools for package owners.