config

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2026 License: MIT Imports: 5 Imported by: 0

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 APIBase

func APIBase() string

APIBase returns the full base URL for the REST API.

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

func Dir() (string, error)

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.

func Path

func Path(name string) (string, error)

Path returns the absolute path of a file inside the config directory.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL