gooseberry: github.com/voicera/gooseberry/urn Index | Files

package urn

import "github.com/voicera/gooseberry/urn"

Package urn provides a Uniform Resource Name that implemnets RFC8141.

Index

Package Files

urn.go

type URN Uses

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 Uses

func NewURN(namespaceID string, namespaceSpecificString string) *URN

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

func TryParseString Uses

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

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

func (*URN) GetNamespaceID Uses

func (urn *URN) GetNamespaceID() string

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

func (*URN) GetNamespaceSpecificString Uses

func (urn *URN) GetNamespaceSpecificString() string

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

func (*URN) MarshalJSON Uses

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

MarshalJSON marshals the URN into a JSON string.

func (*URN) String Uses

func (urn *URN) String() string

func (*URN) UnmarshalJSON Uses

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

UnmarshalJSON unmarshals the URN from a JSON string.

Package urn imports 3 packages (graph). Updated 2018-04-02. Refresh now. Tools for package owners.