Documentation ¶
Index ¶
- Constants
- type AddLinkRequest
- type CheckLinkRequest
- type GetLinksRequest
- type GetLinksResult
- type GetNewsRequest
- type GetNewsResult
- type Link
- type LinkCheckerEvents
- type LinkManager
- type LinkManagerEvent
- type LinkManagerEventTypeEnum
- type LinkManagerEvents
- type LinkStatus
- type NewsManager
- type SocialGraphManager
- type UpdateLinkRequest
- type User
- type UserManager
Constants ¶
View Source
const ( LinkStatusPending = "pending" LinkStatusValid = "valid" LinkStatusInvalid = "invalid" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddLinkRequest ¶
type AddLinkRequest struct { Url string Title string Description string Username string Tags map[string]bool }
AddLinkRequest 添加链接请求结构体
type CheckLinkRequest ¶
CheckLinkRequest 检查链接请求结构体
type GetLinksRequest ¶
type GetLinksRequest struct { UrlRegex string TitleRegex string DescriptionRegex string Username string Tag string StartToken string }
GetLinksRequest 获取链接请求结构体
type GetLinksResult ¶
GetLinksResult 获取链接响应结构体
type GetNewsRequest ¶
GetNewsRequest 获取新闻请求结构体
type GetNewsResult ¶
type GetNewsResult struct { Events []*LinkManagerEvent NextToken string }
GetNewsResult 获取新闻响应结构体
type Link ¶
type Link struct { Url string Title string Description string Status LinkStatus Tags map[string]bool CreatedAt time.Time UpdatedAt time.Time }
Link 链接结构体
type LinkCheckerEvents ¶
type LinkCheckerEvents interface {
OnLinkChecked(username string, url string, status LinkStatus)
}
LinkCheckerEvents 链接检查回调
type LinkManager ¶
type LinkManager interface { GetLinks(request GetLinksRequest) (GetLinksResult, error) AddLink(request AddLinkRequest) error UpdateLink(request UpdateLinkRequest) error DeleteLink(username string, url string) error }
LinkManager 链接管理接口
type LinkManagerEvent ¶
type LinkManagerEvent struct { EventType LinkManagerEventTypeEnum Username string Url string Timestamp time.Time }
LinkManagerEvent 链接管理回调结构体
type LinkManagerEventTypeEnum ¶
type LinkManagerEventTypeEnum int
LinkManagerEventTypeEnum 链接管理回调枚举类型 定义新类型
const ( LinkAdded LinkManagerEventTypeEnum = iota LinkUpdated LinkDeleted )
type LinkManagerEvents ¶
type LinkManagerEvents interface { OnLinkAdded(username string, link *Link) OnLinkUpdated(username string, link *Link) OnLinkDeleted(username string, url string) }
LinkManagerEvents 链接管理回调
type NewsManager ¶
type NewsManager interface {
GetNews(request GetNewsRequest) (GetNewsResult, error)
}
NewsManager 新闻管理接口
type SocialGraphManager ¶
type SocialGraphManager interface { Follow(followed string, follower string) error Unfollow(followed string, follower string) error GetFollowing(username string) (map[string]bool, error) GetFollowers(username string) (map[string]bool, error) }
SocialGraphManager 社交图谱管理接口
Click to show internal directories.
Click to hide internal directories.