Documentation ¶
Index ¶
- type Driver
- func (d *Driver) Close() error
- func (d *Driver) Conn() interface{}
- func (d *Driver) Migrate() error
- func (d *Driver) Name() string
- func (d *Driver) Reap() []store.PeerHash
- func (d *Driver) RoleAdd(role *store.Role) error
- func (d *Driver) RoleByID(roleID uint32) (*store.Role, error)
- func (d *Driver) RoleDelete(roleID uint32) error
- func (d *Driver) RoleSave(role *store.Role) error
- func (d *Driver) Roles() (store.Roles, error)
- func (d *Driver) TorrentAdd(t *store.Torrent) error
- func (d *Driver) TorrentDelete(ih store.InfoHash, dropRow bool) error
- func (d *Driver) TorrentGet(hash store.InfoHash, deletedOk bool) (*store.Torrent, error)
- func (d *Driver) TorrentSave(torrent *store.Torrent) error
- func (d *Driver) TorrentSync(batch []*store.Torrent) error
- func (d *Driver) TorrentUpdate(torrent *store.Torrent) error
- func (d *Driver) Torrents() (store.Torrents, error)
- func (d *Driver) UserAdd(u *store.User) error
- func (d *Driver) UserDelete(user *store.User) error
- func (d *Driver) UserGetByID(userID uint32) (*store.User, error)
- func (d *Driver) UserGetByPasskey(passkey string) (*store.User, error)
- func (d *Driver) UserSave(user *store.User) error
- func (d *Driver) UserSync(b []*store.User) error
- func (d *Driver) Users() (store.Users, error)
- func (d *Driver) WhiteListAdd(client *store.WhiteListClient) error
- func (d *Driver) WhiteListDelete(client *store.WhiteListClient) error
- func (d *Driver) WhiteListGetAll() ([]*store.WhiteListClient, error)
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) Reap ¶
Reap will loop through the peers removing any stale entries from active swarms
func (*Driver) RoleDelete ¶
func (*Driver) TorrentAdd ¶
Add adds a new torrent to the redis backing store
func (*Driver) TorrentDelete ¶
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 ¶
Get returns the Torrent matching the infohash
func (*Driver) TorrentSync ¶
Sync batch updates the backing store with the new TorrentStats provided
func (*Driver) TorrentUpdate ¶
Update is just a Add call with a check for existing key first as the process is the same for setting both
func (*Driver) UserAdd ¶
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 ¶
Delete drops a user from redis.
func (*Driver) UserGetByID ¶
GetByID will query the passkey:user_id index for the passkey and return the matching user
func (*Driver) UserGetByPasskey ¶
GetByPasskey returns the hash values set of the passkey and maps it to a User struct
func (*Driver) UserSync ¶
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) 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