Help us shape the future of Go! Take the 2026 Go Developer Survey

servercfg

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 5108
	MinPort     = 1024
	MaxPort     = 32767
)

Variables

This section is empty.

Functions

func ValidateToken

func ValidateToken(token string) error

Types

type Local

type Local struct {
	Enabled      bool     `json:"enabled"`
	Port         int      `json:"port"`
	AllowedTools []string `json:"allowed_tools"`
}

func (Local) Validate

func (c Local) Validate() error

type State

type State struct {
	Local      Local  `json:"local"`
	LocalToken string `json:"local_token"`
}

func (State) Validate

func (s State) Validate() error

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store 将 MCP 配置与凭据作为一个加密快照提交,避免跨文件更新留下半份授权。 与 LLM 配置共用应用固定密钥;调用方负责串行化 Load/Save。

func NewStore

func NewStore(path string) *Store

func (*Store) Load

func (s *Store) Load() (State, error)

func (*Store) Save

func (s *Store) Save(state State) error

Jump to

Keyboard shortcuts

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