mobile

package
v0.0.0-...-8e980cd Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContactsContainer

type ContactsContainer interface {
	ContactSecret(contact string) ([]byte, error)
	DeleteContact(contact string)

	AllGroups() string
	AllLinks() string

	JoinGroup(groupSecret []byte) (string, error)

	NewLink(linkSecret []byte) (string, error)
}

type Device

type Device interface {
	Log(message string)
	MaxPacketSize(address string) (int, error)
	ProcessMessage(session int64, message []byte)
	SendPacket(address string, packet []byte)
	SessionRequested(session int64, contact string) []byte
	SessionEstablished(session int64, contact string, address string)
	SessionBroken(session int64)
	MessageDelivered(messageID int64)
	SyncStateChanged(contact string, stateUpdate []byte)
}

type LinkSession

type LinkSession interface {
	GetShare() []byte
}

type LinkingSession

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

func (*LinkingSession) GetShare

func (l *LinkingSession) GetShare() []byte

type Protocol

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

func NewProtocol

func NewProtocol(device Device, contactsContainer ContactsContainer, options *ProtocolOptions) *Protocol

func (*Protocol) BroadcastRouteRequest

func (p *Protocol) BroadcastRouteRequest()

func (*Protocol) DeinitCleanup

func (p *Protocol) DeinitCleanup()

func (*Protocol) DeleteContact

func (p *Protocol) DeleteContact(contact string)

func (*Protocol) JoinGroup

func (p *Protocol) JoinGroup(secret []byte) (string, error)

func (*Protocol) LinkingCreate

func (p *Protocol) LinkingCreate(session *LinkingSession, remoteKey []byte) (string, error)

func (*Protocol) LinkingStart

func (p *Protocol) LinkingStart() (*LinkingSession, error)

func (*Protocol) LoadPersistedState

func (p *Protocol) LoadPersistedState()

func (*Protocol) NewGroup

func (p *Protocol) NewGroup() (string, error)

func (*Protocol) OnConnection

func (p *Protocol) OnConnection(address string)

func (*Protocol) OnDisconnection

func (p *Protocol) OnDisconnection(address string)

func (*Protocol) ReceivePacket

func (p *Protocol) ReceivePacket(address string, packet []byte)

func (*Protocol) SendMessage

func (p *Protocol) SendMessage(session int64, message []byte) (int64, error)

func (*Protocol) SyncAddMessage

func (p *Protocol) SyncAddMessage(contact string, message []byte, attachedContact string) error

func (*Protocol) SyncLoadState

func (p *Protocol) SyncLoadState(contact string, state []byte) error

type ProtocolOptions

type ProtocolOptions struct {
	EnableSync bool
}

Jump to

Keyboard shortcuts

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