configstore

package
v1.1.29 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: Apache-2.0 Imports: 20 Imported by: 4

Documentation

Overview

Package configstore provides a persistent configuration store for Bifrost.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type AuthConfig added in v1.1.20

type AuthConfig struct {
	AdminUserName          string `json:"admin_username"`
	AdminPassword          string `json:"admin_password"`
	IsEnabled              bool   `json:"is_enabled"`
	DisableAuthOnInference bool   `json:"disable_auth_on_inference"`
}

AuthConfig represents configured auth config for Bifrost dashboard

type ClientConfig

type ClientConfig struct {
	DropExcessRequests      bool     `json:"drop_excess_requests"`      // Drop excess requests if the provider queue is full
	InitialPoolSize         int      `json:"initial_pool_size"`         // The initial pool size for the bifrost client
	PrometheusLabels        []string `json:"prometheus_labels"`         // The labels to be used for prometheus metrics
	EnableLogging           bool     `json:"enable_logging"`            // Enable logging of requests and responses
	DisableContentLogging   bool     `json:"disable_content_logging"`   // Disable logging of content
	EnableGovernance        bool     `json:"enable_governance"`         // Enable governance on all requests
	EnforceGovernanceHeader bool     `json:"enforce_governance_header"` // Enforce governance on all requests
	AllowDirectKeys         bool     `json:"allow_direct_keys"`         // Allow direct keys to be used for requests
	AllowedOrigins          []string `json:"allowed_origins,omitempty"` // Additional allowed origins for CORS and WebSocket (localhost is always allowed)
	MaxRequestBodySizeMB    int      `json:"max_request_body_size_mb"`  // The maximum request body size in MB
	EnableLiteLLMFallbacks  bool     `json:"enable_litellm_fallbacks"`  // Enable litellm-specific fallbacks for text completion for Groq
}

ClientConfig represents the core configuration for Bifrost HTTP transport and the Bifrost Client. It includes settings for excess request handling, Prometheus metrics, and initial pool size.

type Config

type Config struct {
	Enabled bool            `json:"enabled"`
	Type    ConfigStoreType `json:"type"`
	Config  any             `json:"config"`
}

Config represents the configuration for the config store.

func (*Config) UnmarshalJSON

func (c *Config) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the config from JSON.

type ConfigMap

type ConfigMap map[schemas.ModelProvider]ProviderConfig

ConfigMap maps provider names to their configurations.

type ConfigStore

