config

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDotEnv

func LoadDotEnv(filenames ...string) error

LoadDotEnv 从指定文件加载 .env 到进程环境变量。 不传文件名时默认查找 ./.env 和 ../.env。 已存在的环境变量不会被覆盖。

Types

type Config

type Config struct {
	Host                           string
	Port                           int
	Debug                          bool
	ProjectName                    string
	LogLevel                       string
	LogFormat                      string
	LogPath                        string
	LogStdout                      bool
	LogNoColor                     bool
	LogFileEnabled                 bool
	LogRotateDaily                 bool
	LogMaxSizeMB                   int
	LogMaxAgeDays                  int
	LogMaxBackups                  int
	LogCompress                    bool
	MessageDebugStreamEvent        bool
	APIPrefix                      string
	WebSocketPath                  string
	DefaultAgentID                 string
	DefaultTimezone                string
	WorkspacePath                  string
	CacheFileDir                   string
	WebDistDir                     string
	AppMode                        string
	DesktopSessionToken            string
	SkillsAPIURL                   string
	SkillsSourceURLs               string
	SkillsDefaultSourcesEnabled    bool
	SkillsAPISearchLimit           int
	DatabaseDriver                 string
	DatabaseURL                    string
	AccessToken                    string
	AuthSessionCookieName          string
	AuthCookieSameSite             string
	AuthCookieSecure               bool
	AuthSessionTTLHours            int
	BaseSystemPrompt               string
	MainAgentSystemPrompt          string
	MemoryEnabled                  bool
	MemoryAutoRecall               bool
	MemoryAutoExtract              bool
	MemoryMaxResults               int
	MemoryScoreThreshold           float64
	DiscordEnabled                 bool
	DiscordBotToken                string
	TelegramEnabled                bool
	TelegramBotToken               string
	ConnectorOAuthRedirectURI      string
	ConnectorOAuthAllowedOrigins   []string
	AllowedWebSocketOrigins        []string
	ConnectorOAuthStateTTLSeconds  int
	AutomationRunTimeoutSeconds    int
	ConnectorCredentialsKey        string
	ConnectorGitHubClientID        string
	ConnectorGitHubClientSecret    string
	ConnectorGoogleClientID        string
	ConnectorGoogleClientSecret    string
	ConnectorLinkedInClientID      string
	ConnectorLinkedInClientSecret  string
	ConnectorTwitterClientID       string
	ConnectorTwitterClientSecret   string
	ConnectorInstagramClientID     string
	ConnectorInstagramClientSecret string
	ConnectorShopifyClientID       string
	ConnectorShopifyClientSecret   string
}

Config 承载 Go 服务运行时配置。

func Load

func Load() Config

Load 读取环境变量并构建配置。

func (Config) Address

func (c Config) Address() string

Address 返回 http 服务监听地址。

Jump to

Keyboard shortcuts

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