Documentation ¶
Index ¶
- type OEmbedDatabase
- type OEmbedDatabaseCallback
- type Photo
- type SQLOEmbedDatabase
- func (db *SQLOEmbedDatabase) AddOEmbed(ctx context.Context, rec *Photo) error
- func (db *SQLOEmbedDatabase) Close() error
- func (db *SQLOEmbedDatabase) GetOEmbedWithCallback(ctx context.Context, cb OEmbedDatabaseCallback) error
- func (db *SQLOEmbedDatabase) GetOEmbedWithObjectURI(ctx context.Context, object_uri string) ([]*Photo, error)
- func (db *SQLOEmbedDatabase) GetOEmbedWithURL(ctx context.Context, url string) (*Photo, error)
- func (db *SQLOEmbedDatabase) GetRandomOEmbed(ctx context.Context) (*Photo, error)
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 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 (*SQLOEmbedDatabase) GetOEmbedWithURL ¶ added in v0.0.3
func (*SQLOEmbedDatabase) GetRandomOEmbed ¶
func (db *SQLOEmbedDatabase) GetRandomOEmbed(ctx context.Context) (*Photo, error)
Click to show internal directories.
Click to hide internal directories.