Documentation
¶
Overview ¶
Package comment contains validated parameters and response models for the Bilibili comment domain.
Index ¶
- type Client
- func (c Client) Count(ctx context.Context, params CountParams) (Count, error)
- func (c Client) Hot(ctx context.Context, params HotParams) (*Hot, error)
- func (c Client) List(ctx context.Context, params ListParams) (List, error)
- func (c Client) Replies(ctx context.Context, params RepliesParams) (List, error)
- type Content
- type Count
- type CountParams
- type Hot
- type HotPage
- type HotParams
- type List
- type ListParams
- type Member
- type Page
- type RepliesParams
- type Reply
- type Sort
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides comment-domain operations.
func (Client) Hot ¶
Hot gets hot replies when the API returns a payload. A successful null or missing data field returns (nil, nil).
type CountParams ¶
type CountParams struct {
// contains filtered or unexported fields
}
func NewCountParams ¶
func NewCountParams(target Target) CountParams
func (CountParams) EncodeQuery ¶
func (p CountParams) EncodeQuery() (url.Values, error)
type Hot ¶
type Hot struct {
Page HotPage `json:"page"`
Replies []json.RawMessage `json:"replies"`
}
Hot is a hot-comment payload when the endpoint returns one. Individual reply bodies remain raw until promoted fixtures establish a stable subset.
type HotPage ¶
type HotPage struct {
AllCount int64 `json:"acount"`
Count int64 `json:"count"`
Page int32 `json:"num"`
Size int32 `json:"size"`
}
HotPage contains hot-comment pagination counters.
type HotParams ¶
type HotParams struct {
// contains filtered or unexported fields
}
HotParams configures comment.read.hot.
func NewHotParams ¶
NewHotParams creates hot-comment parameters for a positive root reply ID.
func (HotParams) EncodeQuery ¶
EncodeQuery returns a new URL query containing the request parameters.
type List ¶
type List struct {
Page *Page `json:"page"`
Replies []Reply `json:"replies"`
TopReplies []Reply `json:"top_replies"`
Root *Reply `json:"root"`
Config json.RawMessage `json:"config"`
Control json.RawMessage `json:"control"`
Cursor json.RawMessage `json:"cursor"`
Top json.RawMessage `json:"top"`
Upper json.RawMessage `json:"upper"`
}
type ListParams ¶
type ListParams struct {
// contains filtered or unexported fields
}
func NewListParams ¶
func NewListParams(target Target) ListParams
func (ListParams) EncodeQuery ¶
func (p ListParams) EncodeQuery() (url.Values, error)
func (ListParams) WithPage ¶
func (p ListParams) WithPage(page uint32) (ListParams, error)
func (ListParams) WithPageSize ¶
func (p ListParams) WithPageSize(size uint32) (ListParams, error)
func (ListParams) WithSort ¶
func (p ListParams) WithSort(sort Sort) (ListParams, error)
func (ListParams) WithoutHot ¶
func (p ListParams) WithoutHot(noHot bool) ListParams
type RepliesParams ¶
type RepliesParams struct {
// contains filtered or unexported fields
}
func NewRepliesParams ¶
func NewRepliesParams(target Target, root int64) (RepliesParams, error)
func (RepliesParams) EncodeQuery ¶
func (p RepliesParams) EncodeQuery() (url.Values, error)
func (RepliesParams) WithPage ¶
func (p RepliesParams) WithPage(page uint32) (RepliesParams, error)
func (RepliesParams) WithPageSize ¶
func (p RepliesParams) WithPageSize(size uint32) (RepliesParams, error)
type Reply ¶
type Reply struct {
RPID int64 `json:"rpid"`
OID int64 `json:"oid"`
Type int64 `json:"type"`
MID int64 `json:"mid"`
Root int64 `json:"root"`
Parent int64 `json:"parent"`
Count int64 `json:"count"`
ReplyCount int64 `json:"rcount"`
CreatedAt int64 `json:"ctime"`
Likes int64 `json:"like"`
Member Member `json:"member"`
Content Content `json:"content"`
Replies []Reply `json:"replies"`
}