cache

package
v1.4.2-alpha Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

type Cache struct {
	// contains filtered or unexported fields
}

Cache contains functions for queue cache.

func New

func New(cacher cache.Cacher) *Cache

New to create new queue cache.

func (*Cache) Add

func (c *Cache) Add(ctx context.Context, gID string, data entity.Song) error

Add to add song to queue.

func (*Cache) GetIndex

func (c *Cache) GetIndex(ctx context.Context, gID string) int

GetIndex to get index.

func (*Cache) GetList

func (c *Cache) GetList(ctx context.Context, gID string) []entity.Song

GetList to get list.

func (*Cache) IsEmpty

func (c *Cache) IsEmpty(ctx context.Context, gID string) bool

IsEmpty to check if empty.

func (*Cache) Purge

func (c *Cache) Purge(ctx context.Context, gID string) error

Purge to delete queue.

func (*Cache) Remove

func (c *Cache) Remove(ctx context.Context, gID string, is ...int) error

Remove to remove song from queue.

func (*Cache) SetIndex

func (c *Cache) SetIndex(ctx context.Context, gID string, i int) error

SetIndex to set index.

Jump to

Keyboard shortcuts

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