Documentation ¶
Index ¶
- type ContactsContainer
- type Device
- type LinkSession
- type LinkingSession
- type Protocol
- func (p *Protocol) BroadcastRouteRequest()
- func (p *Protocol) DeinitCleanup()
- func (p *Protocol) DeleteContact(contact string)
- func (p *Protocol) JoinGroup(secret []byte) (string, error)
- func (p *Protocol) LinkingCreate(session *LinkingSession, remoteKey []byte) (string, error)
- func (p *Protocol) LinkingStart() (*LinkingSession, error)
- func (p *Protocol) LoadPersistedState()
- func (p *Protocol) NewGroup() (string, error)
- func (p *Protocol) OnConnection(address string)
- func (p *Protocol) OnDisconnection(address string)
- func (p *Protocol) ReceivePacket(address string, packet []byte)
- func (p *Protocol) SendMessage(session int64, message []byte) (int64, error)
- func (p *Protocol) SyncAddMessage(contact string, message []byte, attachedContact string) error
- func (p *Protocol) SyncLoadState(contact string, state []byte) error
- type ProtocolOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContactsContainer ¶
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 {
}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 (*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) OnConnection ¶
func (*Protocol) OnDisconnection ¶
func (*Protocol) ReceivePacket ¶
func (*Protocol) SendMessage ¶
func (*Protocol) SyncAddMessage ¶
type ProtocolOptions ¶
type ProtocolOptions struct {
EnableSync bool
}
Click to show internal directories.
Click to hide internal directories.