cache

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BilibiliAuthorizationCacheWithUserIDInitFunc

func BilibiliAuthorizationCacheWithUserIDInitFunc(userID string) func(ctx context.Context, args ...struct{}) (*BilibiliUserCacheData, error)

func BilibiliNoSharedMovieCacheInitFunc

func BilibiliNoSharedMovieCacheInitFunc(ctx context.Context, movie *model.Movie, args ...*BilibiliUserCache) (string, error)

func NewAlistMovieCacheInitFunc

func NewAlistMovieCacheInitFunc(movie *model.Movie) func(ctx context.Context, args ...*AlistUserCache) (*AlistMovieCacheData, error)

func NewBilibiliNoSharedMovieCacheInitFunc

func NewBilibiliNoSharedMovieCacheInitFunc(movie *model.Movie) func(ctx context.Context, key string, args ...*BilibiliUserCache) (string, error)

func NewBilibiliSharedMpdCacheInitFunc

func NewBilibiliSharedMpdCacheInitFunc(movie *model.Movie) func(ctx context.Context, args ...*BilibiliUserCache) (*BilibiliMpdCache, error)

func NewBilibiliSubtitleCacheInitFunc

func NewBilibiliSubtitleCacheInitFunc(movie *model.Movie) func(ctx context.Context, args ...*BilibiliUserCache) (BilibiliSubtitleCache, error)

func NewEmbyMovieCacheInitFunc

func NewEmbyMovieCacheInitFunc(movie *model.Movie) func(ctx context.Context, args ...*EmbyUserCache) (*EmbyMovieCacheData, error)

Types

type AliSubtitleCache

type AliSubtitleCache = refreshcache.RefreshCache[[]byte, struct{}]

type AlistMovieCache

func NewAlistMovieCache

func NewAlistMovieCache(movie *model.Movie) *AlistMovieCache

type AlistMovieCacheData

type AlistMovieCacheData struct {
	URL             string
	AliM3U8ListFile []byte
	AliSubtitles    []*AliSubtitle
}

type AlistUserCache

type AlistUserCache = MapCache[*AlistUserCacheData, struct{}]

func NewAlistUserCache

func NewAlistUserCache(userID string) *AlistUserCache

type AlistUserCacheData

type AlistUserCacheData struct {
	Host     string
	ServerID string
	Token    string
	Backend  string
}

func AlistAuthorizationCacheWithConfigInitFunc

func AlistAuthorizationCacheWithConfigInitFunc(ctx context.Context, v *model.AlistVendor) (*AlistUserCacheData, error)

func AlistAuthorizationCacheWithUserIDInitFunc

func AlistAuthorizationCacheWithUserIDInitFunc(ctx context.Context, userID, serverID string) (*AlistUserCacheData, error)

type BilibiliMpdCache

type BilibiliMpdCache struct {
	Mpd     string
	HevcMpd string
	Urls    []string
}

func BilibiliSharedMpdCacheInitFunc

func BilibiliSharedMpdCacheInitFunc(ctx context.Context, movie *model.Movie, args ...*BilibiliUserCache) (*BilibiliMpdCache, error)

type BilibiliSubtitleCache

type BilibiliSubtitleCache map[string]*struct {
	Url string
	Srt *refreshcache.RefreshCache[[]byte, struct{}]
}

func BilibiliSubtitleCacheInitFunc

func BilibiliSubtitleCacheInitFunc(ctx context.Context, movie *model.Movie, args ...*BilibiliUserCache) (BilibiliSubtitleCache, error)

type BilibiliUserCache

type BilibiliUserCache = refreshcache.RefreshCache[*BilibiliUserCacheData, struct{}]

func NewBilibiliUserCache

func NewBilibiliUserCache(userID string) *BilibiliUserCache

type BilibiliUserCacheData

type BilibiliUserCacheData struct {
	Cookies []*http.Cookie
	Backend string
}

type EmbyMovieCache

func NewEmbyMovieCache

func NewEmbyMovieCache(movie *model.Movie) *EmbyMovieCache

type EmbyMovieCacheData

type EmbyMovieCacheData struct {
	Sources []EmbySource
}

type EmbySource

type EmbySource struct {
	URLs []struct {
		URL  string
		Name string
	}
	Subtitles []struct {
		URL   string
		Type  string
		Name  string
		Cache *refreshcache.RefreshCache[[]byte, struct{}]
	}
}

type EmbyUserCache

type EmbyUserCache = MapCache[*EmbyUserCacheData, struct{}]

func NewEmbyUserCache

func NewEmbyUserCache(userID string) *EmbyUserCache

type EmbyUserCacheData

type EmbyUserCacheData struct {
	Host     string
	ServerID string
	ApiKey   string
	Backend  string
}

func EmbyAuthorizationCacheWithUserIDInitFunc

func EmbyAuthorizationCacheWithUserIDInitFunc(userID, serverID string) (*EmbyUserCacheData, error)

type MapCache

type MapCache[T any, A any] struct {
	// contains filtered or unexported fields
}

func (*MapCache[T, A]) Clear

func (b *MapCache[T, A]) Clear()

func (*MapCache[T, A]) Delete added in v0.3.2

func (b *MapCache[T, A]) Delete(key string)

func (*MapCache[T, A]) LoadCache added in v0.3.2

func (b *MapCache[T, A]) LoadCache(key string) (*refreshcache.RefreshCache[T, A], bool)

func (*MapCache[T, A]) LoadOrNewCache added in v0.3.2

func (b *MapCache[T, A]) LoadOrNewCache(key string) *refreshcache.RefreshCache[T, A]

func (*MapCache[T, A]) LoadOrStore

func (b *MapCache[T, A]) LoadOrStore(ctx context.Context, key string, args ...A) (T, error)

func (*MapCache[T, A]) LoadOrStoreWithDynamicFunc

func (b *MapCache[T, A]) LoadOrStoreWithDynamicFunc(ctx context.Context, key string, refreshFunc MapRefreshFunc[T, A], args ...A) (T, error)

func (*MapCache[T, A]) StoreOrRefresh

func (b *MapCache[T, A]) StoreOrRefresh(ctx context.Context, key string, args ...A) (T, error)

func (*MapCache[T, A]) StoreOrRefreshWithDynamicFunc

func (b *MapCache[T, A]) StoreOrRefreshWithDynamicFunc(ctx context.Context, key string, refreshFunc MapRefreshFunc[T, A], args ...A) (T, error)

type MapRefreshFunc

type MapRefreshFunc[T any, A any] func(ctx context.Context, key string, args ...A) (T, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL