urn

package
v1.78.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultNamespace is the default URN namespace for DigitalOcean resources.
	DefaultNamespace = "do"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type URN

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

URN is a unique, uniform identifier for a resource. This structure holds an URN parse into its three segments: a namespace, a collection and an identifier.

func NewURN

func NewURN(namespace string, collection string, id interface{}) *URN

NewURN constructs an *URN from a namespace, resource type, and identifier.

func ParseURN

func ParseURN(s string) (*URN, error)

ParseURN parses a string representation of an URN and returns its structured representation (*URN).

func (*URN) Collection

func (u *URN) Collection() string

Collection returns the collection segment of the URN.

func (*URN) Identifier

func (u *URN) Identifier() string

Identifier returns the identifier segment of the URN.

func (*URN) Namespace

func (u *URN) Namespace() string

Namespace returns the namespace segment of the URN.

func (*URN) String

func (u *URN) String() string

String returns a string representation of the URN.

Jump to

Keyboard shortcuts

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