config

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientConfig

type ClientConfig struct {
	Enabled bool `hcl:"enabled,optional"`
}

func (*ClientConfig) ValidateConfig

func (c *ClientConfig) ValidateConfig() error

type Config

type Config struct {
	LogLevel     string   `hcl:"log_level,optional"`
	PoolName     string   `hcl:"pool_name,optional"`
	PluginDir    string   `hcl:"plugin_dir,optional"`
	EmbedPlugins []string `hcl:"embed_plugins,optional"`

	Server    *ServerConfig    `hcl:"server,block"`
	Client    *ClientConfig    `hcl:"client,block"`
	Metrics   *MetricsConfig   `hcl:"metrics,block"`
	Telemetry *TelemetryConfig `hcl:"telemetry,block"`
	Redis     *RedisConfig     `hcl:"redis,block"`
	Ollama    *OllamaConfig    `hcl:"ollama,block"`

	Plugins []*PluginConfig `hcl:"plugin,block"`
}

func CreateDefault

func CreateDefault() *Config

func ParseConfig

func ParseConfig(path string) (*Config, error)

func (*Config) GetPluginConfig

func (c *Config) GetPluginConfig(name string) *PluginConfig

func (*Config) GetPluginConfigMap

func (cfg *Config) GetPluginConfigMap(name string) (map[string]interface{}, error)

func (*Config) ValidateConfig

func (c *Config) ValidateConfig() error

type KafkaConfig

type KafkaConfig struct {
	Network   string `hcl:"network,optional"`
	Address   string `hcl:"address,optional"`
	Topics    string `hcl:"topics,optional"`
	Partition int    `hcl:"partition,optional"`
}

func (*KafkaConfig) ValidateConfig

func (c *KafkaConfig) ValidateConfig() error

type MetricsConfig

type MetricsConfig struct {
	Enabled bool   `hcl:"enabled,optional"`
	Address string `hcl:"address,optional"`
}

func (*MetricsConfig) ValidateConfig

func (c *MetricsConfig) ValidateConfig() error

type OllamaConfig

type OllamaConfig struct {
	Endpoint string `hcl:"endpoint,optional"`
	Model    string `hcl:"model,optional"`
}

func (*OllamaConfig) ValidateConfig

func (c *OllamaConfig) ValidateConfig() error

type PluginConfig

type PluginConfig struct {
	Name    string            `hcl:"name,label"`
	Enabled bool              `hcl:"enabled,optional"`
	Config  *PluginConfigBody `hcl:"config,block"`
}

func (*PluginConfig) ValidatePluginConfig

func (c *PluginConfig) ValidatePluginConfig() error

type PluginConfigBody

type PluginConfigBody struct {
	Body hcl.Body `hcl:",remain"`
}

type RedisConfig

type RedisConfig struct {
	Endpoint string `hcl:"endpoint,optional"`
	Database int    `hcl:"database,optional"`
	Password string `hcl:"password,optional"`
}

func (*RedisConfig) ValidateConfig

func (c *RedisConfig) ValidateConfig() error

type ServerConfig

type ServerConfig struct {
	Enabled bool   `hcl:"enabled,optional"`
	Address string `hcl:"address,optional"`
	Token   string `hcl:"token,optional"`
}

func (*ServerConfig) ValidateConfig

func (c *ServerConfig) ValidateConfig() error

type TelemetryConfig

type TelemetryConfig struct {
	Enabled     bool   `hcl:"enabled,optional"`
	Endpoint    string `hcl:"endpoint,optional"`
	ServiceName string `hcl:"servicename,optional"`
}

func (*TelemetryConfig) ValidateConfig

func (c *TelemetryConfig) ValidateConfig() error

Jump to

Keyboard shortcuts

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