acfun

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2022 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Site     = "acfun"
	BaseHost = "https://live.acfun.cn"
)
View Source
const (
	Live concern_type.Type = "live"
)
View Source
const (
	PathApiChannelList = "/api/channel/list"
)

Variables

View Source
var BasePath = map[string]string{
	PathApiChannelList: BaseHost,
}

Functions

func APath

func APath(path string) string

func LiveUrl

func LiveUrl(uid int64) string

Types

type ApiChannelListRequest

type ApiChannelListRequest struct {
	Count   int32  `json:"count"`
	PCursor string `json:"pcursor"`
}

type ApiChannelListResponse

type ApiChannelListResponse struct {
	ChannelListData      *ApiChannelListResponse_ChannelListData `protobuf:"bytes,1,opt,name=channelListData,proto3" json:"channelListData,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                `json:"-"`
	XXX_unrecognized     []byte                                  `json:"-"`
	XXX_sizecache        int32                                   `json:"-"`
}

func ApiChannelList

func ApiChannelList(count int32, pcursor string) (*ApiChannelListResponse, error)

func (*ApiChannelListResponse) Descriptor

func (*ApiChannelListResponse) Descriptor() ([]byte, []int)

func (*ApiChannelListResponse) GetChannelListData

func (*ApiChannelListResponse) ProtoMessage

func (*ApiChannelListResponse) ProtoMessage()

func (*ApiChannelListResponse) Reset

func (m *ApiChannelListResponse) Reset()

func (*ApiChannelListResponse) String

func (m *ApiChannelListResponse) String() string

func (*ApiChannelListResponse) XXX_DiscardUnknown

func (m *ApiChannelListResponse) XXX_DiscardUnknown()

func (*ApiChannelListResponse) XXX_Marshal

func (m *ApiChannelListResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ApiChannelListResponse) XXX_Merge

func (m *ApiChannelListResponse) XXX_Merge(src proto.Message)

func (*ApiChannelListResponse) XXX_Size

func (m *ApiChannelListResponse) XXX_Size() int

func (*ApiChannelListResponse) XXX_Unmarshal

func (m *ApiChannelListResponse) XXX_Unmarshal(b []byte) error

type ApiChannelListResponse_ChannelListData

type ApiChannelListResponse_ChannelListData struct {
	Result               int64                                                  `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
	RequestId            string                                                 `protobuf:"bytes,2,opt,name=requestId,proto3" json:"requestId,omitempty"`
	LiveList             []*ApiChannelListResponse_ChannelListData_LiveListItem `protobuf:"bytes,3,rep,name=liveList,proto3" json:"liveList,omitempty"`
	Count                int32                                                  `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"`
	Pcursor              string                                                 `protobuf:"bytes,5,opt,name=pcursor,proto3" json:"pcursor,omitempty"`
	TotalCount           int32                                                  `protobuf:"varint,6,opt,name=totalCount,proto3" json:"totalCount,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                               `json:"-"`
	XXX_unrecognized     []byte                                                 `json:"-"`
	XXX_sizecache        int32                                                  `json:"-"`
}

func (*ApiChannelListResponse_ChannelListData) Descriptor

func (*ApiChannelListResponse_ChannelListData) Descriptor() ([]byte, []int)

func (*ApiChannelListResponse_ChannelListData) GetCount

func (*ApiChannelListResponse_ChannelListData) GetLiveList

func (*ApiChannelListResponse_ChannelListData) GetPcursor

func (*ApiChannelListResponse_ChannelListData) GetRequestId

func (*ApiChannelListResponse_ChannelListData) GetResult

func (*ApiChannelListResponse_ChannelListData) GetTotalCount

func (m *ApiChannelListResponse_ChannelListData) GetTotalCount() int32

func (*ApiChannelListResponse_ChannelListData) ProtoMessage

func (*ApiChannelListResponse_ChannelListData) Reset

func (*ApiChannelListResponse_ChannelListData) String

func (*ApiChannelListResponse_ChannelListData) XXX_DiscardUnknown

func (m *ApiChannelListResponse_ChannelListData) XXX_DiscardUnknown()

func (*ApiChannelListResponse_ChannelListData) XXX_Marshal

func (m *ApiChannelListResponse_ChannelListData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ApiChannelListResponse_ChannelListData) XXX_Merge

func (*ApiChannelListResponse_ChannelListData) XXX_Size

func (*ApiChannelListResponse_ChannelListData) XXX_Unmarshal

func (m *ApiChannelListResponse_ChannelListData) XXX_Unmarshal(b []byte) error

type ApiChannelListResponse_ChannelListData_LiveListItem

type ApiChannelListResponse_ChannelListData_LiveListItem struct {
	User                 *ApiChannelListResponse_ChannelListData_LiveListItem_User `protobuf:"bytes,6,opt,name=user,proto3" json:"user,omitempty"`
	CoverUrls            []string                                                  `protobuf:"bytes,7,rep,name=coverUrls,proto3" json:"coverUrls,omitempty"`
	Title                string                                                    `protobuf:"bytes,8,opt,name=title,proto3" json:"title,omitempty"`
	CreateTime           int64                                                     `protobuf:"varint,9,opt,name=createTime,proto3" json:"createTime,omitempty"`
	AuthorId             int64                                                     `protobuf:"varint,10,opt,name=authorId,proto3" json:"authorId,omitempty"`
	LiveId               string                                                    `protobuf:"bytes,11,opt,name=liveId,proto3" json:"liveId,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                                  `json:"-"`
	XXX_unrecognized     []byte                                                    `json:"-"`
	XXX_sizecache        int32                                                     `json:"-"`
}

