webfinger

package
v0.0.0-...-75625ea Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2017 License: BSD-3-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("Webfinger: resource not found")

Functions

func MakeURL

func MakeURL(domain, resource string, rel []string) string

Types

type Handler

type Handler struct{ Source }

func (*Handler) ServeHTTP

func (s *Handler) ServeHTTP(rw http.ResponseWriter, r *http.Request)
type Link struct {
	Rel        string             `json:"rel,omitempty"`
	Type       string             `json:"type,omitempty"`
	Href       string             `json:"href,omitempty"`
	Template   string             `json:"template,omitempty"`
	Titles     map[string]string  `json:"titles,omitempty"`
	Properties map[string]*string `json:"properties,omitempty"`
}

func (*Link) MarshalXML

func (m *Link) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*Link) UnmarshalXML

func (m *Link) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Response

type Response struct {
	Subject    string             `json:"subject"`
	Aliases    []string           `json:"aliases,omitempty"`
	Properties map[string]*string `json:"properties,omitempty"`
	Links      []Link             `json:"links,omitempty"`
}

func Fetch

func Fetch(u string) (*Response, error)
func (r *Response) GetLink(rel string) *Link

func (*Response) MarshalXML

func (r *Response) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type Source

type Source interface {
	Fetch(subject string, rel []string) (*Response, error)
}

Jump to

Keyboard shortcuts

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