Documentation ¶
Index ¶
- type IPInfo
- type Message
- type MessageType
- type RecordManager
- func (r *RecordManager) AddApiResponse(content string)
- func (r *RecordManager) AddCheckEndMessage()
- func (r *RecordManager) AddCloseMessage()
- func (r *RecordManager) AddErrorMessage(err error)
- func (r *RecordManager) AddMessage(content string)
- func (r *RecordManager) Done() <-chan struct{}
- func (r *RecordManager) ProcessRequest(headers RequestHeaders)
- func (r *RecordManager) Shutdown()
- func (r *RecordManager) Start(ctx context.Context)
- type RequestHeaders
- type RequestSignature
- type TraceInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IPInfo ¶ added in v0.0.7
type IPInfo struct { Status string `json:"status"` Country string `json:"country"` RegionName string `json:"regionName"` City string `json:"city"` ISP string `json:"isp"` Query string `json:"query"` }
IPInfo represents the response from IP-API
type Message ¶
type Message struct { Type MessageType // Message type: trace, error, close, finish Time time.Time // Time when the message was created Content string // The actual message content Headers RequestHeaders // Original request headers (if applicable) Error error // Error information (if applicable) }
Message represents a structured message in the system
type MessageType ¶ added in v0.0.7
type MessageType int
const ( MessageTypeTrace MessageType = iota MessageTypeError MessageTypeCheckEnd MessageTypeClose MessageTypeAPI )
type RecordManager ¶
type RecordManager struct {
// contains filtered or unexported fields
}
RecordManager handles trace records and messages
func (*RecordManager) AddApiResponse ¶ added in v0.0.7
func (r *RecordManager) AddApiResponse(content string)
func (*RecordManager) AddCheckEndMessage ¶ added in v0.0.7
func (r *RecordManager) AddCheckEndMessage()
func (*RecordManager) AddCloseMessage ¶ added in v0.0.7
func (r *RecordManager) AddCloseMessage()
func (*RecordManager) AddErrorMessage ¶
func (r *RecordManager) AddErrorMessage(err error)
AddErrorMessage adds an error message to the record
func (*RecordManager) AddMessage ¶
func (r *RecordManager) AddMessage(content string)
AddMessage adds a new message to the record
func (*RecordManager) Done ¶
func (r *RecordManager) Done() <-chan struct{}
Done returns the done channel
func (*RecordManager) ProcessRequest ¶
func (r *RecordManager) ProcessRequest(headers RequestHeaders)
ProcessRequest processes the request headers and adds trace messages
func (*RecordManager) Shutdown ¶ added in v0.0.7
func (r *RecordManager) Shutdown()
Shutdown cleanly shuts down the record manager
func (*RecordManager) Start ¶
func (r *RecordManager) Start(ctx context.Context)
Start begins processing trace events
type RequestHeaders ¶
type RequestHeaders struct { UserAgent string `json:"user_agent"` ForwardedFor string `json:"forwarded_for"` ConnectingIP string `json:"connecting_ip"` Country string `json:"country"` Time time.Time `json:"time"` IP string `json:"ip"` Location string `json:"location"` ISP string `json:"isp"` }
RequestHeaders contains information about the request
type RequestSignature ¶
RequestSignature represents a unique signature for a request
type TraceInfo ¶
type TraceInfo struct { TimeStr string UserAgent string ForwardedFor string ConnectingIP string IP string NodeNum int Location string ISP string }
TraceInfo represents processed trace information
func (*TraceInfo) FormatMessages ¶
FormatMessages formats the trace info into platform and IP path messages