Documentation
¶
Index ¶
- Constants
- func CacheDir() string
- func ConfigDir() string
- func StateDir() string
- type Config
- func (c *Config) LocalConfig() *LocalConfig
- func (c *Config) SaveAccountID(accountID string) error
- func (c *Config) SaveBaseURL(baseURL string) error
- func (c *Config) SetFromFlag(key, value string) error
- func (c *Config) SourceOf(key string) Source
- func (c *Config) TrustLocalConfig() error
- func (c *Config) UntrustLocalConfig() error
- func (c *Config) UntrustedLocalConfig() *LocalConfig
- func (c *Config) Values() []Value
- type LocalConfig
- type OldConfig
- type Source
- type TrustedLocalConfig
- type Value
Constants ¶
const (
AllAccounts = "all"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
BaseURL string `json:"base_url"`
AccountID string `json:"account_id,omitempty"`
// contains filtered or unexported fields
}
func (*Config) LocalConfig ¶
func (c *Config) LocalConfig() *LocalConfig
LocalConfig returns the discovered local configuration and its trust status.
func (*Config) SaveAccountID ¶
SaveAccountID stores the default linked-account filter for the effective server without replacing settings for any other server.
func (*Config) SaveBaseURL ¶
SaveBaseURL stores the global server URL while preserving account defaults for every server.
func (*Config) SetFromFlag ¶
func (*Config) TrustLocalConfig ¶
TrustLocalConfig trusts the current security-sensitive values in the discovered local configuration. A later change produces a different digest and requires trust again.
func (*Config) UntrustLocalConfig ¶
UntrustLocalConfig removes trust for the discovered local configuration.
func (*Config) UntrustedLocalConfig ¶
func (c *Config) UntrustedLocalConfig() *LocalConfig
UntrustedLocalConfig returns the local configuration when one of its values is effective for this invocation and the user has not trusted its current contents.
type LocalConfig ¶
type LocalConfig struct {
Path string `json:"path"`
BaseURL string `json:"base_url,omitempty"`
AccountID string `json:"account_id,omitempty"`
ServerOrigin string `json:"server_origin"`
Digest string `json:"digest"`
Trusted bool `json:"trusted"`
}
LocalConfig describes the security-sensitive settings supplied by the nearest repository-local .hey/config.json file.
type OldConfig ¶
type OldConfig struct {
BaseURL string `json:"base_url"`
AccessToken string `json:"access_token,omitempty"`
RefreshToken string `json:"refresh_token,omitempty"`
TokenExpiry int64 `json:"token_expiry,omitempty"`
ClientID string `json:"client_id,omitempty"`
ClientSecret string `json:"client_secret,omitempty"`
InstallID string `json:"install_id,omitempty"`
SessionCookie string `json:"session_cookie,omitempty"`
}
OldConfig represents the legacy config format with embedded credentials. Used only for migration.
type TrustedLocalConfig ¶
type TrustedLocalConfig struct {
Path string `json:"path"`
ServerOrigin string `json:"server_origin"`
BaseURL string `json:"base_url,omitempty"`
AccountID string `json:"account_id,omitempty"`
Digest string `json:"digest"`
}
TrustedLocalConfig identifies a repository-local configuration trusted by this user.
func TrustedLocalConfigs ¶
func TrustedLocalConfigs() ([]TrustedLocalConfig, error)
TrustedLocalConfigs returns the local configurations trusted in user-level config.