Documentation
¶
Overview ¶
Package fakeagent is a phone simulator that speaks the real agent protocol over a tiny fake app, so servers, SDKs and CI can run without a device.
Index ¶
- func Discover(timeout time.Duration) (addr, pub, name string, err error)
- type Agent
- func (a *Agent) DuplicateLink() error
- func (a *Agent) GoOffline(d time.Duration)
- func (a *Agent) PairCode(addr, serverPub string) error
- func (a *Agent) PairQR(uri string) error
- func (a *Agent) Paired() *Pairing
- func (a *Agent) PostNotification(pkg, title, text string)
- func (a *Agent) PostSMS(address, text string)
- func (a *Agent) Restart()
- func (a *Agent) Run() error
- func (a *Agent) Save() Saved
- func (a *Agent) Stop()
- func (a *Agent) UseRelay(on bool)
- type Pairing
- type Saved
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
DeviceID string
Model string
Log *slog.Logger
// OnSAS is called with the 6-digit code during code pairing.
OnSAS func(code string)
// contains filtered or unexported fields
}
func (*Agent) DuplicateLink ¶
DuplicateLink opens a second link while the first stays open, like a phone whose mobile connection died without the server noticing.
func (*Agent) PairCode ¶
PairCode pairs by comparing the 6-digit code; the server operator approves it.
func (*Agent) PostNotification ¶
PostNotification simulates an app posting a notification on the phone.
func (*Agent) PostSMS ¶ added in v0.1.13
PostSMS stores a text message in the simulated inbox, as if it had just arrived.
func (*Agent) Restart ¶
func (a *Agent) Restart()
Restart simulates the app process dying: a new boot id and an empty cache.