Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidURN represents an error for invalid URN ErrInvalidURN = errors.New("invalid URN") )
Functions ¶
This section is empty.
Types ¶
type NullURN ¶
NullURN represents a URN that may be null. NullURN implements the Scanner interface, so it can be used as a scan destination:
var s NullURN err := db.QueryRow("SELECT urn FROM foo WHERE id=?", id).Scan(&s) ... if s.Valid { // use s.URN } else { // NULL value }
type URN ¶
URN represents a Uniform Resource Name.
The general form is: urn:<nid>:<nss> Compliant with https://tools.ietf.org/html/rfc2141.
func Parse ¶
Parse is responsible to create a URN instance from a byte array matching the correct URN syntax.
func (*URN) MarshalJSON ¶
MarshalJSON marshals the URN to JSON string.
func (*URN) UnmarshalJSON ¶
UnmarshalJSON unmarshals a URN from JSON string.
Click to show internal directories.
Click to hide internal directories.