type ConfigStore interface {
	// Health check
	Ping(ctx context.Context) error

	// Client config CRUD
	UpdateClientConfig(ctx context.Context, config *ClientConfig) error
	GetClientConfig(ctx context.Context) (*ClientConfig, error)

	// Framework config CRUD
	UpdateFrameworkConfig(ctx context.Context, config *tables.TableFrameworkConfig) error
	GetFrameworkConfig(ctx context.Context) (*tables.TableFrameworkConfig, error)

	// Provider config CRUD
	UpdateProvidersConfig(ctx context.Context, providers map[schemas.ModelProvider]ProviderConfig) error
	AddProvider(ctx context.Context, provider schemas.ModelProvider, config ProviderConfig, envKeys map[string][]EnvKeyInfo) error
	UpdateProvider(ctx context.Context, provider schemas.ModelProvider, config ProviderConfig, envKeys map[string][]EnvKeyInfo) error
	DeleteProvider(ctx context.Context, provider schemas.ModelProvider) error
	GetProvidersConfig(ctx context.Context) (map[schemas.ModelProvider]ProviderConfig, error)

	// MCP config CRUD
	GetMCPConfig(ctx context.Context) (*schemas.MCPConfig, error)
	GetMCPClientByName(ctx context.Context, name string) (*tables.TableMCPClient, error)
	CreateMCPClientConfig(ctx context.Context, clientConfig schemas.MCPClientConfig, envKeys map[string][]EnvKeyInfo) error
	UpdateMCPClientConfig(ctx context.Context, id string, clientConfig schemas.MCPClientConfig, envKeys map[string][]EnvKeyInfo) error
	DeleteMCPClientConfig(ctx context.Context, id string) error

	// Vector store config CRUD
	UpdateVectorStoreConfig(ctx context.Context, config *vectorstore.Config) error
	GetVectorStoreConfig(ctx context.Context) (*vectorstore.Config, error)

	// Logs store config CRUD
	UpdateLogsStoreConfig(ctx context.Context, config *logstore.Config) error
	GetLogsStoreConfig(ctx context.Context) (*logstore.Config, error)

	// ENV keys CRUD
	UpdateEnvKeys(ctx context.Context, keys map[string][]EnvKeyInfo) error
	GetEnvKeys(ctx context.Context) (map[string][]EnvKeyInfo, error)

	// Config CRUD
	GetConfig(ctx context.Context, key string) (*tables.TableGovernanceConfig, error)
	UpdateConfig(ctx context.Context, config *tables.TableGovernanceConfig, tx ...*gorm.DB) error

	// Plugins CRUD
	GetPlugins(ctx context.Context) ([]*tables.TablePlugin, error)
	GetPlugin(ctx context.Context, name string) (*tables.TablePlugin, error)
	CreatePlugin(ctx context.Context, plugin *tables.TablePlugin, tx ...*gorm.DB) error
	UpdatePlugin(ctx context.Context, plugin *tables.TablePlugin, tx ...*gorm.DB) error
	DeletePlugin(ctx context.Context, name string, tx ...*gorm.DB) error

	// Governance config CRUD
	GetVirtualKeys(ctx context.Context) ([]tables.TableVirtualKey, error)
	GetRedactedVirtualKeys(ctx context.Context, ids []string) ([]tables.TableVirtualKey, error) // leave ids empty to get all
	GetVirtualKey(ctx context.Context, id string) (*tables.TableVirtualKey, error)
	GetVirtualKeyByValue(ctx context.Context, value string) (*tables.TableVirtualKey, error)
	CreateVirtualKey(ctx context.Context, virtualKey *tables.TableVirtualKey, tx ...*gorm.DB) error
	UpdateVirtualKey(ctx context.Context, virtualKey *tables.TableVirtualKey, tx ...*gorm.DB) error
	DeleteVirtualKey(ctx context.Context, id string) error

	// Virtual key provider config CRUD
	GetVirtualKeyProviderConfigs(ctx context.Context, virtualKeyID string) ([]tables.TableVirtualKeyProviderConfig, error)
	CreateVirtualKeyProviderConfig(ctx context.Context, virtualKeyProviderConfig *tables.TableVirtualKeyProviderConfig, tx ...*gorm.DB) error
	UpdateVirtualKeyProviderConfig(ctx context.Context, virtualKeyProviderConfig *tables.TableVirtualKeyProviderConfig, tx ...*gorm.DB) error
	DeleteVirtualKeyProviderConfig(ctx context.Context, id uint, tx ...*gorm.DB) error

	// Virtual key MCP config CRUD
	GetVirtualKeyMCPConfigs(ctx context.Context, virtualKeyID string) ([]tables.TableVirtualKeyMCPConfig, error)
	CreateVirtualKeyMCPConfig(ctx context.Context, virtualKeyMCPConfig *tables.TableVirtualKeyMCPConfig, tx ...*gorm.DB) error
	UpdateVirtualKeyMCPConfig(ctx context.Context, virtualKeyMCPConfig *tables.TableVirtualKeyMCPConfig, tx ...*gorm.DB) error
	DeleteVirtualKeyMCPConfig(ctx context.Context, id uint, tx ...*gorm.DB) error

	// Team CRUD
	GetTeams(ctx context.Context, customerID string) ([]tables.TableTeam, error)
	GetTeam(ctx context.Context, id string) (*tables.TableTeam, error)
	CreateTeam(ctx context.Context, team *tables.TableTeam, tx ...*gorm.DB) error
	UpdateTeam(ctx context.Context, team *tables.TableTeam, tx ...*gorm.DB) error
	DeleteTeam(ctx context.Context, id string) error

	// Customer CRUD
	GetCustomers(ctx context.Context) ([]tables.TableCustomer, error)
	GetCustomer(ctx context.Context, id string) (*tables.TableCustomer, error)
	CreateCustomer(ctx context.Context, customer *tables.TableCustomer, tx ...*gorm.DB) error
	UpdateCustomer(ctx context.Context, customer *tables.TableCustomer, tx ...*gorm.DB) error
	DeleteCustomer(ctx context.Context, id string) error

	// Rate limit CRUD
	GetRateLimit(ctx context.Context, id string) (*tables.TableRateLimit, error)
	CreateRateLimit(ctx context.Context, rateLimit *tables.TableRateLimit, tx ...*gorm.DB) error
	UpdateRateLimit(ctx context.Context, rateLimit *tables.TableRateLimit, tx ...*gorm.DB) error
	UpdateRateLimits(ctx context.Context, rateLimits []*tables.TableRateLimit, tx ...*gorm.DB) error

	// Budget CRUD
	GetBudgets(ctx context.Context) ([]tables.TableBudget, error)
	GetBudget(ctx context.Context, id string, tx ...*gorm.DB) (*tables.TableBudget, error)
	CreateBudget(ctx context.Context, budget *tables.TableBudget, tx ...*gorm.DB) error
	UpdateBudget(ctx context.Context, budget *tables.TableBudget, tx ...*gorm.DB) error
	UpdateBudgets(ctx context.Context, budgets []*tables.TableBudget, tx ...*gorm.DB) error

	// Governance config CRUD
	GetGovernanceConfig(ctx context.Context) (*GovernanceConfig, error)

	// Auth config CRUD
	GetAuthConfig(ctx context.Context) (*AuthConfig, error)
	UpdateAuthConfig(ctx context.Context, config *AuthConfig) error

	// Session CRUD
	GetSession(ctx context.Context, token string) (*tables.SessionsTable, error)
	CreateSession(ctx context.Context, session *tables.SessionsTable) error
	DeleteSession(ctx context.Context, token string) error

	// Model pricing CRUD
	GetModelPrices(ctx context.Context) ([]tables.TableModelPricing, error)
	CreateModelPrices(ctx context.Context, pricing *tables.TableModelPricing, tx ...*gorm.DB) error
	DeleteModelPrices(ctx context.Context, tx ...*gorm.DB) error

	// Key management
	GetKeysByIDs(ctx context.Context, ids []string) ([]tables.TableKey, error)
	GetAllRedactedKeys(ctx context.Context, ids []string) ([]schemas.Key, error) // leave ids empty to get all

	// Generic transaction manager
	ExecuteTransaction(ctx context.Context, fn func(tx *gorm.DB) error) error

	// DB returns the underlying database connection.
	DB() *gorm.DB

	// Migration manager
	RunMigration(ctx context.Context, migration *migrator.Migration) error

	// Cleanup
	Close(ctx context.Context) error
}

