config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package config resolves where the CLI talks to and which workspace it acts in. Precedence is explicit: flag, then environment, then default (CLT-15/FR-25).

Index

Constants

View Source
const (
	EnvToken     = "WANIIS_TOKEN"
	EnvAPIURL    = "WANIIS_API_URL"
	EnvWorkspace = "WANIIS_WORKSPACE"
	EnvConfigDir = "WANIIS_CONFIG_DIR"
	EnvNoColor   = "NO_COLOR"
)

Environment variable names read by the CLI. They read "Waniis" because people type them.

View Source
const DefaultAPIURL = "https://app.waniis.com"

DefaultAPIURL is the product's single origin for the web app and the API.

Variables

This section is empty.

Functions

func AppURL

func AppURL(apiBase string) string

AppURL is the web app's origin for a given API base: the API alias maps to the app host so that links people open in a browser always land on the web app.

func Dir

func Dir(getenv func(string) string) (string, error)

Dir is the directory for the CLI's own files: $WANIIS_CONFIG_DIR, else $XDG_CONFIG_HOME/waniis, else ~/.config/waniis (%AppData%\waniis on Windows).

func NormalizeBaseURL

func NormalizeBaseURL(raw string) (string, error)

NormalizeBaseURL validates an API base URL. It must be https, except for localhost, so a token is never sent in clear text to another host (CLT-15, Security). Trailing slashes are dropped.

func Pick

func Pick(flag string, env string, fallback string) string

Pick returns the first non-empty value: the flag, then the environment, then the fallback.

Types

This section is empty.

Jump to

Keyboard shortcuts

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