Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CookieJarPath ¶ added in v0.10.0
CookieJarPath returns the path used for persisted API affinity cookies.
func HashAPIKey ¶ added in v0.6.0
HashAPIKey returns the hex-encoded SHA-256 of an API key.
Types ¶
type Config ¶
type Config struct {
Version int `json:"v,omitempty"`
SessionToken string `json:"session_token,omitempty"`
SessionOrgID string `json:"session_org_id,omitempty"`
APIKeyOrgs map[string]string `json:"api_key_orgs,omitempty"` // sha256(apiKey) -> orgID
}
func Load ¶
Load reads the config file. Returns a zero-value Config if the file does not exist or has an outdated version (the stale file is deleted automatically).
func (*Config) OrgIDForAPIKey ¶ added in v0.6.0
OrgIDForAPIKey looks up the cached org ID for the given API key.
func (*Config) SetOrgIDForAPIKey ¶ added in v0.6.0
SetOrgIDForAPIKey caches an org ID for the given API key.
Click to show internal directories.
Click to hide internal directories.