storage

package
v0.0.0-...-eedd7ff Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2018 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserInfo

type UserInfo struct {
	Uid      string
	Name     string
	Password string
}

type UserRedisStore

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

func NewUserRedisStore

func NewUserRedisStore(redisAddr string) *UserRedisStore

func (*UserRedisStore) AddRoom

func (urs *UserRedisStore) AddRoom(uid string, rids ...string) error

func (*UserRedisStore) GenUid

func (urs *UserRedisStore) GenUid() (string, error)

func (*UserRedisStore) Get

func (urs *UserRedisStore) Get(uid string) (*UserInfo, error)

func (*UserRedisStore) GetRooms

func (urs *UserRedisStore) GetRooms(id string) ([]string, error)

func (*UserRedisStore) RemoveRoom

func (urs *UserRedisStore) RemoveRoom(uid string, rids ...string) error

func (*UserRedisStore) Set

func (urs *UserRedisStore) Set(uid string, u *UserInfo) error

type UserStore

type UserStore interface {
	GetRooms(uid string) ([]string, error)
	AddRoom(uid string, rids ...string) error
	RemoveRoom(uid string, rids ...string) error
	Get(uid string) (*UserInfo, error)
	Set(uid string, u *UserInfo) error
	GenUid() (string, error)
}

Jump to

Keyboard shortcuts

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