Documentation
¶
Overview ¶
Package daemon is pano's composition root: it wires the certificate authority, the proxy engine, capture storage, the rules engine, the system-proxy manager and the control/MCP servers together, and implements the control API backend on top of them.
Index ¶
- func Run(ctx context.Context, opts Options) error
- type Daemon
- func (d *Daemon) AddRule(_ context.Context, req api.RuleAddRequest) (api.Rule, error)
- func (d *Daemon) Attach(own bool) func()
- func (d *Daemon) Audit(line string)
- func (d *Daemon) Blob(b []byte) string
- func (d *Daemon) Body(ctx context.Context, id flow.ID, part string, decode bool) ([]byte, string, error)
- func (d *Daemon) Bus() *bus.Bus
- func (d *Daemon) CAPEM(context.Context) []byte
- func (d *Daemon) Capture(ctx context.Context, req api.CaptureRequest) (api.Status, error)
- func (d *Daemon) ChangeDecrypt(ctx context.Context, c api.DecryptChange) (api.Decrypt, error)
- func (d *Daemon) Config(context.Context) any
- func (d *Daemon) Decrypt(context.Context) api.Decrypt
- func (d *Daemon) DeleteSession(_ context.Context, id string) error
- func (d *Daemon) Diff(ctx context.Context, req api.DiffRequest) (api.DiffResult, error)
- func (d *Daemon) Disown(context.Context)
- func (d *Daemon) Done(f *flow.Flow)
- func (d *Daemon) Explain(ctx context.Context, id flow.ID, req api.ExplainRequest) (api.ExplainResult, error)
- func (d *Daemon) GetFlow(ctx context.Context, id flow.ID, q api.FlowQuery) (api.FlowDetail, error)
- func (d *Daemon) GetFlowRaw(ctx context.Context, id flow.ID) (*flow.Flow, error)
- func (d *Daemon) HAR(ctx context.Context, req api.HARRequest) (api.HARResult, error)
- func (d *Daemon) Held(context.Context) []api.Held
- func (d *Daemon) Lifecycle() api.Lifecycle
- func (d *Daemon) ListFlows(ctx context.Context, f api.FlowFilter) (api.FlowList, error)
- func (d *Daemon) Mobile(context.Context) api.Mobile
- func (d *Daemon) Off(ctx context.Context) error
- func (d *Daemon) Presets(context.Context) []api.Preset
- func (d *Daemon) RemoveAllRules(context.Context) int
- func (d *Daemon) RemoveRule(_ context.Context, id string) error
- func (d *Daemon) Replay(ctx context.Context, id flow.ID, req api.ReplayRequest) (api.ReplayResult, error)
- func (d *Daemon) Resume(_ context.Context, id flow.ID, req api.ResumeRequest) error
- func (d *Daemon) Rules(context.Context) []api.Rule
- func (d *Daemon) Sessions(context.Context) ([]api.Session, error)
- func (d *Daemon) SetMobile(_ context.Context, req api.MobileRequest) (api.Mobile, error)
- func (d *Daemon) SetSysProxy(ctx context.Context, req api.SysProxyRequest) (api.SysProxy, error)
- func (d *Daemon) Shutdown(context.Context) error
- func (d *Daemon) StartSession(_ context.Context, name string) (api.Session, error)
- func (d *Daemon) Started(f *flow.Flow)
- func (d *Daemon) Stats(context.Context) api.Stats
- func (d *Daemon) Status(ctx context.Context) api.Status
- func (d *Daemon) SysProxy(ctx context.Context) api.SysProxy
- func (d *Daemon) Tail(ctx context.Context, req api.TailRequest) (api.TailResult, error)
- func (d *Daemon) UpdateRule(_ context.Context, id string, p api.RulePatch) (api.Rule, error)
- func (d *Daemon) Updated(f *flow.Flow)
- func (d *Daemon) WS(m *flow.WSMessage)
- func (d *Daemon) WSMessages(ctx context.Context, id flow.ID, limit int) ([]flow.WSMessage, error)
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon owns every long-lived component.
func (*Daemon) Body ¶
func (d *Daemon) Body(ctx context.Context, id flow.ID, part string, decode bool) ([]byte, string, error)
Body implements control.Backend.
func (*Daemon) ChangeDecrypt ¶
ChangeDecrypt implements control.Backend: validates and applies a partial update, persists [decrypt] to config.toml, and returns the new state.
func (*Daemon) DeleteSession ¶
DeleteSession implements control.Backend: forgets the session and every flow captured under it.
func (*Daemon) Diff ¶
func (d *Daemon) Diff(ctx context.Context, req api.DiffRequest) (api.DiffResult, error)
Diff implements control.Backend.
func (*Daemon) Explain ¶
func (d *Daemon) Explain(ctx context.Context, id flow.ID, req api.ExplainRequest) (api.ExplainResult, error)
Explain implements control.Backend.
func (*Daemon) GetFlowRaw ¶
GetFlowRaw implements control.Backend.
func (*Daemon) Mobile ¶
Mobile implements control.Backend: the LAN listener state plus every remote device the proxy has seen.
func (*Daemon) Off ¶
Off implements control.Backend: restore the system proxy, then stop. Closing the proxy listeners on shutdown takes the mobile listener down with them.
func (*Daemon) RemoveAllRules ¶
RemoveAllRules implements control.Backend.
func (*Daemon) RemoveRule ¶
RemoveRule implements control.Backend.
func (*Daemon) Replay ¶
func (d *Daemon) Replay(ctx context.Context, id flow.ID, req api.ReplayRequest) (api.ReplayResult, error)
Replay implements control.Backend. The request is sent through the proxy itself so it is captured and rules apply.
func (*Daemon) SetMobile ¶
SetMobile implements control.Backend. Enabling binds one more proxy listener on the Mac's LAN address (never 0.0.0.0, never the control API or MCP), admitting private-network clients only. Disabling closes it; open tunnels finish on their own.
func (*Daemon) SetSysProxy ¶
SetSysProxy implements control.Backend.
func (*Daemon) StartSession ¶
StartSession implements control.Backend.
func (*Daemon) Tail ¶
func (d *Daemon) Tail(ctx context.Context, req api.TailRequest) (api.TailResult, error)
Tail implements control.Backend: returns flows completed after the cursor, waiting up to WaitMS for the first one.
func (*Daemon) UpdateRule ¶
UpdateRule implements control.Backend.