[MM-55096] Introduce generic StoreResult (#25086)

Этот коммит содержится в:
Ben Schumacher
2023-10-31 10:21:31 +01:00
коммит произвёл GitHub
родитель 6dda6e3540
Коммит b4c9eddca8
2 изменённых файлов: 16 добавлений и 9 удалений

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

@@ -15,6 +15,7 @@ import (
"github.com/mattermost/mattermost/server/v8/channels/product"
)
// Deprecated: Use GenericStoreResult instead.
type StoreResult struct {
Data any
@@ -22,6 +23,15 @@ type StoreResult struct {
NErr error
}
// GenericStoreResult is a type safe version of StoreResult.
// Once all the code is migrated to use GenericStoreResult, it should be renamed to StoreResult.
type GenericStoreResult[T any] struct {
Data T
// NErr a temporary field used by the new code for the AppError migration. This will later become Err when the entire store is migrated.
NErr error
}
type Store interface {
Team() TeamStore
Channel() ChannelStore