Documentation ¶
Index ¶
- Constants
- type Social
- func (social *Social) FollowUser(fromId, toId string) error
- func (social *Social) HomeTimeLine(size int64, offset int64) []*Status
- func (social *Social) NewStatus(uid string, message string) error
- func (social *Social) NewUser(login string, name string) (string, error)
- func (social *Social) ProfileTimeline(uid string, size int64, offset int64) []*Status
- func (social *Social) UnFollowUser(fromId, toId string) error
- type Status
- type User
Constants ¶
View Source
const HOME_TIME_LINE_LIMIT = 1000
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Social ¶
type Social struct {
Client *redis.Client
}
func NewSocial ¶
func NewSocial() *Social
user:$UserId ----- hset // User Info
login: user.Login, id: user.Id, name: user.Name, followers: user.Followers, followings: user.Followings, posts: user.Posts, signup: user.SignUp,
user:id: ------ int // user唯一ID users: hash ------ login -> id status:$statusId ---- status
message: posted: id: uid: login:
status:id: ---- int // status唯一ID
home:timeline: ----- zset
$statusId $posted
user:timeline:$uid ----- zset
$statusId $posted
followers:$uid ----- zset
$uid1 $time
following:$uid ----- zset
$uid1 $time
home:$uid ------ zset
$statusId $posted
func (*Social) FollowUser ¶
func (*Social) HomeTimeLine ¶
HomeTimeLine: 主页的timeline
func (*Social) ProfileTimeline ¶
func (*Social) UnFollowUser ¶
Click to show internal directories.
Click to hide internal directories.