ConfigStore is the interface for the config store.

func NewConfigStore

func NewConfigStore(ctx context.Context, config *Config, logger schemas.Logger) (ConfigStore, error)

NewConfigStore creates a new config store based on the configuration

type ConfigStoreType

type ConfigStoreType string

ConfigStoreType represents the type of config store.

const (
	ConfigStoreTypeSQLite   ConfigStoreType = "sqlite"
	ConfigStoreTypePostgres ConfigStoreType = "postgres"
)

ConfigStoreTypeSQLite is the type of config store for SQLite.

type EnvKeyInfo

type EnvKeyInfo struct {
	EnvVar     string                // The environment variable name (without env. prefix)
	Provider   schemas.ModelProvider // The provider this key belongs to (empty for core/mcp configs)
	KeyType    EnvKeyType            // Type of key (e.g., "api_key", "azure_config", "vertex_config", "bedrock_config", "connection_string", "mcp_header")
	ConfigPath string                // Path in config where this env var is used
	KeyID      string                // The key ID this env var belongs to (empty for non-key configs like bedrock_config, connection_string)
}

EnvKeyInfo stores information about a key sourced from environment

type EnvKeyType

type EnvKeyType string
const (
	EnvKeyTypeAPIKey        EnvKeyType = "api_key"
	EnvKeyTypeAzureConfig   EnvKeyType = "azure_config"
	EnvKeyTypeVertexConfig  EnvKeyType = "vertex_config"
	EnvKeyTypeBedrockConfig EnvKeyType = "bedrock_config"
	EnvKeyTypeConnection    EnvKeyType = "connection_string"
	EnvKeyTypeMCPHeader     EnvKeyType = "mcp_header"
)

type GovernanceConfig

type GovernanceConfig struct {
	VirtualKeys []tables.TableVirtualKey `json:"virtual_keys"`
	Teams       []tables.TableTeam       `json:"teams"`
	Customers   []tables.TableCustomer   `json:"customers"`
	Budgets     []tables.TableBudget     `json:"budgets"`
	RateLimits  []tables.TableRateLimit  `json:"rate_limits"`
	AuthConfig  *AuthConfig              `json:"auth_config,omitempty"`
}