func (*ApiChannelListResponse_ChannelListData_LiveListItem) Descriptor

func (*ApiChannelListResponse_ChannelListData_LiveListItem) GetAuthorId

func (*ApiChannelListResponse_ChannelListData_LiveListItem) GetCoverUrls

func (*ApiChannelListResponse_ChannelListData_LiveListItem) GetCreateTime

func (*ApiChannelListResponse_ChannelListData_LiveListItem) GetLiveId

func (*ApiChannelListResponse_ChannelListData_LiveListItem) GetTitle

func (*ApiChannelListResponse_ChannelListData_LiveListItem) GetUser

func (*ApiChannelListResponse_ChannelListData_LiveListItem) ProtoMessage

func (*ApiChannelListResponse_ChannelListData_LiveListItem) Reset

func (*ApiChannelListResponse_ChannelListData_LiveListItem) String

func (*ApiChannelListResponse_ChannelListData_LiveListItem) XXX_DiscardUnknown

func (*ApiChannelListResponse_ChannelListData_LiveListItem) XXX_Marshal

func (m *ApiChannelListResponse_ChannelListData_LiveListItem) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ApiChannelListResponse_ChannelListData_LiveListItem) XXX_Merge

func (*ApiChannelListResponse_ChannelListData_LiveListItem) XXX_Size

func (*ApiChannelListResponse_ChannelListData_LiveListItem) XXX_Unmarshal

type ApiChannelListResponse_ChannelListData_LiveListItem_User

