schema

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion string = "v1"
View Source
const UnknownAddr = "unknown"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionStatsContainer

type ConnectionStatsContainer struct {
	ClientAddress       string `json:"client_address"`
	Method              string `json:"method"`
	URL                 string `json:"url"`
	ResponseCode        int    `json:"response_code"`
	ContentLength       int    `json:"content_length"`
	Duration            int64  `json:"duration_ms"`
	ResponseContentType string `json:"response_content_type,omitempty"`
	ProxyID             string `json:"proxy_id,omitempty"`
}

func NewConnectionStatusContainerWithDuration

func NewConnectionStatusContainerWithDuration(f px.Flow, doneAt int64) *ConnectionStatsContainer

NewConnectionStatusContainerWithDuration is a slightly leaky abstraction, the doneAt param is for logging the entire session length, and comes from the proxy addon layer.

func (*ConnectionStatsContainer) ToJSON

func (obj *ConnectionStatsContainer) ToJSON() []byte

func (*ConnectionStatsContainer) ToJSONstr

func (obj *ConnectionStatsContainer) ToJSONstr() string

type LogDumpContainer

type LogDumpContainer struct {
	SchemaVersion   string                    `json:"schema,omitempty"`
	Timestamp       time.Time                 `json:"timestamp,omitempty"`
	ConnectionStats *ConnectionStatsContainer `json:"connection_stats,omitempty"`
	Request         *TrafficObject            `json:"request,omitempty"`
	Response        *TrafficObject            `json:"response,omitempty"`
	// contains filtered or unexported fields
}

LogDumpContainer holds the request and response data for a given flow

func NewLogDumpContainer

func NewLogDumpContainer(f px.Flow, logSources config.LogSourceConfig, doneAt int64, filterReqHeaders, filterRespHeaders []string) *LogDumpContainer

NewLogDumpContainer returns a LogDumpContainer with *only* the fields requested in logSources populated

type TrafficObject

type TrafficObject struct {
	Headers http.Header `json:"headers"`
	Body    string      `json:"body"`
	// contains filtered or unexported fields
}

func (*TrafficObject) HeadersString

func (t *TrafficObject) HeadersString() string

HeadersString returns the headers as a flat string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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