oembed

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: BSD-3-Clause Imports: 5 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type OEmbedDatabase

type OEmbedDatabase interface {
	AddOEmbed(context.Context, *Photo) error
	GetRandomOEmbed(context.Context) (*Photo, error)
	GetOEmbedWithURL(context.Context, string) (*Photo, error)
	GetOEmbedWithObjectURI(context.Context, string) ([]*Photo, error)
	GetOEmbedWithCallback(context.Context, OEmbedDatabaseCallback) error
	Close() error
}

func NewSQLOEmbedDatabase

func NewSQLOEmbedDatabase(ctx context.Context, uri string) (OEmbedDatabase, error)

type OEmbedDatabaseCallback added in v0.0.5

type OEmbedDatabaseCallback func(context.Context, *Photo) error

type Photo

type Photo struct {
	Version          string `json:"version,xml:"version""`
	Type             string `json:"type",xml:"type"`
	Width            int    `json:"width",xml:"width"`
	Height           int    `json:"height",xml:"height"`
	Title            string `json:"title",xml:"title"`
	URL              string `json:"url",xml:"url"`
	AuthorName       string `json:"author_name",xml:"author_name"`
	AuthorURL        string `json:"author_url",xml:"author_url"`
	ProviderName     string `json:"provider_name",xml:"provider_name"`
	ProviderURL      string `json:"provider_url",xml:"provider_url"`
	ObjectURI        string `json:"object_uri",xml:"object_uri"`
	ThumbnailURL     string `json:"thumbnail_url,omitempty",xml:"thumbnail_url,omitempty"`
	ThumbnailWidth   int    `json:"thumbnail_width,omitempty",xml:"thumbnail_width,omitempty"`
	ThumbnailHeight  int    `json:"thumbnail_height,omitempty",xml:"thumbnail_height,omitempty"`
	DataURL          string `json:"data_url,omitempty",xml:"data_url,omitempty"`
	ThumbnailDataURL string `json:"thumbnail_data_url,omitempty",xml:"thumbnail_data_url,omitempty"`
}

type SQLOEmbedDatabase

type SQLOEmbedDatabase struct {
	OEmbedDatabase
	// contains filtered or unexported fields
}

func (*SQLOEmbedDatabase) AddOEmbed

func (db *SQLOEmbedDatabase) AddOEmbed(ctx context.Context, rec *Photo) error

func (*SQLOEmbedDatabase) Close

func (db *SQLOEmbedDatabase) Close() error

func (*SQLOEmbedDatabase) GetOEmbedWithCallback added in v0.0.5

func (db *SQLOEmbedDatabase) GetOEmbedWithCallback(ctx context.Context, cb OEmbedDatabaseCallback) error

func (*SQLOEmbedDatabase) GetOEmbedWithObjectURI added in v0.0.3

func (db *SQLOEmbedDatabase) GetOEmbedWithObjectURI(ctx context.Context, object_uri string) ([]*Photo, error)

func (*SQLOEmbedDatabase) GetOEmbedWithURL added in v0.0.3

func (db *SQLOEmbedDatabase) GetOEmbedWithURL(ctx context.Context, url string) (*Photo, error)

func (*SQLOEmbedDatabase) GetRandomOEmbed

func (db *SQLOEmbedDatabase) GetRandomOEmbed(ctx context.Context) (*Photo, error)

Jump to

Keyboard shortcuts

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