config

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	MCPBeeBasePath    = "/mcp/bee"
	MCPWorkerBasePath = "/mcp/worker"
)

MCP endpoint path prefixes.

Variables

View Source
var ConfigTemplate string

Functions

func DefaultBeeWorkDir

func DefaultBeeWorkDir() string

DefaultBeeWorkDir returns the hardcoded bee working directory: ~/.openbee/bee

func DefaultLogsDir added in v0.0.4

func DefaultLogsDir() string

DefaultLogsDir returns the execution log directory: ~/.openbee/logs

func DefaultWorkerBaseDir

func DefaultWorkerBaseDir() string

DefaultWorkerBaseDir returns the hardcoded worker base directory: ~/.openbee/worker

func GetLang added in v0.0.14

func GetLang(path string) string

GetLang reads the language field from the config file at path. Returns empty string if the file does not exist, cannot be parsed, or does not contain a language field. Never returns an error — callers fall back to the next priority in the detection chain.

Types

type AuthConfig added in v0.0.8

type AuthConfig struct {
	Username        string        `yaml:"username"`          // login username; default "admin"
	Password        string        `yaml:"password"`          // login password; empty = auto-generated on startup
	JWTSecret       string        `yaml:"jwt_secret"`        // HMAC-SHA256 secret; empty = auto-generated on startup
	AccessTokenTTL  time.Duration `yaml:"access_token_ttl"`  // access token lifetime; default 2h
	RefreshTokenTTL time.Duration `yaml:"refresh_token_ttl"` // refresh token lifetime; default 7d
}

type BeeConfig

type BeeConfig struct {
	MessageDebounce time.Duration   `yaml:"message_debounce"`
	Claude          ClaudeConfig    `yaml:"claude"`
	Feeder          FeederConfig    `yaml:"feeder"`
	Platforms       PlatformsConfig `yaml:"platforms"`
	MCP             MCPConfig       `yaml:"mcp"`
	Media           MediaConfig     `yaml:"media"`

	// Derived fields — not in YAML, computed by Load()
	MCPBaseURL string `yaml:"-"` // http://host:port (no path suffix)
}

type ClaudeConfig

type ClaudeConfig struct {
	Path    string        `yaml:"path"`
	Timeout time.Duration `yaml:"timeout"`
}

type Config

type Config struct {
	Language string         `yaml:"language"`
	Server   ServerConfig   `yaml:"server"`
	Database DatabaseConfig `yaml:"database"`
	Bee      BeeConfig      `yaml:"bee"`
}

func Load

func Load(path string) (Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Path string `yaml:"path"`
}

type DingTalkConfig

type DingTalkConfig struct {
	Enabled      bool   `yaml:"enabled"`
	ClientID     string `yaml:"client_id"`
	ClientSecret string `yaml:"client_secret"`
}

type FeederConfig

type FeederConfig struct {
	Timeout          time.Duration `yaml:"timeout"`
	MaxConcurrentBee int           `yaml:"max_concurrent_bee"`
}

type FeishuConfig

type FeishuConfig struct {
	Enabled      bool   `yaml:"enabled"`
	AppID        string `yaml:"app_id"`
	AppSecret    string `yaml:"app_secret"`
	MaxMediaSize int    `yaml:"max_media_size"` // 最大媒体下载大小(字节),默认 100MB
}

type MCPConfig

type MCPConfig struct {
	APIKey       string `yaml:"api_key"`
	WorkerAPIKey string `yaml:"worker_api_key"`
}

type MediaConfig

type MediaConfig struct {
	FFprobePath string `yaml:"ffprobe_path"`
	FFmpegPath  string `yaml:"ffmpeg_path"`
}

type PlatformsConfig

type PlatformsConfig struct {
	Feishu   FeishuConfig   `yaml:"feishu"`
	DingTalk DingTalkConfig `yaml:"dingtalk"`
	WeCom    WeComConfig    `yaml:"wecom"`
	Telegram TelegramConfig `yaml:"telegram"`
	Weixin   WeixinConfig   `yaml:"weixin"`
}

type ServerConfig

type ServerConfig struct {
	Port  int        `yaml:"port"`
	Host  string     `yaml:"host"`
	Debug bool       `yaml:"debug"`
	Auth  AuthConfig `yaml:"auth"`
}

type TelegramConfig added in v0.0.5

type TelegramConfig struct {
	Enabled      bool   `yaml:"enabled"`
	Token        string `yaml:"token"`
	MaxMediaSize int    `yaml:"max_media_size"` // bytes; default 50MB
	AuthCode     string `yaml:"auth_code"`      // passcode for user authorization; empty = no auth required
}

type WeComConfig

type WeComConfig struct {
	Enabled      bool   `yaml:"enabled"`
	BotID        string `yaml:"bot_id"`
	Secret       string `yaml:"secret"`
	WebSocketURL string `yaml:"websocket_url"`
}

type WeixinConfig added in v0.0.6

type WeixinConfig struct {
	Enabled      bool   `yaml:"enabled"`
	Token        string `yaml:"token"`
	BaseURL      string `yaml:"base_url"`
	CDNBaseURL   string `yaml:"cdn_base_url"`
	RouteTag     int    `yaml:"route_tag"`
	UserID       string `yaml:"user_id"`
	MaxMediaSize int    `yaml:"max_media_size"` // bytes; default 100MB
}

Jump to

Keyboard shortcuts

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