apiurl

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultBaseURL is the production Entire API origin.
	DefaultBaseURL = "https://entire.io"

	// BaseURLEnvVar overrides the Entire API origin for local development.
	BaseURLEnvVar = "ENTIRE_API_BASE_URL"
)

Variables

View Source
var ErrInsecureHTTP = errors.New("refusing to use insecure http:// base URL for authentication (use --insecure-http-auth to override)")

ErrInsecureHTTP is returned when the base URL uses HTTP without an explicit opt-in.

Functions

func BaseURL

func BaseURL() string

BaseURL returns the effective Entire API base URL. ENTIRE_API_BASE_URL takes precedence over the production default.

func RequireSecureURL

func RequireSecureURL(baseURL string) error

RequireSecureURL returns ErrInsecureHTTP if the base URL uses the http scheme. Call this before making authenticated requests unless --insecure-http-auth is set.

func ResolveURL

func ResolveURL(path string) (string, error)

ResolveURL joins an API-relative path against the effective base URL.

func ResolveURLFromBase

func ResolveURLFromBase(baseURL, path string) (string, error)

ResolveURLFromBase joins an API-relative path against an explicit base URL. Only http and https schemes are accepted.

Types

This section is empty.

Jump to

Keyboard shortcuts

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