Documentation
¶
Overview ¶
Package config resolves user configuration and environment overrides.
Index ¶
Constants ¶
View Source
const ( // DefaultBackend is the production Timestripe site root. DefaultBackend = "https://timestripe.com" // APIPath is the path suffix for v3 of the REST API. APIPath = "/api/v3" // OAuthAuthorizePath is the path suffix for the OAuth authorization endpoint. OAuthAuthorizePath = "/oauth/authorize/" // OAuthTokenPath is the path suffix for the OAuth token endpoint. OAuthTokenPath = "/oauth/token/" // EnvBackend overrides the Timestripe site root when set. EnvBackend = "TIMESTRIPE_BACKEND" // EnvToken allows passing a bearer token via environment (bypasses stored credentials). EnvToken = "TIMESTRIPE_TOKEN" // CredentialsFile is the name of the stored credentials file inside Dir(). CredentialsFile = "credentials.json" )
Variables ¶
This section is empty.
Functions ¶
func Backend ¶
func Backend() string
Backend returns the Timestripe site root (no path). Precedence: TIMESTRIPE_BACKEND env > stored credentials backend > default. Any trailing slash is stripped so callers can safely concatenate paths.
func Dir ¶
Dir returns the config directory, creating it if missing. Honors XDG_CONFIG_HOME; falls back to $HOME/.config (uniform across platforms, overriding the macOS "Application Support" default).
func OAuthAuthorizeURL ¶
func OAuthAuthorizeURL() string
OAuthAuthorizeURL returns the OAuth2 authorization endpoint URL.
func OAuthTokenURL ¶
func OAuthTokenURL() string
OAuthTokenURL returns the OAuth2 token endpoint URL.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.