groups

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2020 License: MIT Imports: 3 Imported by: 3

Documentation

Index

Constants

View Source
const CwtchServerSyncedCapability = tapir.Capability("CwtchServerSyncedCapability")

CwtchServerSyncedCapability is used to indicate that a given cwtch server is synced

Variables

This section is empty.

Functions

This section is empty.

Types

type DecryptedGroupMessage

type DecryptedGroupMessage struct {
	Text               string
	Onion              string
	Timestamp          uint64
	SignedGroupID      []byte
	PreviousMessageSig []byte
	Padding            []byte
}

DecryptedGroupMessage is the main encapsulation of group message data

type EncryptedGroupMessage

type EncryptedGroupMessage struct {
	Ciphertext []byte
	Signature  []byte
}

EncryptedGroupMessage provides an encapsulation of the encrypted group message stored on the server

func (EncryptedGroupMessage) ToBytes

func (egm EncryptedGroupMessage) ToBytes() []byte

ToBytes converts the encrypted group message to a set of bytes for serialization

type GroupInvite

type GroupInvite struct {
	GroupName      string
	SignedGroupID  []byte
	Timestamp      uint64
	SharedKey      []byte
	ServerHost     string
	InitialMessage []byte
}

GroupInvite provides a structured type for communicating group information to peers

type Message

type Message struct {
	MessageType   MessageType
	PostRequest   *PostRequest   `json:",omitempty"`
	PostResult    *PostResult    `json:",omitempty"`
	NewMessage    *NewMessage    `json:",omitempty"`
	ReplayRequest *ReplayRequest `json:",omitempty"`
	ReplayResult  *ReplayResult  `json:",omitempty"`
}

Message encapsulates the application protocol

type MessageType

type MessageType int

MessageType defines the enum for TokenBoard messages

const (
	ReplayRequestMessage MessageType = iota
	ReplayResultMessage
	PostRequestMessage
	PostResultMessage
	NewMessageMessage
)

Message Types

type NewMessage

type NewMessage struct {
	//Token   privacypass.SpentToken
	EGM EncryptedGroupMessage
}

NewMessage is used to send a new bulletin board message to interested peers.

type PostRequest

type PostRequest struct {
	Token privacypass.SpentToken
	EGM   EncryptedGroupMessage
}

PostRequest requests to post the message to the board with the given token

type PostResult

type PostResult struct {
	Success bool
}

PostResult returns the success of a given post attempt

type ReplayRequest

type ReplayRequest struct {
	LastCommit []byte
}

ReplayRequest requests a reply from the given Commit

type ReplayResult

type ReplayResult struct {
	NumMessages int
}

ReplayResult is sent by the server before a stream of replayed messages

Jump to

Keyboard shortcuts

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