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) 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(r *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, _ bool) error
- func (d *Driver) TorrentGet(hash store.InfoHash, deletedOk bool) (*store.Torrent, error)
- func (d *Driver) TorrentSave(_ *store.Torrent) error
- func (d *Driver) TorrentSync(_ []*store.Torrent) error
- func (d *Driver) Torrents() (store.Torrents, error)
- func (d *Driver) UserAdd(usr *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(u *store.User) error
- func (d *Driver) UserSync(_ []*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 memory backed store.Store implementation
func (*Driver) Conn ¶
func (d *Driver) Conn() interface{}
Conn always returns nil for in-memory store
func (*Driver) RoleDelete ¶
func (*Driver) TorrentAdd ¶
Add adds a new torrent to the memory store
func (*Driver) TorrentDelete ¶
Delete will mark a torrent as deleted in the backing store. NOTE the memory store always permanently deletes the torrent
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) UserDelete ¶
Delete removes a user from the backing store
func (*Driver) UserGetByID ¶
GetByID returns a user matching the userId
func (*Driver) UserGetByPasskey ¶
GetByPasskey will lookup and return the user via their passkey used as an identifier The errors returned for this method should be very generic and not reveal any info that could possibly help attackers gain any insight. All error cases MUST return ErrUnauthorized.
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