config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigFile

func GetConfigFile() string

GetConfigFile returns the path to the config file being used

func GetEnvFile

func GetEnvFile() string

GetEnvFile returns the path to the env file being used

func InterpolateString

func InterpolateString(s string) string

InterpolateString interpolates environment variables in a string

Types

type Config

type Config struct {
	Database DatabaseConfig `yaml:"database"`
}

Config holds the complete application configuration

func LoadConfig

func LoadConfig(configFile, envFile string) (*Config, error)

LoadConfig loads configuration from files and environment variables

type DatabaseConfig

type DatabaseConfig struct {
	VectorDB VectorDBConfig `yaml:"vector_db"`
}

DatabaseConfig holds database configuration

type MockCollection

type MockCollection struct {
	Name        string `yaml:"name"`
	Type        string `yaml:"type"`
	Description string `yaml:"description"`
}

MockCollection represents a mock collection

type MockConfig

type MockConfig struct {
	Enabled            bool             `yaml:"enabled"`
	SimulateEmbeddings bool             `yaml:"simulate_embeddings"`
	EmbeddingDimension int              `yaml:"embedding_dimension"`
	Collections        []MockCollection `yaml:"collections"`
}

MockConfig holds mock database configuration

type VectorDBConfig

type VectorDBConfig struct {
	Type          VectorDBType        `yaml:"type"`
	WeaviateCloud WeaviateCloudConfig `yaml:"weaviate_cloud"`
	WeaviateLocal WeaviateLocalConfig `yaml:"weaviate_local"`
	Mock          MockConfig          `yaml:"mock"`
}

VectorDBConfig holds vector database configuration

type VectorDBType

type VectorDBType string

VectorDBType represents the type of vector database

const (
	VectorDBTypeCloud VectorDBType = "weaviate-cloud"
	VectorDBTypeLocal VectorDBType = "weaviate-local"
	VectorDBTypeMock  VectorDBType = "mock"
)

type WeaviateCloudConfig

type WeaviateCloudConfig struct {
	URL                string `yaml:"url"`
	APIKey             string `yaml:"api_key"`
	CollectionName     string `yaml:"collection_name"`
	CollectionNameTest string `yaml:"collection_name_test"`
}

WeaviateCloudConfig holds Weaviate Cloud configuration

type WeaviateLocalConfig

type WeaviateLocalConfig struct {
	URL                string `yaml:"url"`
	CollectionName     string `yaml:"collection_name"`
	CollectionNameTest string `yaml:"collection_name_test"`
}

WeaviateLocalConfig holds Weaviate Local configuration

Jump to

Keyboard shortcuts

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