urlbase

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package urlbase holds the rules for the URLs storage serves objects under, for the packages that must apply them without depending on each other: config validates GOMBIT_STORAGE_LOCAL_URL and GOMBIT_STORAGE_S3_PUBLIC_URL with the same functions storage/presign and storage/s3 use, so a configuration that validates is one they accept.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base

func Base(base string) (path, problem string)

Base checks where a store's URLs are served (presign.Config.Base): a path ("/_storage") or an http(s) URL with one ("https://files.example.com/_storage"), without a query, fragment, credentials, or trailing '/', whose path is plain (no percent-escapes: the path is matched against requests as decoded, so it must be the same written either way). It returns the path, or why base is not one.

func Root

func Root(root string) string

Root checks the URL a bucket's public objects are read from (s3.Config.PublicURL): an http(s) URL, with or without a path, without a query, fragment, credentials, or trailing '/'. It returns why root is not one, or "".

Types

This section is empty.

Jump to

Keyboard shortcuts

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