Documentation
¶
Overview ¶
Package userconfig stores non-secret, per-profile settings that survive between runs: where the OAuth client JSON lives, which account was logged in, and where the refresh token was stored. It lives at os.UserConfigDir()/google-docs-mcp (override with GDOCS_CONFIG_DIR); a non-default profile lives under profiles/<name>/ below that.
Index ¶
- Constants
- Variables
- func BaseDir() (string, error)
- func DefaultClientSecretPath(profile string) (string, error)
- func Path(profile string) (string, error)
- func ProfileDir(profile string) (string, error)
- func Remove(profile string) error
- func Save(profile string, c Config) error
- func TokenFilePath(profile string) (string, error)
- type Config
Constants ¶
const AppDir = "google-docs-mcp"
AppDir is the directory name under the user's config directory.
const DefaultProfile = "default"
DefaultProfile is the profile used when none is named.
const EnvDir = "GDOCS_CONFIG_DIR"
EnvDir overrides the base directory (tests, unusual setups).
Variables ¶
var ErrNotFound = errors.New("userconfig: no config file for this profile; run `google-docs-mcp login`")
ErrNotFound is returned when the profile has no config file yet.
Functions ¶
func DefaultClientSecretPath ¶
DefaultClientSecretPath is where `login` looks for the OAuth client JSON when no path is given.
func ProfileDir ¶
ProfileDir returns the directory holding one profile's files.
func TokenFilePath ¶
TokenFilePath is the plaintext fallback location for the refresh token.
Types ¶
type Config ¶
type Config struct {
ClientSecretPath string `json:"client_secret_path,omitempty"`
AccountEmail string `json:"account_email,omitempty"`
TokenStore string `json:"token_store,omitempty"`
Scopes []string `json:"scopes,omitempty"`
UpdatedAt time.Time `json:"updated_at"`
}
Config is the stored, non-secret profile state.