gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

card.go (2498B)


      1 // GoToSocial
      2 // Copyright (C) GoToSocial Authors admin@gotosocial.org
      3 // SPDX-License-Identifier: AGPL-3.0-or-later
      4 //
      5 // This program is free software: you can redistribute it and/or modify
      6 // it under the terms of the GNU Affero General Public License as published by
      7 // the Free Software Foundation, either version 3 of the License, or
      8 // (at your option) any later version.
      9 //
     10 // This program is distributed in the hope that it will be useful,
     11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
     12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     13 // GNU Affero General Public License for more details.
     14 //
     15 // You should have received a copy of the GNU Affero General Public License
     16 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
     17 
     18 package model
     19 
     20 // Card represents a rich preview card that is generated using OpenGraph tags from a URL.
     21 //
     22 // swagger:model card
     23 type Card struct {
     24 	// Location of linked resource.
     25 	// example: https://buzzfeed.com/some/fuckin/buzzfeed/article
     26 	URL string `json:"url"`
     27 	// Title of linked resource.
     28 	// example: Buzzfeed - Is Water Wet?
     29 	Title string `json:"title"`
     30 	// Description of preview.
     31 	// example: Is water wet? We're not sure. In this article, we ask an expert...
     32 	Description string `json:"description"`
     33 	// The type of the preview card.
     34 	// enum:
     35 	// - link
     36 	// - photo
     37 	// - video
     38 	// - rich
     39 	// example: link
     40 	Type string `json:"type"`
     41 	// The author of the original resource.
     42 	// example: weewee@buzzfeed.com
     43 	AuthorName string `json:"author_name"`
     44 	// A link to the author of the original resource.
     45 	// example: https://buzzfeed.com/authors/weewee
     46 	AuthorURL string `json:"author_url"`
     47 	// The provider of the original resource.
     48 	// example: Buzzfeed
     49 	ProviderName string `json:"provider_name"`
     50 	// A link to the provider of the original resource.
     51 	// example: https://buzzfeed.com
     52 	ProviderURL string `json:"provider_url"`
     53 	// HTML to be used for generating the preview card.
     54 	HTML string `json:"html"`
     55 	// Width of preview, in pixels.
     56 	Width int `json:"width"`
     57 	// Height of preview, in pixels.
     58 	Height int `json:"height"`
     59 	// Preview thumbnail.
     60 	// example: https://example.org/fileserver/preview/thumb.jpg
     61 	Image string `json:"image"`
     62 	// Used for photo embeds, instead of custom html.
     63 	EmbedURL string `json:"embed_url"`
     64 	// A hash computed by the BlurHash algorithm, for generating colorful preview thumbnails when media has not been downloaded yet.
     65 	Blurhash string `json:"blurhash"`
     66 }