Documentation ¶
Index ¶
- Constants
- func RemoteIP(req *http.Request) string
- type Backend
- type ConsoleBackend
- type DatabaseBackend
- type Interface
- type LoginRequest
- type Object
- type ResponseCapture
- func (c *ResponseCapture) Bytes() []byte
- func (c *ResponseCapture) CloseNotify() <-chan bool
- func (c *ResponseCapture) Flush()
- func (c *ResponseCapture) Header() http.Header
- func (c *ResponseCapture) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (c *ResponseCapture) StatusCode() int
- func (c *ResponseCapture) Write(data []byte) (int, error)
- func (c *ResponseCapture) WriteHeader(statusCode int)
Constants ¶
View Source
const ( XForwardedFor = "X-Forwarded-For" XRealIP = "X-Real-IP" XClientIP = "x-client-ip" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
func NewDatabaseBackend ¶
func NewDatabaseBackend(operator platform.EventWriter, stopCh <-chan struct{}) Backend
type ConsoleBackend ¶
type ConsoleBackend struct { }
func (ConsoleBackend) SendEvent ¶
func (c ConsoleBackend) SendEvent(e audit.Event)
type DatabaseBackend ¶
type DatabaseBackend struct {
// contains filtered or unexported fields
}
func (*DatabaseBackend) CreateEvent ¶
func (c *DatabaseBackend) CreateEvent(e *audit.Event)
func (*DatabaseBackend) SendEvent ¶
func (c *DatabaseBackend) SendEvent(e audit.Event)
type Interface ¶
type Interface interface { Enabled() bool AddBackend(backend Backend) LogRequestObject(req *http.Request, info *request.Info) *audit.Event LogResponseObject(e *audit.Event, resp *ResponseCapture) }
func NewAuditing ¶
func NewAuditing(options *auditoptions.AuditOptions) Interface
type LoginRequest ¶
type Object ¶
type Object struct {
metav1.ObjectMeta `json:"metadata,omitempty"`
}
type ResponseCapture ¶
type ResponseCapture struct { http.ResponseWriter // contains filtered or unexported fields }
func NewResponseCapture ¶
func NewResponseCapture(w http.ResponseWriter) *ResponseCapture
func (*ResponseCapture) Bytes ¶
func (c *ResponseCapture) Bytes() []byte
func (*ResponseCapture) CloseNotify ¶
func (c *ResponseCapture) CloseNotify() <-chan bool
CloseNotify is part of http.CloseNotifier interface
func (*ResponseCapture) Flush ¶
func (c *ResponseCapture) Flush()
func (*ResponseCapture) Header ¶
func (c *ResponseCapture) Header() http.Header
func (*ResponseCapture) Hijack ¶
func (c *ResponseCapture) Hijack() (net.Conn, *bufio.ReadWriter, error)
Hijack implements the http.Hijacker interface. This expands the Response to fulfill http.Hijacker if the underlying http.ResponseWriter supports it.
func (*ResponseCapture) StatusCode ¶
func (c *ResponseCapture) StatusCode() int
func (*ResponseCapture) WriteHeader ¶
func (c *ResponseCapture) WriteHeader(statusCode int)
Click to show internal directories.
Click to hide internal directories.