Categorygithub.com/artyom/oembed
modulepackage
1.0.2
Repository: https://github.com/artyom/oembed.git
Documentation: pkg.go.dev

# README

Package oembed implements functions to discover oEmbed providers for given URL and parse providers' response.

https://godoc.org/github.com/artyom/oembed

# Functions

Discover parses htmlBodyReader as utf-8 encoded html text and tries to discover oEmbed endpoint as described in http://oembed.com/#section4 Use NewReader from golang.org/x/net/html/charset to ensure data is properly encoded.
FromJSON decodes json-encoded oEmbed metadata read from r.
FromResponse verifies status code of r, and calls FromJSON or FromXML depending on Content-Type of r.
FromXML decodes xml-encoded oEmbed metadata read from r.
Providers decodes r as content of http://oembed.com/providers.json and returns LookupFunc matching url against providers list.

# Constants

Predefined oEmbed types (http://oembed.com 2.3.4.1-2.3.4.4):.
Predefined oEmbed types (http://oembed.com 2.3.4.1-2.3.4.4):.
Predefined oEmbed types (http://oembed.com 2.3.4.1-2.3.4.4):.
Predefined oEmbed types (http://oembed.com 2.3.4.1-2.3.4.4):.

# Structs

Metadata describes resource as returned by oEmbed provider (http://oembed.com, section 2.3.4).

# Type aliases

LookupFunc checks whether provided url matches any known oEmbed provider and returns url of oEmbed endpoint that should return metadata about original url.
Type describes resource type as returned by oEmbed provider.