Documentation
¶
Index ¶
- type Filter
- type FlowData
- type FlowID
- type FlowMeta
- type FlowState
- type RingBuffer
- func (rb *RingBuffer) Add(meta FlowMeta)
- func (rb *RingBuffer) Get(id FlowID) (*FlowMeta, *FlowData, error)
- func (rb *RingBuffer) Len() int
- func (rb *RingBuffer) List(filter Filter, offset, limit int) ([]FlowMeta, int)
- func (rb *RingBuffer) SetData(id FlowID, d *FlowData)
- func (rb *RingBuffer) Update(id FlowID, fn func(*FlowMeta))
- func (rb *RingBuffer) UpdateData(id FlowID, fn func(*FlowData))
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlowData ¶
type FlowData struct {
RequestHeaders http.Header
RequestBody []byte
ResponseHeaders http.Header
ResponseBody []byte
ProcessPID int32
ProcessCmdline string
}
FlowData holds the full request/response headers and bodies.
type FlowMeta ¶
type FlowMeta struct {
ID FlowID
Method string
StatusCode int
Host string
Path string
Duration time.Duration
SizeBytes int64
StartedAt time.Time
State FlowState
ContentType string
Scheme string
Process string
ProcessPID int32
}
FlowMeta holds the summary fields displayed in the list view.
type RingBuffer ¶
type RingBuffer struct {
// contains filtered or unexported fields
}
RingBuffer is a thread-safe circular buffer for captured flows.
func (*RingBuffer) Add ¶
func (rb *RingBuffer) Add(meta FlowMeta)
Add inserts a flow into the buffer, evicting the oldest if full.
func (*RingBuffer) Get ¶
func (rb *RingBuffer) Get(id FlowID) (*FlowMeta, *FlowData, error)
Get returns the FlowMeta and FlowData for the given ID.
func (*RingBuffer) Len ¶
func (rb *RingBuffer) Len() int
Len returns the number of flows in the buffer.
func (*RingBuffer) List ¶
func (rb *RingBuffer) List(filter Filter, offset, limit int) ([]FlowMeta, int)
List returns flows newest-first, filtered, with offset/limit pagination. The second return value is the total count matching the filter.
func (*RingBuffer) SetData ¶
func (rb *RingBuffer) SetData(id FlowID, d *FlowData)
SetData replaces the FlowData for the given ID.
func (*RingBuffer) Update ¶
func (rb *RingBuffer) Update(id FlowID, fn func(*FlowMeta))
Update applies fn to the FlowMeta with the given ID.
func (*RingBuffer) UpdateData ¶ added in v0.1.8
func (rb *RingBuffer) UpdateData(id FlowID, fn func(*FlowData))
UpdateData applies fn to the FlowData for the given ID, creating an empty FlowData if none exists yet.