types

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	Type    MessageType
	Content string
	Headers *RequestHeaders
	Error   error
}

Message represents a trace message

type MessageSender

type MessageSender interface {
	// MessageChan returns a channel for receiving trace messages
	MessageChan() <-chan Message
}

MessageSender defines the interface for sending trace messages

type MessageType

type MessageType int
const (
	MessageTypeNode MessageType = iota
	MessageTypeError
	MessageTypeAPI
)

type Node

type Node struct {
	IP           string
	Country      string
	Time         time.Time
	UserAgent    string
	RequestInfo  string
	ForwardedFor string
	RequestCount int // Track number of requests for this node
	IsNew        bool
	NodeIndex    int
	RegionName   string
	Org          string
}

Node represents a node in the trace path

type RequestHeaders

type RequestHeaders struct {
	UserAgent    string
	ForwardedFor string
	Time         time.Time
	IP           string
}

RequestHeaders represents the headers from a request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL