Help us shape the future of Go! Take the 2026 Go Developer Survey

uri

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package uri defines Sink's canonical, backend-independent resource addresses. Store adapters interpret path segments; routing compares the complete URI.

Index

Constants

View Source
const MaxAddressBytes = 16 << 10

Variables

This section is empty.

Functions

func FormatKey

func FormatKey(key Key) (string, error)

func ValidStore

func ValidStore(value string) bool

Types

type Address

type Address struct {
	// contains filtered or unexported fields
}

Address is immutable. Store adapters interpret its resource path. Record addresses use the complete URI as identity.

func AppendKey

func AppendKey(resource string, key Key) (Address, error)

AppendKey uses the typed-key convention supported by the built-in stores. Custom stores may define other path grammars and construct addresses with New.

func New

func New(store string, segments []string) (Address, error)

func Parse

func Parse(value string) (Address, error)

Parse accepts only the canonical spelling. It never cleans paths, resolves aliases, interprets key types, or applies backend-specific normalization.

func (Address) EscapedPath

func (a Address) EscapedPath() string

EscapedPath preserves canonical path encoding. An empty path targets the Store.

func (Address) RoutingKey

func (a Address) RoutingKey() string

func (Address) Segments

func (a Address) Segments() []string

func (Address) Store

func (a Address) Store() string

func (Address) String

func (a Address) String() string

type Key

type Key struct {
	Type string
	Data []byte
}

Key preserves the exact type and bytes used by the built-in Store adapters.

func BytesKey

func BytesKey(value []byte) Key

func Int64Key

func Int64Key(value int64) Key

func OpaqueKey

func OpaqueKey(kind string, value []byte) Key

func ParseKey

func ParseKey(segment string) (Key, error)

func StringKey

func StringKey(value string) Key

Jump to

Keyboard shortcuts

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