Documentation
¶
Overview ¶
Package agentlink is the server side of the phone link: the two-line handshake and the encrypted session (PROTOCOL.md 4.4-4.5).
Index ¶
Constants ¶
const (
Proto = 1
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Accepted ¶
type Authority ¶
type Authority interface {
ServerID() string
StaticKey() *ecdh.PrivateKey
DevicePub(device string) (*ecdh.PublicKey, bool)
EnrollToken(tid string) ([]byte, bool)
CodePairingOpen() bool
}
Authority answers the questions the handshake needs about paired devices.
type Hello ¶
type Hello struct {
Device string `json:"device"`
Boot string `json:"boot"`
Model string `json:"model"`
Manufacturer string `json:"manufacturer"`
SDK int `json:"sdk"`
Release string `json:"release"`
Agent string `json:"agent"`
Route string `json:"route"`
Lang string `json:"lang"`
Ready map[string]bool `json:"ready"`
}
type Session ¶
type Session struct {
DeviceID string
// contains filtered or unexported fields
}
Session is an authenticated, encrypted link to one phone.
func NewClientSession ¶
NewClientSession builds the phone side of a session; used by the simulator.
func (*Session) Recv ¶
Recv returns the next decrypted message. Numbers stay json.Number so they round-trip to clients unchanged. Only one goroutine may call Recv.