Documentation
¶
Index ¶
- func ExtractToken(r *http.Request) string
- type Manager
- func (m *Manager) CreateKey(name string, allowedModels []string, maxRPM int) (*config.VirtualKey, error)
- func (m *Manager) HasKeys() bool
- func (m *Manager) ListKeys() []config.VirtualKey
- func (m *Manager) Reload() error
- func (m *Manager) RevokeKey(id string) error
- func (m *Manager) TrackUsage(keyID string, tokens int)
- func (m *Manager) Validate(authHeader string, model string) (bool, *config.VirtualKey, string)
- func (m *Manager) ValidateRequest(r *http.Request, model string) (bool, *config.VirtualKey, string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractToken ¶ added in v0.7.0
ExtractToken extracts auth token from standard headers (Authorization, x-api-key, x-goog-api-key) or query (?key=)
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func (*Manager) ListKeys ¶
func (m *Manager) ListKeys() []config.VirtualKey
func (*Manager) TrackUsage ¶
func (*Manager) ValidateRequest ¶ added in v0.7.0
ValidateRequest extracts token across headers and validates against virtual key store
Click to show internal directories.
Click to hide internal directories.