config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseConfig

type DatabaseConfig struct {
	Type       string `yaml:"type"` // mysql, postgresql
	Image      string `yaml:"image"`
	Port       int    `yaml:"port"`
	Container  string `yaml:"container"` // service name in docker-compose
	InitScript string `yaml:"init_script"`
	Database   string `yaml:"database"`
	Username   string `yaml:"username"`
	Password   string `yaml:"password"`
}

DatabaseConfig defines database requirements

type DependencyConfig

type DependencyConfig struct {
	Name    string            `yaml:"name"`
	Type    string            `yaml:"type"` // http, database
	Host    string            `yaml:"host"`
	Port    int               `yaml:"port"`
	Proxy   bool              `yaml:"proxy"` // Whether to mock this dependency
	Headers map[string]string `yaml:"headers,omitempty"`
}

DependencyConfig defines external service dependencies

type EmbeddingConfig added in v1.3.0

type EmbeddingConfig struct {
	Provider            string  `yaml:"provider"`             // voyage, openai, etc.
	IndexModel          string  `yaml:"index_model"`          // e.g., voyage-4-large (for indexing documents at 2048 dims)
	QueryModel          string  `yaml:"query_model"`          // e.g., voyage-4-lite (for queries at 2048 dims)
	APIKey              string  `yaml:"api_key"`              // Can be "${ENV_VAR_NAME}" or literal
	SimilarityThreshold float64 `yaml:"similarity_threshold"` // default: 0.50
	IndexOnComplete     bool    `yaml:"index_on_complete"`    // default: true
}

EmbeddingConfig defines the embedding API configuration

type InfrastructureConfig

type InfrastructureConfig struct {
	Kafka      bool `yaml:"kafka"`
	Database   bool `yaml:"database"`
	Redis      bool `yaml:"redis"`
	ExternalDB bool `yaml:"external_db"` // Don't manage DB, service has its own
}

InfrastructureConfig defines required infrastructure

type LineSpecConfig

type LineSpecConfig struct {
	Service        ServiceConfig        `yaml:"service"`
	Database       *DatabaseConfig      `yaml:"database,omitempty"`
	Infrastructure InfrastructureConfig `yaml:"infrastructure"`
	Dependencies   []DependencyConfig   `yaml:"dependencies,omitempty"`
	Provenance     *ProvenanceConfig    `yaml:"provenance,omitempty"`
	Created        time.Time            `yaml:"-"`
	BaseDir        string               `yaml:"-"`
}

LineSpecConfig is the root configuration structure

func DefaultConfig

func DefaultConfig(framework string) *LineSpecConfig

Default configurations for common frameworks

func LoadConfig

func LoadConfig(startDir string) (*LineSpecConfig, error)

LoadConfig searches for .linespec.yml starting from the given directory and walking up to parent directories

func LoadConfigFile

func LoadConfigFile(path string) (*LineSpecConfig, error)

LoadConfigFile loads a specific .linespec.yml file

func (*LineSpecConfig) GetDockerComposePath

func (c *LineSpecConfig) GetDockerComposePath() string

GetDockerComposePath returns the absolute path to docker-compose.yml

func (*LineSpecConfig) GetHealthURL

func (c *LineSpecConfig) GetHealthURL(hostPort string) string

GetHealthURL returns the full health check URL

type ProvenanceConfig

type ProvenanceConfig struct {
	Enforcement       string           `yaml:"enforcement"`         // none | warn | strict
	Dir               string           `yaml:"dir"`                 // relative to repo root
	SharedRepos       []string         `yaml:"shared_repos"`        // paths or URLs to shared provenance repositories
	CommitTagRequired bool             `yaml:"commit_tag_required"` // whether commits must reference a prov ID
	AutoAffectedScope bool             `yaml:"auto_affected_scope"` // whether to auto-populate affected_scope from git diffs
	Embedding         *EmbeddingConfig `yaml:"embedding,omitempty"` // embedding API configuration
}

ProvenanceConfig defines provenance record settings

type ServiceConfig

type ServiceConfig struct {
	Name           string            `yaml:"name"`
	ServiceDir     string            `yaml:"service_dir"` // Directory containing service code (e.g., "user-service")
	Type           string            `yaml:"type"`        // web, worker, consumer
	Framework      string            `yaml:"framework"`
	Port           int               `yaml:"port"`
	HealthEndpoint string            `yaml:"health_endpoint"`
	DockerCompose  string            `yaml:"docker_compose"`
	BuildContext   string            `yaml:"build_context"`
	StartCommand   string            `yaml:"start_command"`
	Environment    map[string]string `yaml:"environment"`
}

Jump to

Keyboard shortcuts

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