webapp

package
v0.0.0-...-9ae7e58 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthMiddleware

func AuthMiddleware(cfg *config.Config) func(http.Handler) http.Handler

Types

type TokensPerSecondData

type TokensPerSecondData struct {
	Date            string  `json:"date"`
	TokensPerSecond float64 `json:"tokens_per_second"`
}

type WebAppHandler

type WebAppHandler struct {
	DB  *gorm.DB
	Cfg *config.Config
}

func NewWebAppHandler

func NewWebAppHandler(db *gorm.DB, cfg *config.Config) *WebAppHandler

func (*WebAppHandler) AuthCheck

func (h *WebAppHandler) AuthCheck(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) CreateAPIKey

func (h *WebAppHandler) CreateAPIKey(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) CreatePrompt

func (h *WebAppHandler) CreatePrompt(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) CreateSnippet

func (h *WebAppHandler) CreateSnippet(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) DeleteAPIKey

func (h *WebAppHandler) DeleteAPIKey(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) DeletePrompt

func (h *WebAppHandler) DeletePrompt(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) DeleteSnippet

func (h *WebAppHandler) DeleteSnippet(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) GetPrompt

func (h *WebAppHandler) GetPrompt(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) GetQueryRecords

func (h *WebAppHandler) GetQueryRecords(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) GetTokensPerSecondTimeSeries

func (h *WebAppHandler) GetTokensPerSecondTimeSeries(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) ListAPIKeys

func (h *WebAppHandler) ListAPIKeys(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) ListPrompts

func (h *WebAppHandler) ListPrompts(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) ListSnippets

func (h *WebAppHandler) ListSnippets(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) Login

func (h *WebAppHandler) Login(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) RegisterOpenAIKey

func (h *WebAppHandler) RegisterOpenAIKey(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) SignUp

func (h *WebAppHandler) SignUp(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) UpdatePrompt

func (h *WebAppHandler) UpdatePrompt(w http.ResponseWriter, r *http.Request)

func (*WebAppHandler) UpdateSnippet

func (h *WebAppHandler) UpdateSnippet(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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