accesslog

package
v1.5.15 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2026 License: Apache-2.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

type RequestIdentity struct {
	ClientIP     string
	UserAgent    string
	ReferrerHost string
}

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.

Jump to

Keyboard shortcuts

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