Documentation ¶
Index ¶
- Variables
- func ValidateResponse(req *http.Request, response interface{}) error
- func ValidateSlice(req *http.Request, slice interface{}) error
- type Client
- func (c *Client) EnterLivestream(ctx context.Context, livestreamID int64, streamerName string, ...) error
- func (c *Client) ExitLivestream(ctx context.Context, livestreamID int64, streamerName string, ...) error
- func (c *Client) GetIcon(ctx context.Context, username string, opts ...ClientOption) ([]byte, error)
- func (c *Client) GetLivecommentReports(ctx context.Context, livestreamID int64, streamerName string, ...) ([]LivecommentReport, error)
- func (c *Client) GetLivecomments(ctx context.Context, livestreamID int64, streamerName string, ...) ([]*Livecomment, error)
- func (c *Client) GetLivestream(ctx context.Context, livestreamID int64, streamerName string, ...) (*Livestream, error)
- func (c *Client) GetLivestreamStatistics(ctx context.Context, livestreamID int64, streamerName string, ...) (*LivestreamStatistics, error)
- func (c *Client) GetMe(ctx context.Context, opts ...ClientOption) (*User, error)
- func (c *Client) GetMyIcon(ctx context.Context, opts ...ClientOption) ([]byte, error)
- func (c *Client) GetMyLivestreams(ctx context.Context, opts ...ClientOption) ([]*Livestream, error)
- func (c *Client) GetNgwords(ctx context.Context, livestreamID int64, streamerName string, ...) ([]*NGWord, error)
- func (c *Client) GetPaymentResult(ctx context.Context) (*PaymentResult, error)
- func (c *Client) GetRandomLivestreamTags(ctx context.Context, n int) ([]int64, error)
- func (c *Client) GetRandomSearchTags(ctx context.Context, n int) ([]string, error)
- func (c *Client) GetReactions(ctx context.Context, livestreamID int64, streamerName string, ...) ([]Reaction, error)
- func (c *Client) GetStreamerTheme(ctx context.Context, streamer *User, opts ...ClientOption) (*Theme, error)
- func (c *Client) GetTags(ctx context.Context, opts ...ClientOption) (*TagsResponse, error)
- func (c *Client) GetTagsWithUser(ctx context.Context, streamerName string, opts ...ClientOption) (*TagsResponse, error)
- func (c *Client) GetUser(ctx context.Context, username string, opts ...ClientOption) (*User, error)
- func (c *Client) GetUserLivestreams(ctx context.Context, username string, opts ...ClientOption) ([]*Livestream, error)
- func (c *Client) GetUserStatistics(ctx context.Context, username string, opts ...ClientOption) (*UserStatistics, error)
- func (c *Client) Initialize(ctx context.Context) (*InitializeResponse, error)
- func (c *Client) Login(ctx context.Context, r *LoginRequest, opts ...ClientOption) error
- func (c *Client) Moderate(ctx context.Context, livestreamID int64, streamerName string, ngWord string, ...) error
- func (c *Client) PostIcon(ctx context.Context, r *PostIconRequest, opts ...ClientOption) (*PostIconResponse, error)
- func (c *Client) PostLivecomment(ctx context.Context, livestreamID int64, streamerName string, comment string, ...) (*PostLivecommentResponse, int, error)
- func (c *Client) PostReaction(ctx context.Context, livestreamID int64, streamerName string, ...) (*Reaction, error)
- func (c *Client) Register(ctx context.Context, r *RegisterRequest, opts ...ClientOption) (*User, error)
- func (c *Client) ReportLivecomment(ctx context.Context, livestreamID int64, streamerName string, ...) error
- func (c *Client) ReserveLivestream(ctx context.Context, streamerName string, r *ReserveLivestreamRequest, ...) (*Livestream, error)
- func (c *Client) SearchLivestreams(ctx context.Context, opts ...ClientOption) ([]*Livestream, error)
- func (c *Client) Username() (string, error)
- type ClientOption
- type ClientOptions
- type ClientPool
- type InitializeResponse
- type LimitParam
- type Livecomment
- type LivecommentPool
- type LivecommentReport
- type Livestream
- type LivestreamPool
- type LivestreamStatistics
- type LoginRequest
- type ModerateRequest
- type ModerateResponse
- type NGWord
- type PaymentResult
- type PostIconRequest
- type PostIconResponse
- type PostLivecommentRequest
- type PostLivecommentResponse
- type PostReactionRequest
- type Reaction
- type RegisterRequest
- type ReserveLivestreamRequest
- type SearchTagParam
- type Tag
- type TagsResponse
- type Theme
- type User
- type UserStatistics
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrCancelRequest = errors.New("ベンチマーク走行が継続できないエラーが発生しました")
Functions ¶
func ValidateResponse ¶
func ValidateSlice ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client は、ISUPipeに対するHTTPクライアントです NOTE: スレッドセーフではありません NOTE: ログインは一度しかできません (何回もログインする場合はClientを個別に作り直す必要がある)
func NewCustomResolverClient ¶
func NewCustomResolverClient(contestantLogger *zap.Logger, dnsResolver *resolver.DNSResolver, customOpts ...agent.AgentOption) (*Client, error)
NewClient は、HTTPクライアント群を初期化します NOTE: キャッシュ無効化オプションなどを指定すると、意図しない挙動をする可能性があります タイムアウトやURLなどの振る舞いでないパラメータを指定するのにcustomOptsを用いてください
func (*Client) EnterLivestream ¶
func (*Client) ExitLivestream ¶
func (*Client) GetLivecommentReports ¶
func (c *Client) GetLivecommentReports(ctx context.Context, livestreamID int64, streamerName string, opts ...ClientOption) ([]LivecommentReport, error)
func (*Client) GetLivecomments ¶
func (c *Client) GetLivecomments(ctx context.Context, livestreamID int64, streamerName string, opts ...ClientOption) ([]*Livecomment, error)
func (*Client) GetLivestream ¶
func (c *Client) GetLivestream( ctx context.Context, livestreamID int64, streamerName string, opts ...ClientOption, ) (*Livestream, error)
func (*Client) GetLivestreamStatistics ¶
func (c *Client) GetLivestreamStatistics(ctx context.Context, livestreamID int64, streamerName string, opts ...ClientOption) (*LivestreamStatistics, error)
func (*Client) GetMyLivestreams ¶
func (c *Client) GetMyLivestreams(ctx context.Context, opts ...ClientOption) ([]*Livestream, error)
自分のライブ配信一覧取得
func (*Client) GetNgwords ¶
func (*Client) GetPaymentResult ¶
func (c *Client) GetPaymentResult(ctx context.Context) (*PaymentResult, error)
func (*Client) GetRandomLivestreamTags ¶
func (*Client) GetRandomSearchTags ¶
func (*Client) GetReactions ¶
func (*Client) GetStreamerTheme ¶
func (*Client) GetTags ¶
func (c *Client) GetTags(ctx context.Context, opts ...ClientOption) (*TagsResponse, error)
func (*Client) GetTagsWithUser ¶
func (c *Client) GetTagsWithUser(ctx context.Context, streamerName string, opts ...ClientOption) (*TagsResponse, error)
func (*Client) GetUserLivestreams ¶
func (c *Client) GetUserLivestreams(ctx context.Context, username string, opts ...ClientOption) ([]*Livestream, error)
特定ユーザのライブ配信取得
func (*Client) GetUserStatistics ¶
func (c *Client) GetUserStatistics(ctx context.Context, username string, opts ...ClientOption) (*UserStatistics, error)
func (*Client) Initialize ¶
func (c *Client) Initialize(ctx context.Context) (*InitializeResponse, error)
func (*Client) Login ¶
func (c *Client) Login(ctx context.Context, r *LoginRequest, opts ...ClientOption) error
ログインを行う. NOTE: ログイン後はログインユーザとして振る舞うので、各種agentやユーザ名、人気ユーザであるかの判定フラグなどの情報もここで確定する
func (*Client) PostIcon ¶
func (c *Client) PostIcon(ctx context.Context, r *PostIconRequest, opts ...ClientOption) (*PostIconResponse, error)
func (*Client) PostLivecomment ¶
func (*Client) PostReaction ¶
func (c *Client) PostReaction(ctx context.Context, livestreamID int64, streamerName string, r *PostReactionRequest, opts ...ClientOption) (*Reaction, error)
func (*Client) Register ¶
func (c *Client) Register(ctx context.Context, r *RegisterRequest, opts ...ClientOption) (*User, error)
func (*Client) ReportLivecomment ¶
func (*Client) ReserveLivestream ¶
func (c *Client) ReserveLivestream(ctx context.Context, streamerName string, r *ReserveLivestreamRequest, opts ...ClientOption) (*Livestream, error)
func (*Client) SearchLivestreams ¶
func (c *Client) SearchLivestreams( ctx context.Context, opts ...ClientOption, ) ([]*Livestream, error)
type ClientOption ¶
type ClientOption func(o *ClientOptions)
func WithETag ¶
func WithETag(eTag string) ClientOption
func WithLimitQueryParam ¶
func WithLimitQueryParam(limit int) ClientOption
func WithSearchTagQueryParam ¶
func WithSearchTagQueryParam(tag string) ClientOption
func WithStatusCode ¶
func WithStatusCode(statusCode int) ClientOption
func WithValidateReportLivecomment ¶
func WithValidateReportLivecomment() ClientOption
type ClientOptions ¶
type ClientOptions struct {
// contains filtered or unexported fields
}
type ClientPool ¶
type ClientPool struct {
// contains filtered or unexported fields
}
ClientPool は、ログイン後のクライアントプールです
func NewClientPool ¶
func NewClientPool(ctx context.Context) *ClientPool
type InitializeResponse ¶
type InitializeResponse struct {
Language string `json:"language" validate:"required"`
}
type LimitParam ¶
type LimitParam struct {
Limit int
}
type Livecomment ¶
type Livecomment struct { ID int64 `json:"id" validate:"required"` User User `json:"user" validate:"required"` Livestream Livestream `json:"livestream" validate:"required"` Comment string `json:"comment" validate:"required"` // NOTE: Tipがない場合が許容される(tip=0) Tip int `json:"tip"` CreatedAt int `json:"created_at" validate:"required"` }
type LivecommentPool ¶
type LivecommentPool struct {
// contains filtered or unexported fields
}
func NewLivecommentPool ¶
func NewLivecommentPool(ctx context.Context) *LivecommentPool
func (*LivecommentPool) Get ¶
func (p *LivecommentPool) Get(ctx context.Context) (*Livecomment, error)
func (*LivecommentPool) Put ¶
func (p *LivecommentPool) Put(ctx context.Context, livecomment *Livecomment)
type LivecommentReport ¶
type LivecommentReport struct { ID int64 `json:"id" validate:"required"` Reporter User `json:"reporter" validate:"required"` Livecomment Livecomment `json:"livecomment" validate:"required"` CreatedAt int64 `json:"created_at" validate:"required"` }
type Livestream ¶
type Livestream struct { ID int64 `json:"id" validate:"required"` Owner User `json:"owner" validate:"required"` Tags []Tag `json:"tags" validate:"required,dive,required"` Title string `json:"title" validate:"required"` Description string `json:"description" validate:"required"` PlaylistUrl string `json:"playlist_url" validate:"required"` ThumbnailUrl string `json:"thumbnail_url" validate:"required"` StartAt int64 `json:"start_at" validate:"required"` EndAt int64 `json:"end_at" validate:"required"` }
func (*Livestream) Hours ¶
func (l *Livestream) Hours() int
type LivestreamPool ¶
type LivestreamPool struct {
// contains filtered or unexported fields
}
LivestreamPool は、予約後のライブ配信プールです
func NewLivestreamPool ¶
func NewLivestreamPool(ctx context.Context) *LivestreamPool
func (*LivestreamPool) Get ¶
func (p *LivestreamPool) Get(ctx context.Context) (*Livestream, error)
func (*LivestreamPool) Put ¶
func (p *LivestreamPool) Put(ctx context.Context, livestream *Livestream)
type LivestreamStatistics ¶
type LoginRequest ¶
type ModerateRequest ¶
type ModerateRequest struct {
NGWord string `json:"ng_word"`
}
type ModerateResponse ¶
type ModerateResponse struct {
WordID int64 `json:"word_id" validate:"required"`
}
type PaymentResult ¶
type PaymentResult struct { // NOTE: 売上0を許容 TotalTip int64 `json:"total_tip"` }
type PostIconRequest ¶
type PostIconRequest struct {
Image []byte `json:"image"`
}
type PostIconResponse ¶
type PostIconResponse struct {
ID int64 `json:"id" validate:"required"`
}
type PostLivecommentRequest ¶
type PostLivecommentResponse ¶
type PostLivecommentResponse struct { ID int64 `json:"id" validate:"required"` User User `json:"user" validate:"required"` Livestream Livestream `json:"livestream" validate:"required"` Comment string `json:"comment" validate:"required"` Tip int64 `json:"tip"` CreatedAt int64 `json:"created_at" validate:"required"` }
type PostReactionRequest ¶
type PostReactionRequest struct {
EmojiName string `json:"emoji_name"`
}
type Reaction ¶
type Reaction struct { ID int64 `json:"id" validate:"required"` EmojiName string `json:"emoji_name" validate:"required"` User User `json:"user" validate:"required"` Livestream Livestream `json:"livestream" validate:"required"` CreatedAt int64 `json:"created_at" validate:"required"` }
type RegisterRequest ¶
type SearchTagParam ¶
type SearchTagParam struct {
Tag string
}
type TagsResponse ¶
type TagsResponse struct {
Tags []*Tag `json:"tags" validate:"required,dive,required"`
}
type User ¶
type User struct { ID int64 `json:"id" validate:"required"` Name string `json:"name" validate:"required"` DisplayName string `json:"display_name" validate:"required"` Description string `json:"description" validate:"required"` // NOTE: themeはboolのフィールドにアクセスすることしかないので、validate対象外 Theme Theme `json:"theme"` IconHash string `json:"icon_hash" validate:"required"` }
type UserStatistics ¶
type UserStatistics struct { Rank int64 `json:"rank" validate:"required"` ViewersCount int64 `json:"viewers_count"` TotalReactions int64 `json:"total_reactions"` TotalLivecomments int64 `json:"total_livecomments"` TotalTip int64 `json:"total_tip"` // NOTE: リアクション投稿がない場合、空文字になるのでvalidate対象外 FavoriteEmoji string `json:"favorite_emoji"` }
Click to show internal directories.
Click to hide internal directories.