client

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2016 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizeFingerprintCmd

type AuthorizeFingerprintCmd struct {
	Account     *config.Account
	Peer        string
	Fingerprint []byte
}

AuthorizeFingerprintCmd is a command that represents a request to authorize a fingerprint

type CommandManager

type CommandManager interface {
	ExecuteCmd(c interface{})
}

CommandManager is anything that can execute commands

type Conversation

type Conversation interface {
	Send(Sender, string, []byte) (trace int, err error)
	Receive(Sender, string, []byte) ([]byte, error)

	StartEncryptedChat(Sender, string) error
	EndEncryptedChat(Sender, string) error

	ProvideAuthenticationSecret(Sender, string, []byte) error
	StartAuthenticate(Sender, string, string, []byte) error

	GetSSID() [8]byte
	IsEncrypted() bool
	OurFingerprint() []byte
	TheirFingerprint() []byte
}

Conversation represents a conversation with encryption capabilities

type ConversationBuilder

type ConversationBuilder interface {
	// NewConversation returns a new conversation to a peer
	NewConversation(peer string) *otr3.Conversation
}

ConversationBuilder represents an entity capable of building Conversations

type ConversationManager

type ConversationManager interface {
	// GetConversationWith returns the conversation for the given peer, and
	// whether the Conversation exists
	GetConversationWith(peer, resource string) (Conversation, bool)

	// GetConversationWith returns the conversation for the given peer, and
	// creates the conversation if none exists. Additionally, returns whether the
	// conversation was created.
	EnsureConversationWith(peer, resource string) (Conversation, bool)

	// Conversations return all conversations currently managed
	Conversations() map[string]Conversation

	// TerminateAll terminates all existing conversations
	TerminateAll()
}

ConversationManager represents an entity capable of managing Conversations

func NewConversationManager

func NewConversationManager(builder ConversationBuilder, sender Sender) ConversationManager

NewConversationManager returns a new ConversationManager

type SaveApplicationConfigCmd

type SaveApplicationConfigCmd struct{}

SaveApplicationConfigCmd is a command that represents a request to save the application configuration

type SaveInstanceTagCmd

type SaveInstanceTagCmd struct {
	Account     *config.Account
	InstanceTag uint32
}

SaveInstanceTagCmd is a command that represents a request to save an instance tag

type Sender

type Sender interface {
	// Send sends a message to a peer
	Send(peer, resource, msg string) error
}

Sender represents an entity capable of sending messages to peers TODO: this assumes there is no more than one simultaneous conversations with a given peer

Jump to

Keyboard shortcuts

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