type PostgresConfig added in v1.1.0

type PostgresConfig struct {
	Host     string `json:"host"`
	Port     string `json:"port"`
	User     string `json:"user"`
	Password string `json:"password"`
	DBName   string `json:"db_name"`
	SSLMode  string `json:"ssl_mode"`
}

PostgresConfig represents the configuration for a Postgres database.

type ProviderConfig

type ProviderConfig struct {
	Keys                     []schemas.Key                     `json:"keys"`                                  // API keys for the provider with UUIDs
	NetworkConfig            *schemas.NetworkConfig            `json:"network_config,omitempty"`              // Network-related settings
	ConcurrencyAndBufferSize *schemas.ConcurrencyAndBufferSize `json:"concurrency_and_buffer_size,omitempty"` // Concurrency settings
	ProxyConfig              *schemas.ProxyConfig              `json:"proxy_config,omitempty"`                // Proxy configuration
	SendBackRawResponse      bool                              `json:"send_back_raw_response"`                // Include raw response in BifrostResponse
	CustomProviderConfig     *schemas.CustomProviderConfig     `json:"custom_provider_config,omitempty"`      // Custom provider configuration
}

ProviderConfig represents the configuration for a specific AI model provider. It includes API keys, network settings, and concurrency settings.

type RDBConfigStore added in v1.1.0

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

RDBConfigStore represents a configuration store that uses a relational database.

func (*RDBConfigStore) AddProvider added in v1.1.0

func (s *RDBConfigStore) AddProvider(ctx context.Context, provider schemas.ModelProvider, config ProviderConfig, envKeys map[string][]EnvKeyInfo) error

AddProvider creates a new provider configuration in the database.

func (*RDBConfigStore) Close added in v1.1.0

func (s *RDBConfigStore) Close(ctx context.Context) error

Close closes the SQLite config store.

func (*RDBConfigStore) CreateBudget added in v1.1.0

func (s *RDBConfigStore) CreateBudget(ctx context.Context, budget *tables.TableBudget, tx ...*gorm.DB) error

CreateBudget creates a new budget in the database.

func (*RDBConfigStore) CreateCustomer added in v1.1.0

func (s *RDBConfigStore) CreateCustomer(ctx context.Context, customer *tables.TableCustomer, tx ...*gorm.DB) error

CreateCustomer creates a new customer in the database.

func (*RDBConfigStore) CreateMCPClientConfig added in v1.1.10

func (s *RDBConfigStore) CreateMCPClientConfig(ctx context.Context, clientConfig schemas.MCPClientConfig, envKeys map[string][]EnvKeyInfo) error

CreateMCPClientConfig creates a new MCP client configuration in the database.

func (*RDBConfigStore) CreateModelPrices added in v1.1.0

func (s *RDBConfigStore) CreateModelPrices(ctx context.Context, pricing *tables.TableModelPricing, tx ...*gorm.DB) error

CreateModelPrices creates a new model pricing record in the database.

func (*RDBConfigStore) CreatePlugin added in v1.1.0

func (s *RDBConfigStore) CreatePlugin(ctx context.Context, plugin *tables.TablePlugin, tx ...*gorm.DB) error

func (*RDBConfigStore) CreateRateLimit added in v1.1.0

func (s *RDBConfigStore) CreateRateLimit(ctx context.Context, rateLimit *tables.TableRateLimit, tx ...*gorm.DB) error

CreateRateLimit creates a new rate limit in the database.

func (*RDBConfigStore) CreateSession added in v1.1.20

func (s *RDBConfigStore) CreateSession(ctx context.Context, session *tables.SessionsTable) error

CreateSession creates a new session in the database.

func (*RDBConfigStore) CreateTeam added in v1.1.0

func (s *RDBConfigStore) CreateTeam(ctx context.Context, team *tables.TableTeam, tx ...*gorm.DB) error

CreateTeam creates a new team in the database.

func (*RDBConfigStore) CreateVirtualKey added in v1.1.0

func (s *RDBConfigStore) CreateVirtualKey(ctx context.Context, virtualKey *tables.TableVirtualKey, tx ...*gorm.DB) error

