web

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: MIT Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON(c *gin.Context, code int, message string)

Types

type AdminServer

type AdminServer struct {
	// contains filtered or unexported fields
}

func NewAdminServer

func NewAdminServer(log *zap.Logger, mode string, m KeyManager, krm KeyReportingManager) (*AdminServer, error)

func (*AdminServer) Run

func (as *AdminServer) Run()

func (*AdminServer) Shutdown

func (as *AdminServer) Shutdown(ctx context.Context) error

type ErrorResponse

type ErrorResponse struct {
	Type     string `json:"type"`
	Title    string `json:"title"`
	Status   int    `json:"status"`
	Detail   string `json:"detail"`
	Instance string `json:"instance"`
}

type KeyManager

type KeyManager interface {
	GetKeysByTag(tag string) ([]*key.ResponseKey, error)
	UpdateKey(id string, key *key.UpdateKey) (*key.ResponseKey, error)
	CreateKey(key *key.RequestKey) (*key.ResponseKey, error)
	DeleteKey(id string) error
}

type KeyReportingManager added in v0.0.7

type KeyReportingManager interface {
	GetKeyReporting(keyId string) (*key.KeyReporting, error)
	GetEventReporting(e *event.ReportingRequest) (*event.ReportingResponse, error)
}

type ProxyServer

type ProxyServer struct {
	// contains filtered or unexported fields
}

func NewProxyServer

func NewProxyServer(log *zap.Logger, mode, privacyMode string, m KeyManager, ks keyStorage, kms keyMemStorage, e estimator, v validator, r recorder, credential string, enc encrypter, rlm rateLimitManager) (*ProxyServer, error)

func (*ProxyServer) Run

func (ps *ProxyServer) Run()

func (*ProxyServer) Shutdown

func (ps *ProxyServer) Shutdown(ctx context.Context) error

type Route

type Route struct {
	// contains filtered or unexported fields
}

func NewRoute

func NewRoute(rc *config.RouteConfig, openAiClient openai.OpenAiClient, lg logger.Logger, lc *config.LoggerConfig, mode string) (*Route, error)

type ValidationError

type ValidationError interface {
	Error() string
	Validation()
}

type WebServer

type WebServer struct {
	// contains filtered or unexported fields
}

func NewWebServer

func NewWebServer(c *config.Config, lg logger.Logger, mode string) (*WebServer, error)

func (*WebServer) Run

func (w *WebServer) Run()

func (*WebServer) Shutdown

func (w *WebServer) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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