type ApiChannelListResponse_ChannelListData_LiveListItem_User struct {
	Action               int32    `protobuf:"varint,1,opt,name=action,proto3" json:"action,omitempty"`
	Id                   string   `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
	Name                 string   `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	FanCountValue        int64    `protobuf:"varint,4,opt,name=fanCountValue,proto3" json:"fanCountValue,omitempty"`
	FanCount             string   `protobuf:"bytes,5,opt,name=fanCount,proto3" json:"fanCount,omitempty"`
	HeadUrl              string   `protobuf:"bytes,6,opt,name=headUrl,proto3" json:"headUrl,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

bool disableDanmakuShow = 1; string requestId = 2; string groupId = 3; int32 action = 4; int32 href = 5;

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) Descriptor

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) GetAction

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) GetFanCount

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) GetFanCountValue

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) GetHeadUrl

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) GetId

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) GetName

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) ProtoMessage

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) Reset

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) String

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) XXX_DiscardUnknown

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) XXX_Marshal

func (m *ApiChannelListResponse_ChannelListData_LiveListItem_User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) XXX_Merge

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) XXX_Size

func (*ApiChannelListResponse_ChannelListData_LiveListItem_User) XXX_Unmarshal

type Concern

type Concern struct {
	*StateManager
	// contains filtered or unexported fields
}

func NewConcern

func NewConcern(notifyChan chan<- concern.Notify) *Concern

func (*Concern) Add

func (c *Concern) Add(ctx mmsg.IMsgCtx, groupCode int64, id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)

func (*Concern) FindOrLoadUserInfo

func (c *Concern) FindOrLoadUserInfo(uid int64) (*UserInfo, error)

func (*Concern) FindUserInfo

func (c *Concern) FindUserInfo(uid int64, load bool) (*UserInfo, error)

func (*Concern) Get

func (c *Concern) Get(id interface{}) (concern.IdentityInfo, error)

func (*Concern) GetStateManager

func (c *Concern) GetStateManager() concern.IStateManager

func (*Concern) GroupWatchNotify

func (c *Concern) GroupWatchNotify(groupCode, mid int64)

func (Concern) LiveInfoKey

func (e Concern) LiveInfoKey(keys ...interface{}) string

func (Concern) NotLiveKey

func (e Concern) NotLiveKey(keys ...interface{}) string

func (*Concern) ParseId

func (c *Concern) ParseId(s string) (interface{}, error)

func (*Concern) Remove

func (c *Concern) Remove(ctx mmsg.IMsgCtx, groupCode int64, id interface{}, ctype concern_type.Type) (concern.IdentityInfo, error)

func (*Concern) Site

func (c *Concern) Site() string

func (*Concern) Start

func (c *Concern) Start() error

func (*Concern) Stop

func (c *Concern) Stop()

func (*Concern) Types

func (c *Concern) Types() []concern_type.Type

func (Concern) UidFirstTimestamp

func (e Concern) UidFirstTimestamp(keys ...interface{}) string

func (Concern) UserInfoKey

func (e Concern) UserInfoKey(keys ...interface{}) string

type ConcernLiveNotify

type ConcernLiveNotify struct {
	GroupCode int64
	*LiveInfo
}

func NewConcernLiveNotify

func NewConcernLiveNotify(groupCode int64, info *LiveInfo) *ConcernLiveNotify

func (*ConcernLiveNotify) GetGroupCode

func (notify *ConcernLiveNotify) GetGroupCode() int64

func (*ConcernLiveNotify) Logger

func (notify *ConcernLiveNotify) Logger() *logrus.Entry

func (*ConcernLiveNotify) ToMessage

func (notify *ConcernLiveNotify) ToMessage() (m *mmsg.MSG)

type GroupConcernConfig

type GroupConcernConfig struct {
	concern.IConfig
}

func NewGroupConcernConfig

func NewGroupConcernConfig(g concern.IConfig) *GroupConcernConfig

type LiveInfo

type LiveInfo struct {
	UserInfo
	LiveId   string `json:"live_id"`
	Title    string `json:"title"`
	Cover    string `json:"cover"`
	StartTs  int64  `json:"start_ts"`
	IsLiving bool   `json:"living"`
	// contains filtered or unexported fields
}

func (*LiveInfo) GetMSG added in v1.0.1

func (l *LiveInfo) GetMSG() *mmsg.MSG

func (*LiveInfo) IsLive

func (l *LiveInfo) IsLive() bool

func (*LiveInfo) LiveStatusChanged

func (l *LiveInfo) LiveStatusChanged() bool

func (*LiveInfo) Living

func (l *LiveInfo) Living() bool

func (*LiveInfo) Logger

func (l *LiveInfo) Logger() *logrus.Entry

func (*LiveInfo) Site

func (l *LiveInfo) Site() string

func (*LiveInfo) TitleChanged

func (l *LiveInfo) TitleChanged() bool

func (*LiveInfo) Type

func (l *LiveInfo) Type() concern_type.Type

type LivePageResponse added in v1.0.3

type LivePageResponse struct {
	LiveInfo             *LivePageResponse_LiveInfo `protobuf:"bytes,1,opt,name=liveInfo,proto3" json:"liveInfo,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                   `json:"-"`
	XXX_unrecognized     []byte                     `json:"-"`
	XXX_sizecache        int32                      `json:"-"`
}

