webfinger

package module
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2024 License: MIT Imports: 10 Imported by: 0

README

go-webfinger (WebFinger Module for Ohagi)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidResponse  = errors.New("invalid response")
	ErrResourceNotFound = errors.New("resource not found")
)
View Source
var DefaultClient = &Client{
	HTTPClient: &http.Client{},
}

Functions

This section is empty.

Types

type AdditionalMediaTypes added in v1.2.0

type AdditionalMediaTypes struct {
	XML  []string
	JSON []string
}

type Client

type Client struct {
	HTTPClient           *http.Client
	UserAgent            string
	HTTPMode             bool
	AdditionalMediaTypes *AdditionalMediaTypes
}

func (*Client) Do

func (client *Client) Do(webFingerRequest *Request) (*Message, error)

type Error

type Error struct {
	Err error
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) Unwrap

func (e *Error) Unwrap() error
type Link struct {
	Rel  string `json:"rel,omitempty" xml:"rel,attr,omitempty"`
	Type string `json:"type,omitempty" xml:"type,attr,omitempty"`
	Href string `json:"href,omitempty" xml:"href,attr,omitempty"`
}

type Message

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

func (Message) GetFirstLinkByRelationType

func (r Message) GetFirstLinkByRelationType(t string) *Link

func (Message) GetLinkByType

func (r Message) GetLinkByType(t string) *Link

func (Message) GetLinksByRelationType

func (r Message) GetLinksByRelationType(t string) []Link

func (Message) GetLinksByType

func (r Message) GetLinksByType(t string) []Link

func (Message) MarshalXML

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

func (*Message) UnmarshalXML

func (r *Message) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type Properties

type Properties map[string]nullable.String

type Request

type Request struct {
	Host     string
	Resource string
}

type UnsupportedContentTypeError

type UnsupportedContentTypeError struct {
	ContentType string
}

func (*UnsupportedContentTypeError) Error

type WebFingerResponseStatusError

type WebFingerResponseStatusError struct {
	URL        string
	StatusCode int
	Status     string
}

func (*WebFingerResponseStatusError) Error

Jump to

Keyboard shortcuts

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