MM-13664 Cache external link metadata when populating post metadata (#10128)

* MM-13664 Added LinkMetadata types

* MM-13664 Use LinkMetadata when populating post metadata

* Fix unused import

* Fix index name on SQLite

* Finish adding unit tests

* Address feedback

* Increase max length of URL column to 2048 characters
Этот коммит содержится в:
Harrison Healey
2019-01-28 10:25:08 -05:00
коммит произвёл Carlos Tadeu Panato Junior
родитель 5c76e90a83
Коммит 26684716aa
22 изменённых файлов: 1483 добавлений и 50 удалений

Просмотреть файл

@@ -3,6 +3,10 @@
package model
import (
"encoding/json"
)
type PostMetadata struct {
// Embeds holds information required to render content embedded in the post. This includes the OpenGraph metadata
// for links in the post.
@@ -28,3 +32,8 @@ type PostImage struct {
Width int `json:"width"`
Height int `json:"height"`
}
func (o *PostImage) ToJson() string {
b, _ := json.Marshal(o)
return string(b)
}