config

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

internal/config/config.go

internal/config/types.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateDefault

func GenerateDefault(projectName, projectType string) ([]byte, error)

GenerateDefault generates a default configuration file content as a byte slice

func GetViper

func GetViper() *viper.Viper

GetViper returns the viper instance

func Init

func Init(cfgFile string) error

Init initializes the configuration

func Save

func Save() error

Save saves the current configuration to file

func TemplateConfig

func TemplateConfig(projectName, template string) string

TemplateConfig generates template-specific configurations

Types

type AIConfig

type AIConfig struct {
	Port    int      `yaml:"port" json:"port"`
	Models  []string `yaml:"models" json:"models"`
	Default string   `yaml:"default" json:"default"`
}

AIConfig represents AI service configuration

type CLIConfig

type CLIConfig struct {
	ShowServiceInfo bool `yaml:"show_service_info" json:"show_service_info"`
}

CLIConfig represents CLI configuration

type CacheConfig

type CacheConfig struct {
	Type            string `yaml:"type" json:"type"`
	Port            int    `yaml:"port" json:"port"`
	MaxMemory       string `yaml:"maxmemory" json:"maxmemory"`
	MaxMemoryPolicy string `yaml:"maxmemory_policy" json:"maxmemory_policy"`
	Persistence     bool   `yaml:"persistence" json:"persistence"`
}

CacheConfig represents cache service configuration

type CloudflareConfig

type CloudflareConfig struct {
	TunnelID    string `yaml:"tunnel_id,omitempty" json:"tunnel_id,omitempty"`
	Secret      string `yaml:"secret,omitempty" json:"secret,omitempty"`
	Credentials string `yaml:"credentials,omitempty" json:"credentials,omitempty"`
}

CloudflareConfig represents Cloudflare tunnel configuration

type Config

type Config struct {
	Version      string             `yaml:"version" json:"version"`
	Project      ProjectConfig      `yaml:"project" json:"project"`
	Services     ServicesConfig     `yaml:"services" json:"services"`
	Resources    ResourcesConfig    `yaml:"resources" json:"resources"`
	Connectivity ConnectivityConfig `yaml:"connectivity" json:"connectivity"`
	CLI          CLIConfig          `yaml:"cli" json:"cli"`
}

Config represents the main configuration structure

func Get

func Get() *Config

Get returns the current configuration

func GetDefaults

func GetDefaults() *Config

GetDefaults returns minimal default configuration

type ConnectivityConfig

type ConnectivityConfig struct {
	Enabled bool         `yaml:"enabled" json:"enabled"`
	MDNS    MDNSConfig   `yaml:"mdns" json:"mdns"`
	Tunnel  TunnelConfig `yaml:"tunnel" json:"tunnel"`
}

ConnectivityConfig represents connectivity configuration

type DatabaseConfig

type DatabaseConfig struct {
	Type       string   `yaml:"type" json:"type"`
	Version    string   `yaml:"version" json:"version"`
	Port       int      `yaml:"port" json:"port"`
	Extensions []string `yaml:"extensions,omitempty" json:"extensions,omitempty"`
}

DatabaseConfig represents database service configuration

type MDNSConfig

type MDNSConfig struct {
	Enabled bool `yaml:"enabled" json:"enabled"`
}

MDNSConfig represents mDNS configuration

type MongoDBConfig added in v0.2.0

type MongoDBConfig struct {
	Type        string `yaml:"type" json:"type"`
	Version     string `yaml:"version" json:"version"`
	Port        int    `yaml:"port" json:"port"`
	ReplicaSet  bool   `yaml:"replica_set" json:"replica_set"`
	AuthEnabled bool   `yaml:"auth_enabled" json:"auth_enabled"`
}

MongoDBConfig represents MongoDB service configuration

type NgrokConfig

type NgrokConfig struct {
	AuthToken string `yaml:"auth_token,omitempty" json:"auth_token,omitempty"`
}

NgrokConfig represents Ngrok tunnel configuration

type ProjectConfig

type ProjectConfig struct {
	Name       string   `yaml:"name" json:"name"`
	Type       string   `yaml:"type" json:"type"`
	Components []string `yaml:"components" json:"components"` // Seçilen componentler
}

ProjectConfig represents project configuration

type QueueConfig

type QueueConfig struct {
	Type            string `yaml:"type" json:"type"`
	Port            int    `yaml:"port" json:"port"`
	MaxMemory       string `yaml:"maxmemory" json:"maxmemory"`
	MaxMemoryPolicy string `yaml:"maxmemory_policy" json:"maxmemory_policy"`
	Persistence     bool   `yaml:"persistence" json:"persistence"`
	AppendOnly      bool   `yaml:"appendonly" json:"appendonly"`
	AppendFsync     string `yaml:"appendfsync" json:"appendfsync"`
}

QueueConfig represents queue service configuration

type ResourcesConfig

type ResourcesConfig struct {
	MemoryLimit string `yaml:"memory_limit" json:"memory_limit"`
	CPULimit    string `yaml:"cpu_limit" json:"cpu_limit"`
}

ResourcesConfig represents resource limits configuration

type ServicesConfig

type ServicesConfig struct {
	AI       AIConfig       `yaml:"ai" json:"ai"`
	Database DatabaseConfig `yaml:"database" json:"database"`
	MongoDB  MongoDBConfig  `yaml:"mongodb" json:"mongodb"`
	Cache    CacheConfig    `yaml:"cache" json:"cache"`
	Queue    QueueConfig    `yaml:"queue" json:"queue"`
	Storage  StorageConfig  `yaml:"storage" json:"storage"`
	Whisper  WhisperConfig  `yaml:"whisper" json:"whisper"` // Bu satırı ekle
}

ServicesConfig represents all services configuration

type StorageConfig

type StorageConfig struct {
	Type    string `yaml:"type" json:"type"`
	Port    int    `yaml:"port" json:"port"`
	Console int    `yaml:"console" json:"console"`
}

StorageConfig represents storage service configuration

type TunnelConfig

type TunnelConfig struct {
	Provider   string           `yaml:"provider" json:"provider"`
	Persist    bool             `yaml:"persist,omitempty" json:"persist,omitempty"`
	Domain     string           `yaml:"domain,omitempty" json:"domain,omitempty"`
	TargetURL  string           `yaml:"target_url,omitempty" json:"target_url,omitempty"`
	Cloudflare CloudflareConfig `yaml:"cloudflare,omitempty" json:"cloudflare,omitempty"`
	Ngrok      NgrokConfig      `yaml:"ngrok,omitempty" json:"ngrok,omitempty"`
}

TunnelConfig represents tunnel configuration

type WhisperConfig

type WhisperConfig struct {
	Type  string `yaml:"type" json:"type"`
	Port  int    `yaml:"port" json:"port"`
	Model string `yaml:"model" json:"model"`
}

Jump to

Keyboard shortcuts

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