gatewayctl

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KillSwitch

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

func NewKillSwitch

func NewKillSwitch() *KillSwitch

func (*KillSwitch) Block

func (k *KillSwitch) Block(source string)

func (*KillSwitch) IsBlocked

func (k *KillSwitch) IsBlocked(source string) bool

func (*KillSwitch) List

func (k *KillSwitch) List() []string

func (*KillSwitch) Unblock

func (k *KillSwitch) Unblock(source string)

type ModelAlias

type ModelAlias struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type ModelAliaser

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

func NewModelAliaser

func NewModelAliaser() *ModelAliaser

func (*ModelAliaser) AddAlias

func (a *ModelAliaser) AddAlias(from, to string)

func (*ModelAliaser) List

func (a *ModelAliaser) List() []ModelAlias

func (*ModelAliaser) Resolve

func (a *ModelAliaser) Resolve(model string) string

type QuotaConfig

type QuotaConfig struct {
	Source      string        `json:"source"`
	DailyUSD    float64       `json:"daily_usd"`
	MonthlyUSD  float64       `json:"monthly_usd"`
	DailyTokens int64         `json:"daily_tokens"`
	CallLimit   int           `json:"call_limit"`
	ResetPeriod time.Duration `json:"reset_period"`
}

type QuotaManager

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

func NewQuotaManager

func NewQuotaManager() *QuotaManager

func (*QuotaManager) CheckQuota

func (m *QuotaManager) CheckQuota(source string) (bool, string)

func (*QuotaManager) GetUsage

func (m *QuotaManager) GetUsage(source string) *QuotaUsage

func (*QuotaManager) RecordUsage

func (m *QuotaManager) RecordUsage(source string, cost float64, tokens int64) bool

func (*QuotaManager) SetQuota

func (m *QuotaManager) SetQuota(source string, config *QuotaConfig)

type QuotaUsage

type QuotaUsage struct {
	Source      string    `json:"source"`
	DailyCost   float64   `json:"daily_cost"`
	MonthlyCost float64   `json:"monthly_cost"`
	DailyTokens int64     `json:"daily_tokens"`
	CallCount   int       `json:"call_count"`
	LastReset   time.Time `json:"last_reset"`
}

Jump to

Keyboard shortcuts

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