func LivePage added in v1.0.3

func LivePage(uid int64) (*LivePageResponse, error)

func (*LivePageResponse) Descriptor added in v1.0.3

func (*LivePageResponse) Descriptor() ([]byte, []int)

func (*LivePageResponse) GetLiveInfo added in v1.0.3

func (m *LivePageResponse) GetLiveInfo() *LivePageResponse_LiveInfo

func (*LivePageResponse) ProtoMessage added in v1.0.3

func (*LivePageResponse) ProtoMessage()

func (*LivePageResponse) Reset added in v1.0.3

func (m *LivePageResponse) Reset()

func (*LivePageResponse) String added in v1.0.3

func (m *LivePageResponse) String() string

func (*LivePageResponse) XXX_DiscardUnknown added in v1.0.3

func (m *LivePageResponse) XXX_DiscardUnknown()

func (*LivePageResponse) XXX_Marshal added in v1.0.3

func (m *LivePageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LivePageResponse) XXX_Merge added in v1.0.3

func (m *LivePageResponse) XXX_Merge(src proto.Message)

func (*LivePageResponse) XXX_Size added in v1.0.3

func (m *LivePageResponse) XXX_Size() int

func (*LivePageResponse) XXX_Unmarshal added in v1.0.3

func (m *LivePageResponse) XXX_Unmarshal(b []byte) error

type LivePageResponse_LiveInfo added in v1.0.3

type LivePageResponse_LiveInfo struct {
	User                 *LivePageResponse_LiveInfo_User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                        `json:"-"`
	XXX_unrecognized     []byte                          `json:"-"`
	XXX_sizecache        int32                           `json:"-"`
}

func (*LivePageResponse_LiveInfo) Descriptor added in v1.0.3

func (*LivePageResponse_LiveInfo) Descriptor() ([]byte, []int)

func (*LivePageResponse_LiveInfo) GetUser added in v1.0.3

func (*LivePageResponse_LiveInfo) ProtoMessage added in v1.0.3

func (*LivePageResponse_LiveInfo) ProtoMessage()

func (*LivePageResponse_LiveInfo) Reset added in v1.0.3

func (m *LivePageResponse_LiveInfo) Reset()

func (*LivePageResponse_LiveInfo) String added in v1.0.3

func (m *LivePageResponse_LiveInfo) String() string

func (*LivePageResponse_LiveInfo) XXX_DiscardUnknown added in v1.0.3

func (m *LivePageResponse_LiveInfo) XXX_DiscardUnknown()

func (*LivePageResponse_LiveInfo) XXX_Marshal added in v1.0.3

func (m *LivePageResponse_LiveInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LivePageResponse_LiveInfo) XXX_Merge added in v1.0.3

func (m *LivePageResponse_LiveInfo) XXX_Merge(src proto.Message)

func (*LivePageResponse_LiveInfo) XXX_Size added in v1.0.3

func (m *LivePageResponse_LiveInfo) XXX_Size() int

func (*LivePageResponse_LiveInfo) XXX_Unmarshal added in v1.0.3

func (m *LivePageResponse_LiveInfo) XXX_Unmarshal(b []byte) error

type LivePageResponse_LiveInfo_User added in v1.0.3

