Documentation
¶
Overview ¶
Package accesslog holds the edge request wire types so consumers need not link the ingress driver.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessRecord ¶
type AccessRecord struct {
Time time.Time `json:"time"`
Host string `json:"host"`
Method string `json:"method"`
Path string `json:"path"`
Status int `json:"status"`
Millis float64 `json:"duration_ms"`
BytesIn int64 `json:"bytes_in"`
BytesOut int64 `json:"bytes_out"`
RequestID string `json:"request_id"`
TraceID string `json:"trace_id,omitempty"`
Upstream bool `json:"upstream_error,omitempty"`
Cold bool `json:"cold_start,omitempty"`
Identity *RequestIdentity `json:"-"`
// Client and UserAgent stay in process memory for the abuse defense dry
// run. They are never serialized, so no read API can return them.
Client netip.Addr `json:"-"`
UserAgent string `json:"-"`
// Referrer is the Referer host only, kept in memory for the visitor summary and never serialized.
Referrer string `json:"-"`
// Class is what the edge decided this request was; it feeds the visitor summary only.
Class trafficclass.Class `json:"-"`
}
AccessRecord is one finished edge request. The query string is never captured. Client and UserAgent stay in process memory for the abuse defense replay and are never serialized; Identity reaches export subscribers only.
type RequestIdentity ¶
RequestIdentity is client detail handed to traffic export subscribers only, and only while a sink has opted in. The ring never stores it and it is never serialized.
type Source ¶
type Source interface {
Subscribe(fn func(key string, rec AccessRecord)) (unsubscribe func())
CaptureIdentity(on bool)
}
Source is the subscribe side of an access log, which is all an exporter needs.