func (*RDBConfigStore) CreateVirtualKeyMCPConfig added in v1.1.10

func (s *RDBConfigStore) CreateVirtualKeyMCPConfig(ctx context.Context, virtualKeyMCPConfig *tables.TableVirtualKeyMCPConfig, tx ...*gorm.DB) error

CreateVirtualKeyMCPConfig creates a new virtual key MCP config in the database.

func (*RDBConfigStore) CreateVirtualKeyProviderConfig added in v1.1.0

func (s *RDBConfigStore) CreateVirtualKeyProviderConfig(ctx context.Context, virtualKeyProviderConfig *tables.TableVirtualKeyProviderConfig, tx ...*gorm.DB) error

CreateVirtualKeyProviderConfig creates a new virtual key provider config in the database.

func (*RDBConfigStore) DB added in v1.1.5

func (s *RDBConfigStore) DB() *gorm.DB

DB returns the underlying database connection.

func (*RDBConfigStore) DeleteCustomer added in v1.1.0

func (s *RDBConfigStore) DeleteCustomer(ctx context.Context, id string) error

DeleteCustomer deletes a customer from the database.

func (*RDBConfigStore) DeleteMCPClientConfig added in v1.1.10

func (s *RDBConfigStore) DeleteMCPClientConfig(ctx context.Context, id string) error

DeleteMCPClientConfig deletes an MCP client configuration from the database.

func (*RDBConfigStore) DeleteModelPrices added in v1.1.0

func (s *RDBConfigStore) DeleteModelPrices(ctx context.Context, tx ...*gorm.DB) error

DeleteModelPrices deletes all model pricing records from the database.

func (*RDBConfigStore) DeletePlugin added in v1.1.0

func (s *RDBConfigStore) DeletePlugin(ctx context.Context, name string, tx ...*gorm.DB) error

func (*RDBConfigStore) DeleteProvider added in v1.1.0

func (s *RDBConfigStore) DeleteProvider(ctx context.Context, provider schemas.ModelProvider) error

DeleteProvider deletes a single provider and all its associated keys from the database.

func (*RDBConfigStore) DeleteSession added in v1.1.20

func (s *RDBConfigStore) DeleteSession(ctx context.Context, token string) error

DeleteSession deletes a session from the database.

func (*RDBConfigStore) DeleteTeam added in v1.1.0

func (s *RDBConfigStore) DeleteTeam(ctx context.Context, id string) error

DeleteTeam deletes a team from the database.

func (*RDBConfigStore) DeleteVirtualKey added in v1.1.0

func (s *RDBConfigStore) DeleteVirtualKey(ctx context.Context, id string) error

DeleteVirtualKey deletes a virtual key from the database.

func (*RDBConfigStore) DeleteVirtualKeyMCPConfig added in v1.1.10

func (s *RDBConfigStore) DeleteVirtualKeyMCPConfig(ctx context.Context, id uint, tx ...*gorm.DB) error

DeleteVirtualKeyMCPConfig deletes a virtual key provider config from the database.

func (*RDBConfigStore) DeleteVirtualKeyProviderConfig added in v1.1.0

func (s *RDBConfigStore) DeleteVirtualKeyProviderConfig(ctx context.Context, id uint, tx ...*gorm.DB) error

DeleteVirtualKeyProviderConfig deletes a virtual key provider config from the database.

func (*RDBConfigStore) ExecuteTransaction added in v1.1.0

func (s *RDBConfigStore) ExecuteTransaction(ctx context.Context, fn func(tx *gorm.DB) error) error

ExecuteTransaction executes a transaction.

func (*RDBConfigStore) GetAllRedactedKeys added in v1.1.24

func (s *RDBConfigStore) GetAllRedactedKeys(ctx context.Context, ids []string) ([]schemas.Key, error)

GetAllRedactedKeys retrieves all redacted keys from the database.

func (*RDBConfigStore) GetAuthConfig added in v1.1.20

func (s *RDBConfigStore) GetAuthConfig(ctx context.Context) (*AuthConfig, error)

GetAuthConfig retrieves the auth configuration from the database.

func (*RDBConfigStore) GetBudget added in v1.1.0

func (s *RDBConfigStore) GetBudget(ctx context.Context, id string, tx ...*gorm.DB) (*tables.TableBudget, error)

GetBudget retrieves a specific budget from the database.

