Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { io.Closer GetString(ctx context.Context, key string) (string, error) SetString(ctx context.Context, key, value string, options ...CacheOption) error }
Cache is a solution for fast storage and retrieval of ephemeral data
type CacheOption ¶ added in v0.2.0
type CacheOption interface {
Apply(params *CacheParams) error
}
func WithTTL ¶ added in v0.2.0
func WithTTL(duration time.Duration) CacheOption
type CacheOptionFn ¶ added in v0.2.0
type CacheOptionFn func(params *CacheParams) error
func (CacheOptionFn) Apply ¶ added in v0.2.0
func (fn CacheOptionFn) Apply(params *CacheParams) error
type CacheParams ¶ added in v0.2.0
func NewCacheParams ¶ added in v0.2.0
func NewCacheParams(options ...CacheOption) (*CacheParams, error)
type CachedTracker ¶ added in v0.2.0
type CachedTracker struct { Cache Cache Tracker usecases.Tracker TTL CachedTrackerTTL }
CachedTracker wraps a Tracker with a passthrough cache
func (*CachedTracker) Close ¶ added in v0.2.0
func (wrapper *CachedTracker) Close() error
func (*CachedTracker) GetMediaListIDs ¶ added in v0.2.0
type CachedTrackerTTL ¶ added in v0.2.0
type JSONLocalProvider ¶ added in v0.2.0
JSONLocalProvider is a filesystem-based metadata provider
func (JSONLocalProvider[F]) String ¶ added in v0.2.0
func (source JSONLocalProvider[F]) String() string
type JSONProvider ¶ added in v0.2.0
JSONLocalProvider is a HTTP-based metadata provider
func (JSONProvider[F]) String ¶ added in v0.2.0
func (source JSONProvider[F]) String() string
type Mapper ¶ added in v0.2.0
Mapper handles the mapping of media data. It also handles the retrieval of data from a provider and its persistent storage
type Metadata ¶
Metadata represents any data that contains both the source Tracker media ID and the target service media ID
type Provider ¶ added in v0.2.0
type Provider[T Metadata] interface { fmt.Stringer Fetch(ctx context.Context, client usecases.Getter) ([]T, error) }
Provider is a source of mapping media data
type Store ¶
type Store interface { io.Closer GetMedia(ctx context.Context, id string) (*entities.Media, error) GetMediaBulk(ctx context.Context, ids []string) ([]*entities.Media, error) PutMedia(ctx context.Context, media *entities.Media) error PutMediaBulk(ctx context.Context, medias []*entities.Media) error }
Store handles the persistent storage and retrieval of media mapping data
Click to show internal directories.
Click to hide internal directories.