result

package
v0.0.0-...-9fbac25 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TLSVersion

func TLSVersion(cs *tls.ConnectionState) string

func WithResult

func WithResult(ctx context.Context, res Result) context.Context

Types

type ExtensionFunc

type ExtensionFunc func(*http.Request) ([]ExtensionResult, error)

type ExtensionResult

type ExtensionResult struct {
	Name string              `json:"name"`
	Info map[string][]string `json:"info"`
}

type Extensions

type Extensions []ExtensionFunc

func (Extensions) GetResult

func (es Extensions) GetResult(r *http.Request) []ExtensionResult

type KubernetesResult

type KubernetesResult struct {
	Hostname     string `json:"hostname"`
	PodName      string `json:"pod_name"`
	PodNamespace string `json:"pod_namespace"`
	PodNode      string `json:"pod_node"`
}

type ParsedURL

type ParsedURL struct {
	Scheme   string     `json:"scheme"`
	Host     string     `json:"host"`
	Path     string     `json:"path"`
	RawPath  string     `json:"raw_path"`
	RawQuery string     `json:"raw_query"`
	Query    url.Values `json:"query"`
}

type RequestResult

type RequestResult struct {
	Protocol   string              `json:"protocol"`
	TLSVersion string              `json:"tls_version"`
	RemoteAddr string              `json:"remote_addr"`
	Method     string              `json:"method"`
	URI        string              `json:"uri"`
	ParsedURL  ParsedURL           `json:"parsed_url"`
	Headers    map[string][]string `json:"headers"`
}

func GetRequestResult

func GetRequestResult(r *http.Request) RequestResult

type Result

type Result struct {
	Kubernetes KubernetesResult `json:"kubernetes"`
	Request    RequestResult    `json:"request"`
	Runtime    RuntimeResult    `json:"runtime"`

	Extensions []ExtensionResult `json:"extensions"`
}

func FromContext

func FromContext(ctx context.Context) Result

func (Result) WriteTo

func (r Result) WriteTo(w io.Writer) (int64, error)

type RuntimeResult

type RuntimeResult struct {
	GoVersion     string `json:"go_version"`
	GoArch        string `json:"go_arch"`
	GoOS          string `json:"go_os"`
	NumCPUs       int    `json:"num_cpus"`
	NumGoroutines int    `json:"num_goroutines"`
	MainModule    string `json:"main_module"`
	MainPath      string `json:"main_path"`
	MainVersion   string `json:"main_version"`
}

func GetRuntimeResult

func GetRuntimeResult() RuntimeResult

Jump to

Keyboard shortcuts

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