addons

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheStatusHeader = "X-Llm_proxy-Cache"
	CacheStatusHit    = "HIT"
	CacheStatusMiss   = "MISS"
	CacheStatusSkip   = "SKIP"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type APIAuditorAddon

type APIAuditorAddon struct {
	px.BaseAddon
	// contains filtered or unexported fields
}

APIAuditorAddon log connection and flow

func NewAPIAuditor

func NewAPIAuditor() *APIAuditorAddon

func (*APIAuditorAddon) Close

func (aud *APIAuditorAddon) Close() error

func (*APIAuditorAddon) Response

func (aud *APIAuditorAddon) Response(f *px.Flow)

type LLM_Addon

type LLM_Addon interface {
	String() string
	Close() error
}

type MegaDumpAddon

type MegaDumpAddon struct {
	px.BaseAddon
	// contains filtered or unexported fields
}

func NewMegaDumpAddon

func NewMegaDumpAddon(
	logTarget string,
	logFormatConfig config.TrafficLogFormat,
	logSources config.LogSourceConfig,
	filterReqHeaders, filterRespHeaders []string,
) (*MegaDumpAddon, error)

NewMegaDumpAddon creates a new dumper that creates a new log file for each request

func (*MegaDumpAddon) Close

func (d *MegaDumpAddon) Close() error

func (*MegaDumpAddon) Requestheaders

func (d *MegaDumpAddon) Requestheaders(f *px.Flow)

Requestheaders is a callback that will receive a "flow" from the proxy, will create a NewLogDumpContainer and will use the embedded writers to finally write the log.

func (*MegaDumpAddon) String

func (d *MegaDumpAddon) String() string

type ResponseCacheAddon

type ResponseCacheAddon struct {
	px.BaseAddon
	// contains filtered or unexported fields
}

func NewCacheAddon

func NewCacheAddon(
	storageEngineName string,
	cacheDir string,
	filterReqHeaders, filterRespHeaders []string,
) (*ResponseCacheAddon, error)

func (*ResponseCacheAddon) Close

func (d *ResponseCacheAddon) Close() (err error)

func (*ResponseCacheAddon) Request

func (c *ResponseCacheAddon) Request(f *px.Flow)

func (*ResponseCacheAddon) Response

func (c *ResponseCacheAddon) Response(f *px.Flow)

func (*ResponseCacheAddon) String

func (d *ResponseCacheAddon) String() string

type SchemeUpgrader

type SchemeUpgrader struct {
	px.BaseAddon
}

func (*SchemeUpgrader) Request

func (c *SchemeUpgrader) Request(f *px.Flow)

func (*SchemeUpgrader) Response

func (c *SchemeUpgrader) Response(f *px.Flow)

type StdOutLogger

type StdOutLogger struct {
	px.BaseAddon
}

StdOutLogger log connection and flow

func NewStdOutLogger

func NewStdOutLogger() *StdOutLogger

func (*StdOutLogger) ClientConnected

func (addon *StdOutLogger) ClientConnected(client *px.ClientConn)

func (*StdOutLogger) ClientDisconnected

func (addon *StdOutLogger) ClientDisconnected(client *px.ClientConn)

func (*StdOutLogger) ServerConnected

func (addon *StdOutLogger) ServerConnected(connCtx *px.ConnContext)

func (*StdOutLogger) ServerDisconnected

func (addon *StdOutLogger) ServerDisconnected(connCtx *px.ConnContext)

Directories

Path Synopsis
key

Jump to

Keyboard shortcuts

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