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
Этот коммит содержится в:
коммит произвёл
Carlos Tadeu Panato Junior
родитель
5c76e90a83
Коммит
26684716aa
46
store/storetest/mocks/LinkMetadataStore.go
Обычный файл
46
store/storetest/mocks/LinkMetadataStore.go
Обычный файл
@@ -0,0 +1,46 @@
|
||||
// Code generated by mockery v1.0.0. DO NOT EDIT.
|
||||
|
||||
// Regenerate this file using `make store-mocks`.
|
||||
|
||||
package mocks
|
||||
|
||||
import mock "github.com/stretchr/testify/mock"
|
||||
import model "github.com/mattermost/mattermost-server/model"
|
||||
import store "github.com/mattermost/mattermost-server/store"
|
||||
|
||||
// LinkMetadataStore is an autogenerated mock type for the LinkMetadataStore type
|
||||
type LinkMetadataStore struct {
|
||||
mock.Mock
|
||||
}
|
||||
|
||||
// Get provides a mock function with given fields: url, timestamp
|
||||
func (_m *LinkMetadataStore) Get(url string, timestamp int64) store.StoreChannel {
|
||||
ret := _m.Called(url, timestamp)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(string, int64) store.StoreChannel); ok {
|
||||
r0 = rf(url, timestamp)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(store.StoreChannel)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
|
||||
// Save provides a mock function with given fields: linkMetadata
|
||||
func (_m *LinkMetadataStore) Save(linkMetadata *model.LinkMetadata) store.StoreChannel {
|
||||
ret := _m.Called(linkMetadata)
|
||||
|
||||
var r0 store.StoreChannel
|
||||
if rf, ok := ret.Get(0).(func(*model.LinkMetadata) store.StoreChannel); ok {
|
||||
r0 = rf(linkMetadata)
|
||||
} else {
|
||||
if ret.Get(0) != nil {
|
||||
r0 = ret.Get(0).(store.StoreChannel)
|
||||
}
|
||||
}
|
||||
|
||||
return r0
|
||||
}
|
||||
Ссылка в новой задаче
Block a user