redis

package
v0.0.0-...-da267cc Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver is the redis backed store.StoreI implementation

func (*Driver) Close

func (d *Driver) Close() error

Close will close the underlying redis client and clear in-memory caches

func (*Driver) Conn

func (d *Driver) Conn() interface{}

Conn returns the underlying connection

func (*Driver) Migrate

func (d *Driver) Migrate() error

func (*Driver) Name

func (d *Driver) Name() string

func (*Driver) Reap

func (d *Driver) Reap() []store.PeerHash

Reap will loop through the peers removing any stale entries from active swarms

func (*Driver) RoleAdd

func (d *Driver) RoleAdd(role *store.Role) error

func (*Driver) RoleByID

func (d *Driver) RoleByID(roleID uint32) (*store.Role, error)

func (*Driver) RoleDelete

func (d *Driver) RoleDelete(roleID uint32) error

func (*Driver) RoleSave

func (d *Driver) RoleSave(role *store.Role) error

func (*Driver) Roles

func (d *Driver) Roles() (store.Roles, error)

func (*Driver) TorrentAdd

func (d *Driver) TorrentAdd(t *store.Torrent) error

Add adds a new torrent to the redis backing store

func (*Driver) TorrentDelete

func (d *Driver) TorrentDelete(ih store.InfoHash, dropRow bool) error

Delete will mark a torrent as deleted in the backing store. If dropRow is true, it will permanently remove the torrent from the store

func (*Driver) TorrentGet

func (d *Driver) TorrentGet(hash store.InfoHash, deletedOk bool) (*store.Torrent, error)

Get returns the Torrent matching the infohash

func (*Driver) TorrentSave

func (d *Driver) TorrentSave(torrent *store.Torrent) error

func (*Driver) TorrentSync

func (d *Driver) TorrentSync(batch []*store.Torrent) error

Sync batch updates the backing store with the new TorrentStats provided

func (*Driver) TorrentUpdate

func (d *Driver) TorrentUpdate(torrent *store.Torrent) error

Update is just a Add call with a check for existing key first as the process is the same for setting both

func (*Driver) Torrents

func (d *Driver) Torrents() (store.Torrents, error)

func (*Driver) UserAdd

func (d *Driver) UserAdd(u *store.User) error

Add inserts a user into redis via at the string provided by the userKey function This additionally sets the passkey->user_id mapping

func (*Driver) UserDelete

func (d *Driver) UserDelete(user *store.User) error

Delete drops a user from redis.

func (*Driver) UserGetByID

func (d *Driver) UserGetByID(userID uint32) (*store.User, error)

GetByID will query the passkey:user_id index for the passkey and return the matching user

func (*Driver) UserGetByPasskey

func (d *Driver) UserGetByPasskey(passkey string) (*store.User, error)

GetByPasskey returns the hash values set of the passkey and maps it to a User struct

func (*Driver) UserSave

func (d *Driver) UserSave(user *store.User) error

func (*Driver) UserSync

func (d *Driver) UserSync(b []*store.User) error

Sync batch updates the backing store with the new UserStats provided TODO leverage cache layer so we can pipeline the updates w/o query first

func (*Driver) Users

func (d *Driver) Users() (store.Users, error)

func (*Driver) WhiteListAdd

func (d *Driver) WhiteListAdd(client *store.WhiteListClient) error

WhiteListAdd will insert a new client prefix into the allowed clients list

func (*Driver) WhiteListDelete

func (d *Driver) WhiteListDelete(client *store.WhiteListClient) error

WhiteListDelete removes a client from the global whitelist

func (*Driver) WhiteListGetAll

func (d *Driver) WhiteListGetAll() ([]*store.WhiteListClient, error)

WhiteListGetAll fetches all known whitelisted clients

Jump to

Keyboard shortcuts

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