wp-go/app/pkg/cache/postmeta.go

18 lines
565 B
Go
Raw Permalink Normal View History

2023-01-12 12:42:16 +00:00
package cache
import (
"context"
2023-11-25 09:49:20 +00:00
"github.com/fthvgb1/wp-go/cache/cachemanager"
"time"
)
// GetPostMetaByPostIds query func see dao.GetPostMetaByPostIds
2023-11-25 09:49:20 +00:00
func GetPostMetaByPostIds(ctx context.Context, ids []uint64) ([]map[string]any, error) {
return cachemanager.GetBatchBy[map[string]any]("postMetaData", ctx, ids, time.Second)
}
// GetPostMetaByPostId query func see dao.GetPostMetaByPostIds
2023-11-25 09:49:20 +00:00
func GetPostMetaByPostId(ctx context.Context, id uint64) (map[string]any, error) {
return cachemanager.GetBy[map[string]any]("postMetaData", ctx, id, time.Second)
}