ref

package
v0.0.0-...-6451a0a Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package ref parses and formats the resource references services use to point at each other:

urn:<service>:<type>:<resource-id>

A reference is opaque to every service except the one named in its service segment.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalid = errors.New("invalid resource reference")

Functions

func Validate

func Validate(s string) error

Validate reports whether a raw string is a well-formed reference.

Types

type Ref

type Ref struct {
	Service      string
	ResourceType string
	ID           string
}

func MustNew

func MustNew(service, resourceType, id string) Ref

MustNew is for references built from values the caller already controls, such as a fresh UUID and a constant service name. It panics on anything else.

func New

func New(service, resourceType, id string) (Ref, error)

func Parse

func Parse(s string) (Ref, error)

func (Ref) String

func (r Ref) String() string

func (Ref) Validate

func (r Ref) Validate() error

Jump to

Keyboard shortcuts

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