func (*RDBConfigStore) GetBudgets added in v1.1.0

func (s *RDBConfigStore) GetBudgets(ctx context.Context) ([]tables.TableBudget, error)

GetBudgets retrieves all budgets from the database.

func (*RDBConfigStore) GetClientConfig added in v1.1.0

func (s *RDBConfigStore) GetClientConfig(ctx context.Context) (*ClientConfig, error)

GetClientConfig retrieves the client configuration from the database.

func (*RDBConfigStore) GetConfig added in v1.1.0

GetConfig retrieves a specific config from the database.

func (*RDBConfigStore) GetCustomer added in v1.1.0

func (s *RDBConfigStore) GetCustomer(ctx context.Context, id string) (*tables.TableCustomer, error)

GetCustomer retrieves a specific customer from the database.

func (*RDBConfigStore) GetCustomers added in v1.1.0

func (s *RDBConfigStore) GetCustomers(ctx context.Context) ([]tables.TableCustomer, error)

GetCustomers retrieves all customers from the database.

func (*RDBConfigStore) GetEnvKeys added in v1.1.0

func (s *RDBConfigStore) GetEnvKeys(ctx context.Context) (map[string][]EnvKeyInfo, error)

GetEnvKeys retrieves the environment keys from the database.

func (*RDBConfigStore) GetFrameworkConfig added in v1.1.8

func (s *RDBConfigStore) GetFrameworkConfig(ctx context.Context) (*tables.TableFrameworkConfig, error)

GetFrameworkConfig retrieves the framework configuration from the database.

func (*RDBConfigStore) GetGovernanceConfig added in v1.1.0

func (s *RDBConfigStore) GetGovernanceConfig(ctx context.Context) (*GovernanceConfig, error)

GetGovernanceConfig retrieves the governance configuration from the database.

func (*RDBConfigStore) GetKeysByIDs added in v1.1.0

func (s *RDBConfigStore) GetKeysByIDs(ctx context.Context, ids []string) ([]tables.TableKey, error)

GetKeysByIDs retrieves multiple keys by their IDs

func (*RDBConfigStore) GetLogsStoreConfig added in v1.1.0

func (s *RDBConfigStore) GetLogsStoreConfig(ctx context.Context) (*logstore.Config, error)

GetLogsStoreConfig retrieves the logs store configuration from the database.

func (*RDBConfigStore) GetMCPClientByName added in v1.1.10

func (s *RDBConfigStore) GetMCPClientByName(ctx context.Context, name string) (*tables.TableMCPClient, error)

GetMCPClientByName retrieves an MCP client by name from the database.

func (*RDBConfigStore) GetMCPConfig added in v1.1.0

func (s *RDBConfigStore) GetMCPConfig(ctx context.Context) (*schemas.MCPConfig, error)

GetMCPConfig retrieves the MCP configuration from the database.

func (*RDBConfigStore) GetModelPrices added in v1.1.0

func (s *RDBConfigStore) GetModelPrices(ctx context.Context) ([]tables.TableModelPricing, error)

GetModelPrices retrieves all model pricing records from the database.

func (*RDBConfigStore) GetPlugin added in v1.1.0

func (s *RDBConfigStore) GetPlugin(ctx context.Context, name string) (*tables.TablePlugin, error)

func (*RDBConfigStore) GetPlugins added in v1.1.0

func (s *RDBConfigStore) GetPlugins(ctx context.Context) ([]*tables.TablePlugin, error)

func (*RDBConfigStore) GetProvidersConfig added in v1.1.0

func (s *RDBConfigStore) GetProvidersConfig(ctx context.Context) (map[schemas.ModelProvider]ProviderConfig, error)

GetProvidersConfig retrieves the provider configuration from the database.

func (*RDBConfigStore) GetRateLimit added in v1.1.0

func (s *RDBConfigStore) GetRateLimit(ctx context.Context, id string) (*tables.TableRateLimit, error)

GetRateLimit retrieves a specific rate limit from the database.

func (*RDBConfigStore) GetRedactedVirtualKeys added in v1.1.24

func (s *RDBConfigStore) GetRedactedVirtualKeys(ctx context.Context, ids []string) ([]tables.TableVirtualKey, error)

func (*RDBConfigStore) GetSession added in v1.1.20

