Documentation
¶
Index ¶
- Variables
- func BookmarkStatus(user *ActUser, statusID string) error
- func Bookmarked(statusID, uid string) bool
- func Del(key string) error
- func DeleteMessages(user *ActUser, msgs []string) error
- func DeleteTipMessages(user *ActUser, msgs []string) error
- func FollowUser(user *ActUser, uniqueName string) error
- func Followed(u1, u2 string) bool
- func InitState(opts EtcdOptions) (err error)
- func IterateWithPrefix(prefix string, handle func(key string, value []byte)) error
- func LikeStatus(user *ActUser, statusID string) error
- func Liked(statusID, uid string) bool
- func ListTipMessages(user *ActUser, size int64) (msgs []string)
- func NotRecommandStatus(statusID string) error
- func Put(key string, value []byte) error
- func RecommandStatus(statusID string) error
- func RecommendCount(user *ActUser, createRev int64) int
- type ActUser
- type CommentsRecommandMeta
- type EtcdOptions
- type Label
- type MemorySessionManger
- type Message
- type ModifiableUser
- type MsgOptions
- type PersistentSessionManager
- type Session
- type SessionManager
- type Status
- func GetStatus(statusID string) *Status
- func ListBookmarks(user *ActUser, opts *tools.PaginationOptions) ([]*Status, bool)
- func ListStatusByKeyword(value string, opts *tools.PaginationOptions) []*Status
- func ListStatusByLabel(value string, opts *tools.PaginationOptions) ([]*Status, bool)
- func NewStatus(opts *StatusOptions) (*Status, error)
- func Recommendations(user *ActUser, opts *tools.PaginationOptions) (ss []*Status, more bool)
- func StatusComments(statusID string, opts *tools.PaginationOptions) (ss []*Status, more bool)
- type StatusCommentsOptions
- type StatusFragment
- type StatusOptions
- type StatusViewCountManager
- type User
- func (u *User) Followers() int64
- func (u *User) FollowingBy(user *ActUser) bool
- func (u *User) Followings() int64
- func (u *User) ListStatus(opts *tools.PaginationOptions) (ss []*Status, more bool)
- func (u *User) Modify(mu ModifiableUser) error
- func (u *User) SetVerified(code int64) error
- func (u *User) Tweets() int64
- type UserOptions
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func BookmarkStatus ¶
func Bookmarked ¶
func DeleteMessages ¶
func DeleteTipMessages ¶
func FollowUser ¶
func InitState ¶
func InitState(opts EtcdOptions) (err error)
func IterateWithPrefix ¶
func LikeStatus ¶
func ListTipMessages ¶
func NotRecommandStatus ¶ added in v0.2.0
func RecommandStatus ¶ added in v0.2.0
func RecommendCount ¶ added in v0.1.0
Types ¶
type CommentsRecommandMeta ¶ added in v0.2.0
type CommentsRecommandMeta struct {
Blacklist []string `json:"blacklist"`
RecommandID string `json:"recommandID"`
// contains filtered or unexported fields
}
func NewCommentsRecommandMeta ¶ added in v0.2.0
func NewCommentsRecommandMeta(statusID string) (meta *CommentsRecommandMeta, err error)
func NewCommentsRecommandMetaForRecommand ¶ added in v0.2.0
func NewCommentsRecommandMetaForRecommand(statusID string) (meta *CommentsRecommandMeta, err error)
func (*CommentsRecommandMeta) Recommand ¶ added in v0.2.0
func (m *CommentsRecommandMeta) Recommand() *Status
func (*CommentsRecommandMeta) RunRecommand ¶ added in v0.2.0
func (m *CommentsRecommandMeta) RunRecommand(statusCreateRev int64) error
type EtcdOptions ¶
type MemorySessionManger ¶
type MemorySessionManger struct {
// contains filtered or unexported fields
}
func (*MemorySessionManger) Create ¶
func (sm *MemorySessionManger) Create(s *Session) error
func (*MemorySessionManger) Delete ¶
func (sm *MemorySessionManger) Delete(apiKey string) error
func (*MemorySessionManger) Expire ¶
func (sm *MemorySessionManger) Expire(userID string) error
func (*MemorySessionManger) Load ¶
func (sm *MemorySessionManger) Load(key string) *Session
type Message ¶
type Message struct {
ID string `json:"id"`
Message string `json:"message,omitempty"`
From *ActUser `json:"from"`
Type string `json:"type"`
TargetID string `json:"targetID"`
CreateTime time.Time `json:"createTime"`
}
func ListMessages ¶
func ListMessages(user *ActUser, opts *tools.PaginationOptions) (msgs []*Message, more bool)
type ModifiableUser ¶
type MsgOptions ¶
type MsgOptions struct {
// contains filtered or unexported fields
}
type PersistentSessionManager ¶
type PersistentSessionManager struct {
MemorySessionManger
}
func NewSessionManager ¶
func NewSessionManager() *PersistentSessionManager
func (*PersistentSessionManager) Create ¶
func (sm *PersistentSessionManager) Create(s *Session) error
func (*PersistentSessionManager) Delete ¶
func (sm *PersistentSessionManager) Delete(apiKey string) error
func (*PersistentSessionManager) Expire ¶
func (sm *PersistentSessionManager) Expire(userID string) error
type Session ¶
type Session struct {
ApiKey string `json:"apiKey"`
ID string `json:"id"`
Name string `json:"name"`
UniqueName string `json:"uniqueName"`
Picture string `json:"picture"`
Locale string `json:"locale"`
Bio string `json:"bio"`
VerifiedCode int64 `json:"verifiedCode"`
Admin bool `json:"admin"`
}
func CreateSession ¶
func CreateSession(opts *UserOptions) (*Session, error)
type SessionManager ¶
type SessionManager interface {
Create(*Session) error
Load(string) *Session
Delete(string) error
Expire(string) error
}
var DefaultSessionManager SessionManager
type Status ¶
type Status struct {
ID string `json:"id"`
Content []*StatusFragment `json:"content"`
RefStatus string `json:"prev"`
User *ActUser `json:"user"`
CreateRev int64 `json:"createRev"`
CreateTime time.Time `json:"createTime"`
Comments int64 `json:"comments"`
LikeCount int64 `json:"likeCount"`
Views int64 `json:"views"`
Bookmarks int64 `json:"bookmarks"`
}
func ListBookmarks ¶
func ListBookmarks(user *ActUser, opts *tools.PaginationOptions) ([]*Status, bool)
func ListStatusByKeyword ¶
func ListStatusByKeyword(value string, opts *tools.PaginationOptions) []*Status
func ListStatusByLabel ¶
func ListStatusByLabel(value string, opts *tools.PaginationOptions) ([]*Status, bool)
func NewStatus ¶
func NewStatus(opts *StatusOptions) (*Status, error)
func Recommendations ¶
func Recommendations(user *ActUser, opts *tools.PaginationOptions) (ss []*Status, more bool)
func StatusComments ¶
func StatusComments(statusID string, opts *tools.PaginationOptions) (ss []*Status, more bool)
func (*Status) ContentsByType ¶ added in v0.2.0
func (s *Status) ContentsByType(t string) (sfs []*StatusFragment)
type StatusCommentsOptions ¶
type StatusFragment ¶
type StatusOptions ¶
type StatusOptions struct {
Content []*StatusFragment
RefStatus string
User *ActUser
Labels []string
At []string
}
type StatusViewCountManager ¶ added in v0.2.1
type StatusViewCountManager struct {
// contains filtered or unexported fields
}
var ( UserChanged chan *User = make(chan *User, 128) SVCM StatusViewCountManager = StatusViewCountManager{ // contains filtered or unexported fields } )
func (*StatusViewCountManager) Viewed ¶ added in v0.2.1
func (m *StatusViewCountManager) Viewed(statusID string)
type User ¶
type User struct {
ID string `json:"id"`
UniqueName string `json:"uniqueName"`
Name string `json:"name"`
Picture string `json:"picture"`
Email string `json:"email"`
Locale string `json:"locale"`
CreateTime time.Time `json:"createTime"`
Bio string `json:"bio"`
VerifiedCode int64 `json:"verifiedCode"`
ModRev int64 `json:"-"`
}
func NewUser ¶
func NewUser(opts *UserOptions) *User
func UserByEmail ¶
func UserByUniqueName ¶
func (*User) FollowingBy ¶
FollowingBy determine if {uid} is following me
func (*User) ListStatus ¶
func (u *User) ListStatus(opts *tools.PaginationOptions) (ss []*Status, more bool)
ListStatus list user all status
func (*User) SetVerified ¶ added in v0.2.0
Click to show internal directories.
Click to hide internal directories.