Documentation
¶
Index ¶
- Constants
- type NodeCacheClient
- func (c *NodeCacheClient) AddNodeTodayTraffic(ctx context.Context, nodeId int64, userTraffic []UserTraffic) error
- func (c *NodeCacheClient) AddOnlineUserIP(ctx context.Context, users []NodeOnlineUser) error
- func (c *NodeCacheClient) AddUserTodayTraffic(ctx context.Context, uid int64, upload, download int64) error
- func (c *NodeCacheClient) GetAllNodeDownloadTraffic(ctx context.Context) (int64, error)
- func (c *NodeCacheClient) GetAllNodeOnlineUser(ctx context.Context) ([]string, error)
- func (c *NodeCacheClient) GetAllNodeUploadTraffic(ctx context.Context) (int64, error)
- func (c *NodeCacheClient) GetNodeOnlineUser(ctx context.Context, nodeId int64) (map[int64][]string, error)
- func (c *NodeCacheClient) GetNodeStatus(ctx context.Context, nodeId int64) (NodeStatus, error)
- func (c *NodeCacheClient) GetNodeTodayDownloadTrafficRank(ctx context.Context, n int64) ([]NodeTodayTrafficRank, error)
- func (c *NodeCacheClient) GetNodeTodayTotalTrafficRank(ctx context.Context, n int64) ([]NodeTodayTrafficRank, error)
- func (c *NodeCacheClient) GetNodeTodayUploadTrafficRank(ctx context.Context, n int64) ([]NodeTodayTrafficRank, error)
- func (c *NodeCacheClient) GetOnlineNodeStatusCount(ctx context.Context) (int64, error)
- func (c *NodeCacheClient) GetUserOnlineIp(ctx context.Context, uid int64) ([]string, error)
- func (c *NodeCacheClient) GetUserTodayDownloadTrafficRank(ctx context.Context, n int64) ([]UserTodayTrafficRank, error)
- func (c *NodeCacheClient) GetUserTodayTotalTrafficRank(ctx context.Context, n int64) ([]UserTodayTrafficRank, error)
- func (c *NodeCacheClient) GetUserTodayUploadTrafficRank(ctx context.Context, n int64) ([]UserTodayTrafficRank, error)
- func (c *NodeCacheClient) GetYesterdayNodeTotalTrafficRank(ctx context.Context) ([]NodeTodayTrafficRank, error)
- func (c *NodeCacheClient) GetYesterdayUserTotalTrafficRank(ctx context.Context) ([]UserTodayTrafficRank, error)
- func (c *NodeCacheClient) ResetTodayTrafficData(ctx context.Context) error
- func (c *NodeCacheClient) UpdateNodeOnlineUser(ctx context.Context, nodeId int64, users []NodeOnlineUser) error
- func (c *NodeCacheClient) UpdateNodeStatus(ctx context.Context, nodeId int64, status NodeStatus) error
- func (c *NodeCacheClient) UpdateYesterdayNodeTotalTrafficRank(ctx context.Context, nodes []NodeTodayTrafficRank) error
- func (c *NodeCacheClient) UpdateYesterdayUserTotalTrafficRank(ctx context.Context, users []UserTodayTrafficRank) error
- type NodeOnlineUser
- type NodeStatus
- type NodeTodayTrafficRank
- type UserTodayTrafficRank
- type UserTraffic
Constants ¶
const ( // UserTodayUploadTrafficCacheKey 用户当日上传流量 UserTodayUploadTrafficCacheKey = "node:user_today_upload_traffic" // UserTodayDownloadTrafficCacheKey 用户当日下载流量 UserTodayDownloadTrafficCacheKey = "node:user_today_download_traffic" // UserTodayTotalTrafficCacheKey 用户当日总流量 UserTodayTotalTrafficCacheKey = "node:user_today_total_traffic" // NodeTodayUploadTrafficCacheKey 节点当日上传流量 NodeTodayUploadTrafficCacheKey = "node:node_today_upload_traffic" // NodeTodayDownloadTrafficCacheKey 节点当日下载流量 NodeTodayDownloadTrafficCacheKey = "node:node_today_download_traffic" // NodeTodayTotalTrafficCacheKey 节点当日总流量 NodeTodayTotalTrafficCacheKey = "node:node_today_total_traffic" // UserTodayUploadTrafficRankKey 用户当日上传流量排行榜 UserTodayUploadTrafficRankKey = "node:user_today_upload_traffic_rank" // UserTodayDownloadTrafficRankKey 用户当日下载流量排行榜 UserTodayDownloadTrafficRankKey = "node:user_today_download_traffic_rank" // UserTodayTotalTrafficRankKey 用户当日总流量排行榜 UserTodayTotalTrafficRankKey = "node:user_today_total_traffic_rank" // NodeTodayUploadTrafficRankKey 节点当日上传流量排行榜 NodeTodayUploadTrafficRankKey = "node:node_today_upload_traffic_rank" // NodeTodayDownloadTrafficRankKey 节点当日下载流量排行榜 NodeTodayDownloadTrafficRankKey = "node:node_today_download_traffic_rank" // NodeTodayTotalTrafficRankKey 节点当日总流量排行榜 NodeTodayTotalTrafficRankKey = "node:node_today_total_traffic_rank" // NodeOnlineUserCacheKey 节点在线用户 NodeOnlineUserCacheKey = "node:node_online_user:%d" // UserOnlineIpCacheKey 用户在线IP UserOnlineIpCacheKey = "node:user_online_ip:%d" // AllNodeOnlineUserCacheKey 所有节点在线用户 AllNodeOnlineUserCacheKey = "node:all_node_online_user" // NodeStatusCacheKey 节点状态 NodeStatusCacheKey = "node:status:%d" // AllNodeDownloadTrafficCacheKey 所有节点下载流量 AllNodeDownloadTrafficCacheKey = "node:all_node_download_traffic" // AllNodeUploadTrafficCacheKey 所有节点上传流量 AllNodeUploadTrafficCacheKey = "node:all_node_upload_traffic" // YesterdayTotalTrafficRank 昨日节点总流量排行榜 YesterdayNodeTotalTrafficRank = "node:yesterday_total_traffic_rank" // YesterdayUploadTrafficRank 昨日节点上传流量排行榜 YesterdayNodeUploadTrafficRank = "node:yesterday_upload_traffic_rank" // YesterdayDownloadTrafficRank 昨日节点下载流量排行榜 YesterdayNodeDownloadTrafficRank = "node:yesterday_download_traffic_rank" // YesterdayUserTotalTrafficRank 昨日用户总流量排行榜 YesterdayUserTotalTrafficRank = "node:yesterday_user_total_traffic_rank" // YesterdayUserUploadTrafficRank 昨日用户上传流量排行榜 YesterdayUserUploadTrafficRank = "node:yesterday_user_upload_traffic_rank" // YesterdayUserDownloadTrafficRank 昨日用户下载流量排行榜 YesterdayUserDownloadTrafficRank = "node:yesterday_user_download_traffic_rank" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeCacheClient ¶
func NewNodeCacheClient ¶
func NewNodeCacheClient(rds *redis.Client) *NodeCacheClient
func (*NodeCacheClient) AddNodeTodayTraffic ¶
func (c *NodeCacheClient) AddNodeTodayTraffic(ctx context.Context, nodeId int64, userTraffic []UserTraffic) error
AddNodeTodayTraffic Add node's today traffic
func (*NodeCacheClient) AddOnlineUserIP ¶
func (c *NodeCacheClient) AddOnlineUserIP(ctx context.Context, users []NodeOnlineUser) error
AddOnlineUserIP adds user's online IP
func (*NodeCacheClient) AddUserTodayTraffic ¶
func (c *NodeCacheClient) AddUserTodayTraffic(ctx context.Context, uid int64, upload, download int64) error
AddUserTodayTraffic Add user's today traffic
func (*NodeCacheClient) GetAllNodeDownloadTraffic ¶
func (c *NodeCacheClient) GetAllNodeDownloadTraffic(ctx context.Context) (int64, error)
GetAllNodeDownloadTraffic Get all node download traffic
func (*NodeCacheClient) GetAllNodeOnlineUser ¶
func (c *NodeCacheClient) GetAllNodeOnlineUser(ctx context.Context) ([]string, error)
GetAllNodeOnlineUser Get all node online user
func (*NodeCacheClient) GetAllNodeUploadTraffic ¶
func (c *NodeCacheClient) GetAllNodeUploadTraffic(ctx context.Context) (int64, error)
GetAllNodeUploadTraffic Get all node upload traffic
func (*NodeCacheClient) GetNodeOnlineUser ¶
func (c *NodeCacheClient) GetNodeOnlineUser(ctx context.Context, nodeId int64) (map[int64][]string, error)
GetNodeOnlineUser gets node's online users and IPs
func (*NodeCacheClient) GetNodeStatus ¶
func (c *NodeCacheClient) GetNodeStatus(ctx context.Context, nodeId int64) (NodeStatus, error)
GetNodeStatus Get node status
func (*NodeCacheClient) GetNodeTodayDownloadTrafficRank ¶
func (c *NodeCacheClient) GetNodeTodayDownloadTrafficRank(ctx context.Context, n int64) ([]NodeTodayTrafficRank, error)
GetNodeTodayDownloadTrafficRank Get node's today download traffic ranking top N
func (*NodeCacheClient) GetNodeTodayTotalTrafficRank ¶
func (c *NodeCacheClient) GetNodeTodayTotalTrafficRank(ctx context.Context, n int64) ([]NodeTodayTrafficRank, error)
GetNodeTodayTotalTrafficRank Get node's today total traffic ranking top N
func (*NodeCacheClient) GetNodeTodayUploadTrafficRank ¶
func (c *NodeCacheClient) GetNodeTodayUploadTrafficRank(ctx context.Context, n int64) ([]NodeTodayTrafficRank, error)
GetNodeTodayUploadTrafficRank Get node's today upload traffic ranking top N
func (*NodeCacheClient) GetOnlineNodeStatusCount ¶
func (c *NodeCacheClient) GetOnlineNodeStatusCount(ctx context.Context) (int64, error)
GetOnlineNodeStatusCount Get Online Node Status Count
func (*NodeCacheClient) GetUserOnlineIp ¶
GetUserOnlineIp gets user's online IPs
func (*NodeCacheClient) GetUserTodayDownloadTrafficRank ¶
func (c *NodeCacheClient) GetUserTodayDownloadTrafficRank(ctx context.Context, n int64) ([]UserTodayTrafficRank, error)
GetUserTodayDownloadTrafficRank Get user's today download traffic ranking top N
func (*NodeCacheClient) GetUserTodayTotalTrafficRank ¶
func (c *NodeCacheClient) GetUserTodayTotalTrafficRank(ctx context.Context, n int64) ([]UserTodayTrafficRank, error)
GetUserTodayTotalTrafficRank Get user's today total traffic ranking top N
func (*NodeCacheClient) GetUserTodayUploadTrafficRank ¶
func (c *NodeCacheClient) GetUserTodayUploadTrafficRank(ctx context.Context, n int64) ([]UserTodayTrafficRank, error)
GetUserTodayUploadTrafficRank Get user's today upload traffic ranking top N
func (*NodeCacheClient) GetYesterdayNodeTotalTrafficRank ¶
func (c *NodeCacheClient) GetYesterdayNodeTotalTrafficRank(ctx context.Context) ([]NodeTodayTrafficRank, error)
GetYesterdayNodeTotalTrafficRank Get yesterday node total traffic rank
func (*NodeCacheClient) GetYesterdayUserTotalTrafficRank ¶
func (c *NodeCacheClient) GetYesterdayUserTotalTrafficRank(ctx context.Context) ([]UserTodayTrafficRank, error)
GetYesterdayUserTotalTrafficRank Get yesterday user total traffic rank
func (*NodeCacheClient) ResetTodayTrafficData ¶
func (c *NodeCacheClient) ResetTodayTrafficData(ctx context.Context) error
ResetTodayTrafficData Reset today's traffic data
func (*NodeCacheClient) UpdateNodeOnlineUser ¶
func (c *NodeCacheClient) UpdateNodeOnlineUser(ctx context.Context, nodeId int64, users []NodeOnlineUser) error
UpdateNodeOnlineUser updates node's online users and IPs
func (*NodeCacheClient) UpdateNodeStatus ¶
func (c *NodeCacheClient) UpdateNodeStatus(ctx context.Context, nodeId int64, status NodeStatus) error
UpdateNodeStatus Update node status
func (*NodeCacheClient) UpdateYesterdayNodeTotalTrafficRank ¶
func (c *NodeCacheClient) UpdateYesterdayNodeTotalTrafficRank(ctx context.Context, nodes []NodeTodayTrafficRank) error
UpdateYesterdayNodeTotalTrafficRank Update yesterday node total traffic rank
func (*NodeCacheClient) UpdateYesterdayUserTotalTrafficRank ¶
func (c *NodeCacheClient) UpdateYesterdayUserTotalTrafficRank(ctx context.Context, users []UserTodayTrafficRank) error
UpdateYesterdayUserTotalTrafficRank Update yesterday user total traffic rank