Documentation ¶
Index ¶
- type Item
- type Link
- func (l *Link) Anchor() *url.URL
- func (l *Link) Author() *url.URL
- func (l *Link) Items() []*Item
- func (l *Link) MarshalJSON() ([]byte, error)
- func (l *Link) Original() *Reference
- func (l *Link) Profile() *url.URL
- func (l *Link) Related() *Reference
- func (l *Link) Replies() *Reference
- func (l *Link) UnmarshalJSON(b []byte) error
- func (l *Link) Up() []*url.URL
- func (l *Link) Validate() error
- func (l *Link) Via() *url.URL
- type LinkType
- type Linkset
- type Reference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item contains a DID (in the HRef) and the previous anchor of the DID.
func (*Item) MarshalJSON ¶
MarshalJSON marshals the object to JSON.
func (*Item) UnmarshalJSON ¶
UnmarshalJSON umarshals the object from JSON.
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
Link is part of a Linkset.
func NewAnchorLink ¶
NewAnchorLink returns a new anchor Link.
func NewRelatedLink ¶
NewRelatedLink returns a new related Link.
func (*Link) MarshalJSON ¶
MarshalJSON marshals the object to JSON.
func (*Link) Replies ¶
Replies returns a collection of replies to the original resource. (For example, verifiable credentials.)
func (*Link) UnmarshalJSON ¶
UnmarshalJSON umarshals the object from JSON.
type Linkset ¶
type Linkset struct {
Linkset []*Link `json:"linkset"`
}
Linkset contains one or more Links.
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
Reference contains a URI and the content type of the data at that URI.
func NewAnchorRef ¶
func NewAnchorRef(data []byte, uriMediaType datauri.MediaType, contentType LinkType) (*url.URL, *Reference, error)
NewAnchorRef creates a data URI Reference of the given content type and returns the anchor URI (which is a hashlink of the data).
func NewReference ¶
NewReference returns a new reference.
func (*Reference) Content ¶
Content returns the decoded content of a data URI reference. If the reference is not a data URI then an error is returned.
func (*Reference) Linkset ¶
Linkset decodes the data URI in href and unmarshals and returns the Linkset. If the reference is not a data URI or the type is not application/linkset+json then an error is returned.
func (*Reference) MarshalJSON ¶
MarshalJSON marshals the object to JSON.
func (*Reference) UnmarshalJSON ¶
UnmarshalJSON umarshals the object from JSON.