type LivePageResponse_LiveInfo_User struct {
	HeadUrl              string   `protobuf:"bytes,1,opt,name=headUrl,proto3" json:"headUrl,omitempty"`
	FanCountValue        int32    `protobuf:"varint,2,opt,name=fanCountValue,proto3" json:"fanCountValue,omitempty"`
	Name                 string   `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*LivePageResponse_LiveInfo_User) Descriptor added in v1.0.3

func (*LivePageResponse_LiveInfo_User) Descriptor() ([]byte, []int)

func (*LivePageResponse_LiveInfo_User) GetFanCountValue added in v1.0.3

func (m *LivePageResponse_LiveInfo_User) GetFanCountValue() int32

func (*LivePageResponse_LiveInfo_User) GetHeadUrl added in v1.0.3

func (m *LivePageResponse_LiveInfo_User) GetHeadUrl() string

func (*LivePageResponse_LiveInfo_User) GetName added in v1.0.3

func (*LivePageResponse_LiveInfo_User) ProtoMessage added in v1.0.3

func (*LivePageResponse_LiveInfo_User) ProtoMessage()

func (*LivePageResponse_LiveInfo_User) Reset added in v1.0.3

func (m *LivePageResponse_LiveInfo_User) Reset()

func (*LivePageResponse_LiveInfo_User) String added in v1.0.3

func (*LivePageResponse_LiveInfo_User) XXX_DiscardUnknown added in v1.0.3

func (m *LivePageResponse_LiveInfo_User) XXX_DiscardUnknown()

func (*LivePageResponse_LiveInfo_User) XXX_Marshal added in v1.0.3

func (m *LivePageResponse_LiveInfo_User) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LivePageResponse_LiveInfo_User) XXX_Merge added in v1.0.3

func (m *LivePageResponse_LiveInfo_User) XXX_Merge(src proto.Message)

func (*LivePageResponse_LiveInfo_User) XXX_Size added in v1.0.3

func (m *LivePageResponse_LiveInfo_User) XXX_Size() int

func (*LivePageResponse_LiveInfo_User) XXX_Unmarshal added in v1.0.3

func (m *LivePageResponse_LiveInfo_User) XXX_Unmarshal(b []byte) error

type StateManager

type StateManager struct {
	*concern.StateManager
	// contains filtered or unexported fields
}

func NewStateManager

func NewStateManager(notify chan<- concern.Notify) *StateManager

func (*StateManager) AddLiveInfo

func (s *StateManager) AddLiveInfo(info *LiveInfo) error

func (*StateManager) AddUserInfo

func (s *StateManager) AddUserInfo(info *UserInfo) error

func (*StateManager) ClearNotLiveCount

func (s *StateManager) ClearNotLiveCount(uid int64) error

func (*StateManager) DeleteLiveInfo

func (s *StateManager) DeleteLiveInfo(uid int64) error

func (*StateManager) GetGroupConcernConfig

func (s *StateManager) GetGroupConcernConfig(groupCode int64, id interface{}) (concernConfig concern.IConfig)

func (*StateManager) GetLiveInfo

func (s *StateManager) GetLiveInfo(uid int64) (*LiveInfo, error)

func (*StateManager) GetUidFirstTimestamp

func (s *StateManager) GetUidFirstTimestamp(uid int64) (timestamp int64, err error)

func (*StateManager) GetUserInfo

func (s *StateManager) GetUserInfo(uid int64) (*UserInfo, error)

func (*StateManager) IncNotLiveCount

func (s *StateManager) IncNotLiveCount(uid int64) int64

func (*StateManager) LiveInfoKey

func (e *StateManager) LiveInfoKey(keys ...interface{}) string

func (*StateManager) NotLiveKey

func (e *StateManager) NotLiveKey(keys ...interface{}) string

func (*StateManager) SetUidFirstTimestampIfNotExist

func (s *StateManager) SetUidFirstTimestampIfNotExist(uid int64, timestamp int64) error

func (*StateManager) UidFirstTimestamp

func (e *StateManager) UidFirstTimestamp(keys ...interface{}) string

func (*StateManager) UserInfoKey

func (e *StateManager) UserInfoKey(keys ...interface{}) string

type UserInfo

type UserInfo struct {
	Uid      int64  `json:"uid"`
	Name     string `json:"name"`
	Followed int    `json:"followed"`
	UserImg  string `json:"user_img"`
	LiveUrl  string `json:"live_url"`
}

func (*UserInfo) GetName

func (u *UserInfo) GetName() string

func (*UserInfo) GetUid

func (u *UserInfo) GetUid() interface{}

Jump to

Keyboard shortcuts

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