Documentation
¶
Index ¶
- Constants
- func ErrorCode(err error) string
- func JudgmentEffectiveMode(mode string) string
- func SetValue(path, key, value string) error
- func UnsetValue(path, key string) error
- func Value(cfg Config, key string) (string, bool)
- type Config
- type EditorConfig
- type Error
- type JudgmentConfig
- type LoadOptions
- type LoadResult
- type MarkdownConfig
- type NoteConfig
- type OutputConfig
- type PathOptions
- type Paths
- type RemoteConfig
- type SearchConfig
- type SettingProjection
- type SourceSet
- type StorageConfig
- type ThemeSet
Constants ¶
View Source
const ( JudgmentModeOff = "off" JudgmentModeShadow = "shadow" JudgmentModeAssist = "assist" )
JudgmentModeOff 与 inboxjudgment 包的 off/shadow/assist 模式字面量一致; config 包不依赖实现包,字面量在此按合同钉住。
Variables ¶
This section is empty.
Functions ¶
func JudgmentEffectiveMode ¶ added in v0.3.0
JudgmentEffectiveMode 归一化显示/装配用的 judgment mode:空值按 off。
func UnsetValue ¶
Types ¶
type Config ¶
type Config struct {
Vault string `mapstructure:"vault" yaml:"vault" json:"vault,omitempty"`
Identity string `mapstructure:"identity" yaml:"identity" json:"identity,omitempty"`
Remote RemoteConfig `mapstructure:"remote" yaml:"remote" json:"remote"`
Output OutputConfig `mapstructure:"output" yaml:"output" json:"output"`
Editor EditorConfig `mapstructure:"editor" yaml:"editor" json:"editor"`
Note NoteConfig `mapstructure:"note" yaml:"note" json:"note"`
Search SearchConfig `mapstructure:"search" yaml:"search" json:"search"`
Storage StorageConfig `mapstructure:"storage" yaml:"storage" json:"storage"`
Themes ThemeSet `mapstructure:"themes" yaml:"themes" json:"themes"`
Markdown MarkdownConfig `mapstructure:"markdown" yaml:"markdown" json:"markdown"`
Judgment JudgmentConfig `mapstructure:"judgment" yaml:"judgment" json:"judgment"`
}
func DefaultConfig ¶
func DefaultConfig() Config
type EditorConfig ¶
type EditorConfig struct {
Command string `mapstructure:"command" yaml:"command" json:"command,omitempty"`
}
type JudgmentConfig ¶ added in v0.3.0
type JudgmentConfig struct {
Enabled bool `mapstructure:"enabled" yaml:"enabled" json:"enabled"`
Mode string `mapstructure:"mode" yaml:"mode" json:"mode"`
}
JudgmentConfig 是实验性(experimental)inbox judgment 开关面。默认零值 即完全休眠:enabled=false 且 mode=off,inbox 流程零 judgment 装配、零 transport 调用。mode=shadow/assist 必须显式 enabled=true,非法组合在 配置加载时 fail-fast 拒绝。启用模式所需的 transport、精确模型 pin 与 授权注入不来自配置文件:本节只保存开关,不保存、不发现凭据或 adapter。
type LoadOptions ¶
type LoadResult ¶
type LoadResult struct {
Config Config `json:"config"`
Sources SourceSet `json:"sources"`
Settings []SettingProjection `json:"settings,omitempty"`
}
func Load ¶
func Load(opts LoadOptions) (LoadResult, error)
type MarkdownConfig ¶
type NoteConfig ¶
type OutputConfig ¶
type OutputConfig struct {
Style string `mapstructure:"style" yaml:"style" json:"style"`
Color string `mapstructure:"color" yaml:"color" json:"color"`
Theme string `mapstructure:"theme" yaml:"theme" json:"theme"`
Width int `mapstructure:"width" yaml:"width" json:"width"`
Markdown MarkdownConfig `mapstructure:"markdown" yaml:"markdown" json:"markdown"`
}
type PathOptions ¶
type Paths ¶
func ResolvePaths ¶
func ResolvePaths(opts PathOptions) Paths
type RemoteConfig ¶
type SearchConfig ¶
type SettingProjection ¶ added in v0.1.3
type SettingProjection struct {
Key string `json:"key"`
Value string `json:"value"`
Source string `json:"source"`
Writable bool `json:"writable"`
WriteScope string `json:"write_scope"`
WritableScopes []string `json:"writable_scopes,omitempty"`
NextAction string `json:"next_action,omitempty"`
SecretRefBoundary string `json:"secret_ref_boundary,omitempty"`
}
type SourceSet ¶
type StorageConfig ¶
type StorageConfig struct {
Backend string `mapstructure:"backend" yaml:"backend" json:"backend,omitempty"`
Bucket string `mapstructure:"bucket" yaml:"bucket" json:"bucket,omitempty"`
Region string `mapstructure:"region" yaml:"region" json:"region,omitempty"`
Prefix string `mapstructure:"prefix" yaml:"prefix" json:"prefix,omitempty"`
Endpoint string `mapstructure:"endpoint" yaml:"endpoint" json:"endpoint,omitempty"`
Profile string `mapstructure:"profile" yaml:"profile" json:"profile,omitempty"`
Token string `mapstructure:"token" yaml:"token" json:"-"`
}
Click to show internal directories.
Click to hide internal directories.