audit

package
v4.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContextKey

type ContextKey string
const ConnContextKey ContextKey = "conn"

ConnContextKey is the key to attach the TCP connection to in a context.

type HTTPEvent

type HTTPEvent struct {
	cbaudit.GenericFields
	LocalRemoteIPs

	URL string `json:"url"`
}

HTTPEvent is a struct intended to be used as an audit event with 'go-cbaudit'. It contains fields for the local and remote addresses.

func NewHTTPEvent

func NewHTTPEvent(req *http.Request) (*HTTPEvent, error)

NewHTTPEvent creates a 'HTTPEvent' with its fields populated from 'req'.

NOTE: The request's context must have the connection as a value with the key 'ConnContextKey', otherwise an error is returned.

type IPAndPort

type IPAndPort struct {
	IP   string `json:"ip"`
	Port uint16 `json:"port"`
}

type LocalRemoteIPs

type LocalRemoteIPs struct {
	Remote *IPAndPort `json:"remote"`
	Local  *IPAndPort `json:"local"`
}

LocalRemoteIPs contains local and remote addresses for an HTTP request.

Jump to

Keyboard shortcuts

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