Documentation
¶
Index ¶
- Variables
- func GetOrgID(ctx context.Context) (string, error)
- func HasOrgID(ctx context.Context) bool
- func MustGetOrgID(ctx context.Context) string
- func WithOrgID(ctx context.Context, orgID string) context.Context
- type ConfigManager
- func (m *ConfigManager) GetCustomConfig(ctx context.Context, key string) (interface{}, error)
- func (m *ConfigManager) GetDataStoreConfig(ctx context.Context) (map[string]interface{}, error)
- func (m *ConfigManager) GetLLMAPIKey(ctx context.Context, provider string) (string, error)
- func (m *ConfigManager) GetTenantConfig(ctx context.Context) (*TenantConfig, error)
- func (m *ConfigManager) GetVectorStoreConfig(ctx context.Context) (map[string]interface{}, error)
- func (m *ConfigManager) RegisterTenant(config *TenantConfig) error
- type TenantConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoOrgID is returned when no organization ID is found in the context ErrNoOrgID = errors.New("no organization ID found in context") )
View Source
var ( // ErrTenantNotFound is returned when a tenant is not found ErrTenantNotFound = errors.New("tenant not found") )
Functions ¶
func MustGetOrgID ¶
MustGetOrgID returns the organization ID from the context or panics
Types ¶
type ConfigManager ¶
type ConfigManager struct {
// contains filtered or unexported fields
}
ConfigManager manages tenant configurations
func NewConfigManager ¶
func NewConfigManager() *ConfigManager
NewConfigManager creates a new config manager
func (*ConfigManager) GetCustomConfig ¶
func (m *ConfigManager) GetCustomConfig(ctx context.Context, key string) (interface{}, error)
GetCustomConfig returns a custom configuration value
func (*ConfigManager) GetDataStoreConfig ¶
func (m *ConfigManager) GetDataStoreConfig(ctx context.Context) (map[string]interface{}, error)
GetDataStoreConfig returns the data store configuration
func (*ConfigManager) GetLLMAPIKey ¶
GetLLMAPIKey returns the API key for the given LLM provider
func (*ConfigManager) GetTenantConfig ¶
func (m *ConfigManager) GetTenantConfig(ctx context.Context) (*TenantConfig, error)
GetTenantConfig returns the configuration for a tenant
func (*ConfigManager) GetVectorStoreConfig ¶
func (m *ConfigManager) GetVectorStoreConfig(ctx context.Context) (map[string]interface{}, error)
GetVectorStoreConfig returns the vector store configuration
func (*ConfigManager) RegisterTenant ¶
func (m *ConfigManager) RegisterTenant(config *TenantConfig) error
RegisterTenant registers a new tenant
type TenantConfig ¶
type TenantConfig struct {
// OrgID is the organization ID
OrgID string
// LLMAPIKeys maps LLM provider names to API keys
LLMAPIKeys map[string]string
// VectorStoreConfig contains vector store configuration
VectorStoreConfig map[string]interface{}
// DataStoreConfig contains data store configuration
DataStoreConfig map[string]interface{}
// Custom contains custom configuration values
Custom map[string]interface{}
}
TenantConfig represents the configuration for a tenant
Click to show internal directories.
Click to hide internal directories.