client

package
v0.0.0-...-cf66588 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginChat

func BeginChat(c pb.StrikeClient, username string, chatTarget string, chatName string) error

func ClientSignup

func ClientSignup(c pb.StrikeClient, username string, password string, curve25519key []byte, ed25519key []byte) error

func ComputeSharedSecret

func ComputeSharedSecret(privateCurveKey []byte, inboundKey []byte) ([]byte, error)

func ConfirmChat

func ConfirmChat(ctx context.Context, c pb.StrikeClient, chatRequest *pb.BeginChatRequest, inviteState bool) error

func ConfirmKeyExchange

func ConfirmKeyExchange(ctx context.Context, c pb.StrikeClient, target string, status bool, chat *pb.Chat)

func ConnectPayloadStream

func ConnectPayloadStream(ctx context.Context, c pb.StrikeClient, username string, keys map[string][]byte) error

func InitiateKeyExchange

func InitiateKeyExchange(ctx context.Context, c pb.StrikeClient, target string, username string, privateEDKey []byte, publicCurveKey []byte, chat *pb.Chat)

func Login

func Login(c pb.StrikeClient, username string, password string) error

func LoginInput

func LoginInput(prompt string, reader *bufio.Reader) (string, error)

TODO: Handle all input like this?

func MessagingShell

func MessagingShell(c pb.StrikeClient, username string, keys map[string][]byte)

TODO: No longer fit for purpose - Terminal UI library time

func ProcessChatRequests

func ProcessChatRequests(ch <-chan *pb.BeginChatRequest, cache map[string]*pb.BeginChatRequest, idleTimeout time.Duration, workerCount *int, mu *sync.Mutex)

func ProcessConfirmChatRequests

func ProcessConfirmChatRequests(c pb.StrikeClient, ch <-chan *pb.ConfirmChatRequest, cache map[string]*pb.Chat, idleTimeout time.Duration, workerCount *int, mu *sync.Mutex, keys map[string][]byte)

func ProcessEnvelopes

func ProcessEnvelopes(ch <-chan *pb.Envelope, idleTimeout time.Duration, workerCount *int, mu *sync.Mutex)

func ProcessKeyExchangeConfirmations

func ProcessKeyExchangeConfirmations(c pb.StrikeClient, ch <-chan *pb.KeyExchangeConfirmation, cache map[string]*pb.Chat, idleTimeout time.Duration, workerCount *int, mu *sync.Mutex, keys map[string][]byte, username string)

func ProcessKeyExchangeRequests

func ProcessKeyExchangeRequests(c pb.StrikeClient, ch <-chan *pb.KeyExchangeRequest, cache map[string]*pb.Chat, idleTimeout time.Duration, workerCount *int, mu *sync.Mutex, keys map[string][]byte, username string)

func ProcessKeyExchangeResponses

func ProcessKeyExchangeResponses(c pb.StrikeClient, ch <-chan *pb.KeyExchangeResponse, cache map[string]*pb.Chat, idleTimeout time.Duration, workerCount *int, mu *sync.Mutex, keys map[string][]byte, username string)

func ReciprocateKeyExchange

func ReciprocateKeyExchange(ctx context.Context, c pb.StrikeClient, target string, username string, privateEDKey []byte, publicCurveKey []byte, chat *pb.Chat)

func SendMessage

func SendMessage(c pb.StrikeClient, username string, publicKey []byte, target string, message string)

func VerifyEdSignatures

func VerifyEdSignatures(pubKey ed25519.PublicKey, nonce, CurvePublicKey []byte, sigs [][]byte) bool

Types

type ClientCache

type ClientCache struct {
	Invites    map[string]*pb.BeginChatRequest
	Chats      map[string]*pb.Chat
	ActiveChat string
}

type Demultiplexer

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

func NewDemultiplexer

func NewDemultiplexer(c pb.StrikeClient, chatCache map[string]*pb.Chat, inviteCache map[string]*pb.BeginChatRequest, keys map[string][]byte, username string) *Demultiplexer

func (*Demultiplexer) Dispatcher

func (d *Demultiplexer) Dispatcher(msg *pb.StreamPayload)

func (*Demultiplexer) StartMonitoring

func (d *Demultiplexer) StartMonitoring(c pb.StrikeClient, chatCache map[string]*pb.Chat, inviteCache map[string]*pb.BeginChatRequest, keys map[string][]byte, username string)

Jump to

Keyboard shortcuts

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