Documentation
¶
Overview ¶
Package client is the Go client for pano's control API over the daemon's Unix socket (or loopback TCP). The CLI and the MCP server share it.
Index ¶
- Variables
- func FilterQuery(f api.FlowFilter) url.Values
- type Client
- func (c *Client) AddRule(ctx context.Context, req api.RuleAddRequest) (api.Rule, error)
- func (c *Client) Attach(ctx context.Context, own bool) (<-chan struct{}, error)
- func (c *Client) Body(ctx context.Context, id flow.ID, part string, decode bool) ([]byte, error)
- func (c *Client) CAPEM(ctx context.Context) ([]byte, error)
- func (c *Client) Capture(ctx context.Context, req api.CaptureRequest) (api.Status, error)
- func (c *Client) ChangeDecrypt(ctx context.Context, ch api.DecryptChange) (api.Decrypt, error)
- func (c *Client) Config(ctx context.Context) (json.RawMessage, error)
- func (c *Client) Decrypt(ctx context.Context) (api.Decrypt, error)
- func (c *Client) DeleteSession(ctx context.Context, id string) error
- func (c *Client) Diff(ctx context.Context, req api.DiffRequest) (api.DiffResult, error)
- func (c *Client) Disown(ctx context.Context) (api.Lifecycle, error)
- func (c *Client) Events(ctx context.Context, types []string, host string) (<-chan flow.Event, error)
- func (c *Client) Explain(ctx context.Context, id flow.ID, req api.ExplainRequest) (api.ExplainResult, error)
- func (c *Client) Flow(ctx context.Context, id flow.ID, q api.FlowQuery) (api.FlowDetail, error)
- func (c *Client) FlowRaw(ctx context.Context, id flow.ID) (*flow.Flow, error)
- func (c *Client) Flows(ctx context.Context, f api.FlowFilter) (api.FlowList, error)
- func (c *Client) HAR(ctx context.Context, req api.HARRequest) (api.HARResult, error)
- func (c *Client) Held(ctx context.Context) ([]api.Held, error)
- func (c *Client) Mobile(ctx context.Context) (api.Mobile, error)
- func (c *Client) Off(ctx context.Context) error
- func (c *Client) Ping(ctx context.Context) bool
- func (c *Client) Presets(ctx context.Context) ([]api.Preset, error)
- func (c *Client) RemoveAllRules(ctx context.Context) (int, error)
- func (c *Client) RemoveRule(ctx context.Context, id string) error
- func (c *Client) Replay(ctx context.Context, id flow.ID, req api.ReplayRequest) (api.ReplayResult, error)
- func (c *Client) Resume(ctx context.Context, id flow.ID, req api.ResumeRequest) error
- func (c *Client) Rules(ctx context.Context) ([]api.Rule, error)
- func (c *Client) Sessions(ctx context.Context) ([]api.Session, error)
- func (c *Client) SetMobile(ctx context.Context, req api.MobileRequest) (api.Mobile, error)
- func (c *Client) SetSysProxy(ctx context.Context, req api.SysProxyRequest) (api.SysProxy, error)
- func (c *Client) Shutdown(ctx context.Context) error
- func (c *Client) StartSession(ctx context.Context, name string) (api.Session, error)
- func (c *Client) Stats(ctx context.Context) (api.Stats, error)
- func (c *Client) Status(ctx context.Context) (api.Status, error)
- func (c *Client) SysProxy(ctx context.Context) (api.SysProxy, error)
- func (c *Client) Tail(ctx context.Context, req api.TailRequest) (api.TailResult, error)
- func (c *Client) UpdateRule(ctx context.Context, id string, p api.RulePatch) (api.Rule, error)
- func (c *Client) WSMessages(ctx context.Context, id flow.ID, limit int) ([]flow.WSMessage, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNotRunning = errors.New("pano daemon is not running (start it with `pano start`)")
ErrNotRunning is returned when the daemon socket cannot be reached.
Functions ¶
func FilterQuery ¶
func FilterQuery(f api.FlowFilter) url.Values
FilterQuery encodes a filter as URL query parameters.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the daemon.
func (*Client) Attach ¶
Attach registers this process as a terminal UI and keeps the connection open until ctx ends. The returned channel closes when the daemon closes the stream (it stopped, or was turned off elsewhere). With own, the daemon turns itself off once the connection drops (app mode).
func (*Client) ChangeDecrypt ¶
ChangeDecrypt applies a partial update and returns the new policy.
func (*Client) DeleteSession ¶
DeleteSession removes a session and its flows.
func (*Client) Diff ¶
func (c *Client) Diff(ctx context.Context, req api.DiffRequest) (api.DiffResult, error)
Diff compares flows.
func (*Client) Events ¶
func (c *Client) Events(ctx context.Context, types []string, host string) (<-chan flow.Event, error)
Events streams bus events until ctx is cancelled. The returned channel is closed on disconnect.
func (*Client) Explain ¶
func (c *Client) Explain(ctx context.Context, id flow.ID, req api.ExplainRequest) (api.ExplainResult, error)
Explain digests LLM traffic.
func (*Client) RemoveAllRules ¶
RemoveAllRules deletes every rule.
func (*Client) RemoveRule ¶
RemoveRule deletes a rule.
func (*Client) Replay ¶
func (c *Client) Replay(ctx context.Context, id flow.ID, req api.ReplayRequest) (api.ReplayResult, error)
Replay re-sends a flow.
func (*Client) SetSysProxy ¶
SetSysProxy toggles the system proxy.
func (*Client) StartSession ¶
StartSession begins a new named session.
func (*Client) Tail ¶
func (c *Client) Tail(ctx context.Context, req api.TailRequest) (api.TailResult, error)
Tail long-polls for new flows.
func (*Client) UpdateRule ¶
UpdateRule patches a rule.