proxy

package
v0.0.0-...-8d5f995 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyServer

type ProxyServer struct {
	Client       *http.Client
	RequestCount int64
	TokensCount  int64
	TotalCost    float64
	Cache        *cache.Cache
	Logger       *logger.Logger
	Mutex        sync.RWMutex
}

func NewProxyServer

func NewProxyServer(cacheDir, logDir string) (*ProxyServer, error)

func (*ProxyServer) GetStats

func (s *ProxyServer) GetStats() (int64, int64, float64)

func (*ProxyServer) OpenAIProxy

func (s *ProxyServer) OpenAIProxy(w http.ResponseWriter, r *http.Request)

func (*ProxyServer) ResetCounters

func (s *ProxyServer) ResetCounters()

Jump to

Keyboard shortcuts

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