Documentation
¶
Index ¶
Constants ¶
View Source
const ( BATCH_SIZE_DATABASE = 1_000 BATCH_SIZE_CACHE = 10_000 CENTROID_SIZE = 10_000 SAMPLE_SIZE = 5 * BATCH_SIZE_CACHE SPLIT_SIZE = 5 SUPERSET_MUL = 5 KMEANS_ITTERATION_LIMIT = 1_000 CACHE_DURATION = 5 * time.Second CACHE_CLEANUP = 15 * time.Second HTTP_CLIENT_MAX_REQUESTS uint64 = 500 )
Variables ¶
This section is empty.
Functions ¶
func CreateSample ¶
CreateSample creates a sample configuration file.
Types ¶
type Config ¶
type Config struct { Server ConfigServer `json:"server"` TLS ConfigTLS `json:"tls"` Database Database `json:"database"` Ollama AI `json:"ollama"` OpenAI AI `json:"openai"` LogLevel LogLevel `json:"log_level"` }
func ParseConfig ¶
ParseConfig parses the raw JSON configuration.
type ConfigServer ¶
type ConfigTLS ¶
type ConfigTLS struct { DomainNameServer []string `json:"dns"` IP []string `json:"ip"` Certificates []*ConfigTLSPath `json:"certificates"` // contains filtered or unexported fields }
func (*ConfigTLS) Configurate ¶
Configurate initialize the tls configuration.
func (*ConfigTLS) GetCertificate ¶
func (t *ConfigTLS) GetCertificate(clientHello *tls.ClientHelloInfo) (*tls.Certificate, error)
GetCertificate returns the first client supported certificate.
type ConfigTLSPath ¶
type Database ¶
type Database struct { Sqlite string `json:"sqlite"` Postgres SingleOrSlice[string] `json:"postgres"` PostgresReadOnly SingleOrSlice[string] `json:"postgres_readonly"` LogLevel LogLevel `json:"log_level"` // 0: Silent, 1: Error, 2: Warn, 3: Info, 4: Debug Cache string `json:"cache"` }
func (Database) GetDialectors ¶
func (c Database) GetDialectors() (readwrite, readonly []gorm.Dialector, dbProvider DatabaseProvider)
type DatabaseProvider ¶
type DatabaseProvider uint8
const ( DatabaseProvider_Sqlite DatabaseProvider = iota + 1 DatabaseProvider_PostgreSQL )
type Provider ¶
type SingleOrSlice ¶
type SingleOrSlice[T any] []T
SingleOrSlice allows for a configuration field to be either a single value or a slice of values.
func (SingleOrSlice[T]) MarshalJSON ¶
func (s SingleOrSlice[T]) MarshalJSON() ([]byte, error)
MarshalJSON ensures that the field is marshaled correctly whether it's a single value or a slice.
func (*SingleOrSlice[T]) UnmarshalJSON ¶
func (s *SingleOrSlice[T]) UnmarshalJSON(data []byte) error
UnmarshalJSON handles both single values and slices for the field.
Click to show internal directories.
Click to hide internal directories.