groups

package
v0.27.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 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 CachedEncryptedGroupMessage added in v0.18.4

type CachedEncryptedGroupMessage struct {
	EncryptedGroupMessage
	Group string
}

CachedEncryptedGroupMessage provides an encapsulation of the encrypted group message for local caching / error reporting

type DecryptedGroupMessage

type DecryptedGroupMessage struct {
	Text      string
	Onion     string
	Timestamp uint64
	// NOTE: SignedGroupID is now a misnomer, the only way this is signed is indirectly via the signed encrypted group messages
	// We now treat GroupID as binding to a server/key rather than an "owner" - additional validation logic (to e.g.
	// respect particular group constitutions) can be built on top of group messages, but the underlying groups are
	// now agnostic to those models.
	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 {
	GroupID       string
	GroupName     string
	SignedGroupID []byte
	Timestamp     uint64
	SharedKey     []byte
	ServerHost    string
}

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