xrd

package
v0.0.0-...-c529bc7 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2013 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package xrd provides a simple XRD parser.

XRD spec: http://docs.oasis-open.org/xri/xrd/v1.0/xrd-1.0.html

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Link struct {
	Rel      string `xml:"rel,attr"`
	Type     string `xml:"type,attr"`
	Href     string `xml:"href,attr"`
	Title    []Title
	Property []Property
	Template string `xml:"template,attr"`
}

Link is a link to a related resource.

type Property

type Property struct {
	Type  string `xml:"type,attr"`
	Value string `xml:",chardata"`
}

Property is a property of a resource.

type Title

type Title struct {
	Lang  string `xml:"lang,attr"`
	Value string `xml:",chardata"`
}

Title is a human-readable description of a Link.

type XRD

type XRD struct {
	Subject  string
	Expires  string
	Alias    []string
	Link     []Link
	Property []Property
}

XRD is an Extensible Resource Descriptor, specifying properties and related links for a resource.

func ParseXRD

func ParseXRD(blob []byte) (*XRD, error)

ParseXRD parses the XRD using xml.Unmarshal.

func (*XRD) ConvertToJRD

func (self *XRD) ConvertToJRD() *jrd.JRD

ConvertToJRD converts the XRD to JRD.

func (*XRD) GetLinkByRel

func (self *XRD) GetLinkByRel(rel string) *Link

GetLinkByRel returns the first *Link with the specified rel value.

Jump to

Keyboard shortcuts

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