urn

package
v0.0.0-...-dc23390 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2018 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Overview

Package urn provides a Uniform Resource Name that implemnets RFC8141.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type URN

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

URN represents a Uniform Resource Name that implemnets RFC8141 https://www.ietf.org/rfc/rfc8141.txt.

func NewURN

func NewURN(namespaceID string, namespaceSpecificString string) *URN

NewURN creates a new URN with the specified namespace ID and namespace-specific string.

func TryParseString

func TryParseString(urn string) (*URN, bool)

TryParseString attempts to create a new URN from the specified string.

func (*URN) GetNamespaceID

func (urn *URN) GetNamespaceID() string

GetNamespaceID returns the URN's namespace ID (NID).

func (*URN) GetNamespaceSpecificString

func (urn *URN) GetNamespaceSpecificString() string

GetNamespaceSpecificString returns the URN's namespace-specific string (NSS).

func (*URN) MarshalJSON

func (urn *URN) MarshalJSON() ([]byte, error)

MarshalJSON marshals the URN into a JSON string.

func (*URN) String

func (urn *URN) String() string

func (*URN) UnmarshalJSON

func (urn *URN) UnmarshalJSON(b []byte) error

UnmarshalJSON unmarshals the URN from a JSON string.

Jump to

Keyboard shortcuts

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