func (s *RDBConfigStore) GetSession(ctx context.Context, token string) (*tables.SessionsTable, error)

GetSession retrieves a session from the database.

func (*RDBConfigStore) GetTeam added in v1.1.0

func (s *RDBConfigStore) GetTeam(ctx context.Context, id string) (*tables.TableTeam, error)

GetTeam retrieves a specific team from the database.

func (*RDBConfigStore) GetTeams added in v1.1.0

func (s *RDBConfigStore) GetTeams(ctx context.Context, customerID string) ([]tables.TableTeam, error)

GetTeams retrieves all teams from the database.

func (*RDBConfigStore) GetVectorStoreConfig added in v1.1.0

func (s *RDBConfigStore) GetVectorStoreConfig(ctx context.Context) (*vectorstore.Config, error)

GetVectorStoreConfig retrieves the vector store configuration from the database.

func (*RDBConfigStore) GetVirtualKey added in v1.1.0

func (s *RDBConfigStore) GetVirtualKey(ctx context.Context, id string) (*tables.TableVirtualKey, error)

GetVirtualKey retrieves a virtual key from the database.

func (*RDBConfigStore) GetVirtualKeyByValue added in v1.1.0

func (s *RDBConfigStore) GetVirtualKeyByValue(ctx context.Context, value string) (*tables.TableVirtualKey, error)

GetVirtualKeyByValue retrieves a virtual key by its value

func (*RDBConfigStore) GetVirtualKeyMCPConfigs added in v1.1.10

func (s *RDBConfigStore) GetVirtualKeyMCPConfigs(ctx context.Context, virtualKeyID string) ([]tables.TableVirtualKeyMCPConfig, error)

GetVirtualKeyMCPConfigs retrieves all virtual key MCP configs from the database.

func (*RDBConfigStore) GetVirtualKeyProviderConfigs added in v1.1.0

func (s *RDBConfigStore) GetVirtualKeyProviderConfigs(ctx context.Context, virtualKeyID string) ([]tables.TableVirtualKeyProviderConfig, error)

GetVirtualKeyProviderConfigs retrieves all virtual key provider configs from the database.

func (*RDBConfigStore) GetVirtualKeys added in v1.1.0

func (s *RDBConfigStore) GetVirtualKeys(ctx context.Context) ([]tables.TableVirtualKey, error)

GetVirtualKeys retrieves all virtual keys from the database.

func (*RDBConfigStore) Ping added in v1.1.8

func (s *RDBConfigStore) Ping(ctx context.Context) error

Ping checks if the database is reachable.

func (*RDBConfigStore) RunMigration added in v1.1.5

func (s *RDBConfigStore) RunMigration(ctx context.Context, migration *migrator.Migration) error

RunMigration runs a migration.

func (*RDBConfigStore) UpdateAuthConfig added in v1.1.20

func (s *RDBConfigStore) UpdateAuthConfig(ctx context.Context, config *AuthConfig) error

UpdateAuthConfig updates the auth configuration in the database.

func (*RDBConfigStore) UpdateBudget added in v1.1.0

func (s *RDBConfigStore) UpdateBudget(ctx context.Context, budget *tables.TableBudget, tx ...*gorm.DB) error

UpdateBudget updates a budget in the database.

func (*RDBConfigStore) UpdateBudgets added in v1.1.0

func (s *RDBConfigStore) UpdateBudgets(ctx context.Context, budgets []*tables.TableBudget, tx ...*gorm.DB) error

UpdateBudgets updates multiple budgets in the database.

func (*RDBConfigStore) UpdateClientConfig added in v1.1.0

func (s *RDBConfigStore) UpdateClientConfig(ctx context.Context, config *ClientConfig) error

UpdateClientConfig updates the client configuration in the database.

func (*RDBConfigStore) UpdateConfig added in v1.1.0

func (s *RDBConfigStore) UpdateConfig(ctx context.Context, config *tables.TableGovernanceConfig, tx ...*gorm.DB) error

UpdateConfig updates a specific config in the database.

func (*RDBConfigStore) UpdateCustomer added in v1.1.0

func (s *RDBConfigStore) UpdateCustomer(ctx context.Context, customer *tables.TableCustomer, tx ...*gorm.DB) error

UpdateCustomer updates an existing customer in the database.

func (*RDBConfigStore) UpdateEnvKeys added in v1.1.0

func (s *RDBConfigStore) UpdateEnvKeys(ctx context.Context, keys map[string][]EnvKeyInfo) error

UpdateEnvKeys updates the environment keys in the database.

func (*RDBConfigStore) UpdateFrameworkConfig added in v1.1.8

func (s *RDBConfigStore) UpdateFrameworkConfig(ctx context.Context, config *tables.TableFrameworkConfig) error

UpdateFrameworkConfig updates the framework configuration in the database.

func (*RDBConfigStore) UpdateLogsStoreConfig added in v1.1.0

func (s *RDBConfigStore) UpdateLogsStoreConfig(ctx context.Context, config *logstore.Config) error

UpdateLogsStoreConfig updates the logs store configuration in the database.

func (*RDBConfigStore) UpdateMCPClientConfig added in v1.1.10

func (s *RDBConfigStore) UpdateMCPClientConfig(ctx context.Context, id string, clientConfig schemas.MCPClientConfig, envKeys map[string][]EnvKeyInfo) error

UpdateMCPClientConfig updates an existing MCP client configuration in the database.

func (*RDBConfigStore) UpdatePlugin added in v1.1.0

func (s *RDBConfigStore) UpdatePlugin(ctx context.Context, plugin *tables.TablePlugin, tx ...*gorm.DB) error

func (*RDBConfigStore) UpdateProvider added in v1.1.0

func (s *RDBConfigStore) UpdateProvider(ctx context.Context, provider schemas.ModelProvider, config ProviderConfig, envKeys map[string][]EnvKeyInfo) error

UpdateProvider updates a single provider configuration in the database without deleting/recreating.

func (*RDBConfigStore) UpdateProvidersConfig added in v1.1.0

func (s *RDBConfigStore) UpdateProvidersConfig(ctx context.Context, providers map[schemas.ModelProvider]ProviderConfig) error

UpdateProvidersConfig updates the client configuration in the database.

func (*RDBConfigStore) UpdateRateLimit added in v1.1.0

func (s *RDBConfigStore) UpdateRateLimit(ctx context.Context, rateLimit *tables.TableRateLimit, tx ...*gorm.DB) error

UpdateRateLimit updates a rate limit in the database.

func (*RDBConfigStore) UpdateRateLimits added in v1.1.0

func (s *RDBConfigStore) UpdateRateLimits(ctx context.Context, rateLimits []*tables.TableRateLimit, tx ...*gorm.DB) error

UpdateRateLimits updates multiple rate limits in the database.

func (*RDBConfigStore) UpdateTeam added in v1.1.0

func (s *RDBConfigStore) UpdateTeam(ctx context.Context, team *tables.TableTeam, tx ...*gorm.DB) error

UpdateTeam updates an existing team in the database.

func (*RDBConfigStore) UpdateVectorStoreConfig added in v1.1.0

func (s *RDBConfigStore) UpdateVectorStoreConfig(ctx context.Context, config *vectorstore.Config) error

UpdateVectorStoreConfig updates the vector store configuration in the database.

func (*RDBConfigStore) UpdateVirtualKey added in v1.1.0

func (s *RDBConfigStore) UpdateVirtualKey(ctx context.Context, virtualKey *tables.TableVirtualKey, tx ...*gorm.DB) error

func (*RDBConfigStore) UpdateVirtualKeyMCPConfig added in v1.1.10

func (s *RDBConfigStore) UpdateVirtualKeyMCPConfig(ctx context.Context, virtualKeyMCPConfig *tables.TableVirtualKeyMCPConfig, tx ...*gorm.DB) error

UpdateVirtualKeyMCPConfig updates a virtual key provider config in the database.

func (*RDBConfigStore) UpdateVirtualKeyProviderConfig added in v1.1.0

func (s *RDBConfigStore) UpdateVirtualKeyProviderConfig(ctx context.Context, virtualKeyProviderConfig *tables.TableVirtualKeyProviderConfig, tx ...*gorm.DB) error

UpdateVirtualKeyProviderConfig updates a virtual key provider config in the database.

type SQLiteConfig

type SQLiteConfig struct {
	Path string `json:"path"`
}

SQLiteConfig represents the configuration for a SQLite database.

Directories

Path Synopsis
Package tables contains the database tables for the configstore.
Package tables contains the database tables for the configstore.

Jump to

Keyboard shortcuts

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