Documentation ¶
Index ¶
- Variables
- func GetLivestreamLength() int
- func GetReaction() string
- func GetStreamIDsByTagID(id int64) []int64
- func GetTagIDsByStreamID(id int64) []int64
- func GetTagPoolLength() int
- func GetTagsMap() map[int64]string
- type CommitState
- type IconScheduler
- type Image
- type InitialLivecomment
- type InitialNgWord
- type InitialReaction
- type Interval
- type IntervalTemperatures
- type Intervals
- type Livecomment
- type Livestream
- type LivestreamStats
- type LivestreamStatsRanking
- type NegativeComment
- type NgWord
- type PositiveComment
- type Reservation
- type ReservationScheduler
- func (r *ReservationScheduler) AbortReservation(reservation *Reservation)
- func (r *ReservationScheduler) CommitReservation(reservation *Reservation)
- func (r *ReservationScheduler) GetColdLongReservation() (*Reservation, error)
- func (r *ReservationScheduler) GetColdShortReservation() (*Reservation, error)
- func (r *ReservationScheduler) GetHotLongReservation() (*Reservation, error)
- func (r *ReservationScheduler) GetHotShortReservation() (*Reservation, error)
- func (r *ReservationScheduler) RangeReserved(fn func(*Reservation))
- type StatsScheduler
- func (s *StatsScheduler) AddLivecomment(streamerName string, livestreamID int64, tip *Tip) error
- func (s *StatsScheduler) AddLivestream(livestreamID int64)
- func (s *StatsScheduler) AddReaction(streamerName string, livestreamID int64, reaction string) error
- func (s *StatsScheduler) AddReport(streamerName string, livestreamID int64) error
- func (s *StatsScheduler) EnterLivestream(streamerName string, livestreamID int64) error
- func (s *StatsScheduler) ExitLivestream(streamerName string, livestreamID int64) error
- func (s *StatsScheduler) GetLivestreamRank(livestreamID int64) (int64, error)
- func (s *StatsScheduler) GetLivestreamStats(livestreamID int64) (*LivestreamStats, error)
- func (s *StatsScheduler) GetUserRank(username string) (int64, error)
- func (s *StatsScheduler) GetUserStats(username string) (*UserStats, error)
- type Tip
- type User
- type UserStats
- type UserStatsRanking
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoReservation = errors.New("条件を満たす予約がみつかりませんでした")
View Source
var IconSched = mustNewIconScheduler()
View Source
var LivecommentScheduler = mustNewLivecommentScheduler()
View Source
var (
ReservationSched = mustNewReservationScheduler(config.BaseAt, config.NumSlots, config.NumHours+10)
)
View Source
var StatsSched = NewStatsScheduler()
View Source
var UserScheduler = mustNewUserScheduler()
Functions ¶
func GetLivestreamLength ¶
func GetLivestreamLength() int
func GetReaction ¶
func GetReaction() string
func GetStreamIDsByTagID ¶
func GetTagIDsByStreamID ¶
func GetTagPoolLength ¶
func GetTagPoolLength() int
func GetTagsMap ¶
Types ¶
type CommitState ¶
type CommitState int
割当のコミット状態を管理
const ( CommitState_None CommitState = iota CommitState_Inflight CommitState_Committed )
type IconScheduler ¶
type IconScheduler struct {
// contains filtered or unexported fields
}
func (*IconScheduler) GetRandomIcon ¶
func (s *IconScheduler) GetRandomIcon() *Image
type InitialLivecomment ¶
type InitialNgWord ¶
type InitialReaction ¶
type IntervalTemperatures ¶
type IntervalTemperatures struct {
// contains filtered or unexported fields
}
IntervalTemperatures は、区間の温度を管理します
type Livestream ¶
type Livestream struct { OwnerID int64 `json:"owner"` Title string `json:"title"` Description string `json:"description"` PlaylistUrl string `json:"playlist_url"` ThumbnailUrl string `json:"thumbnail_url"` StartAt int64 `json:"start_at"` EndAt int64 `json:"end_at"` }
func GetLivestreamByID ¶
func GetLivestreamByID(id int64) *Livestream
type LivestreamStats ¶
type LivestreamStats struct { LivestreamID int64 // 視聴者数 (初期では0) TotalViewers int64 // トータルレポート数 (初期では0) TotalReports int64 // トータルリアクション数 TotalReactions int64 // 最大チップ金額 (ライブコメント) TotalTips int64 MaxTip int64 }
func NewLivestreamStats ¶
func NewLivestreamStats(livestreamID int64) *LivestreamStats
func (*LivestreamStats) Score ¶
func (s *LivestreamStats) Score() int64
type LivestreamStatsRanking ¶
type LivestreamStatsRanking []*LivestreamStats
func (LivestreamStatsRanking) Len ¶
func (r LivestreamStatsRanking) Len() int
func (LivestreamStatsRanking) Less ¶
func (r LivestreamStatsRanking) Less(i, j int) bool
func (LivestreamStatsRanking) Swap ¶
func (r LivestreamStatsRanking) Swap(i, j int)
type NegativeComment ¶
type PositiveComment ¶
type PositiveComment struct {
Comment string
}
type Reservation ¶
type Reservation struct { Title string Description string StartAt int64 EndAt int64 PlaylistUrl string ThumbnailUrl string // contains filtered or unexported fields }
func ConvertFromIntInterface ¶
func ConvertFromIntInterface(i []interval.IntInterface) ([]*Reservation, error)
func (*Reservation) Hours ¶
func (r *Reservation) Hours() int
func (*Reservation) ID ¶
func (r *Reservation) ID() uintptr
func (*Reservation) Range ¶
func (r *Reservation) Range() interval.IntRange
type ReservationScheduler ¶
type ReservationScheduler struct {
// contains filtered or unexported fields
}
func (*ReservationScheduler) AbortReservation ¶
func (r *ReservationScheduler) AbortReservation(reservation *Reservation)
func (*ReservationScheduler) CommitReservation ¶
func (r *ReservationScheduler) CommitReservation(reservation *Reservation)
CommitReservation は、予約追加リクエストが通ったことをintervalTemperturesに記録します
func (*ReservationScheduler) GetColdLongReservation ¶
func (r *ReservationScheduler) GetColdLongReservation() (*Reservation, error)
func (*ReservationScheduler) GetColdShortReservation ¶
func (r *ReservationScheduler) GetColdShortReservation() (*Reservation, error)
func (*ReservationScheduler) GetHotLongReservation ¶
func (r *ReservationScheduler) GetHotLongReservation() (*Reservation, error)
func (*ReservationScheduler) GetHotShortReservation ¶
func (r *ReservationScheduler) GetHotShortReservation() (*Reservation, error)
func (*ReservationScheduler) RangeReserved ¶
func (r *ReservationScheduler) RangeReserved(fn func(*Reservation))
予約の突合処理に使う
type StatsScheduler ¶
type StatsScheduler struct {
// contains filtered or unexported fields
}
func NewStatsScheduler ¶
func NewStatsScheduler() *StatsScheduler
func (*StatsScheduler) AddLivecomment ¶
func (s *StatsScheduler) AddLivecomment(streamerName string, livestreamID int64, tip *Tip) error
func (*StatsScheduler) AddLivestream ¶
func (s *StatsScheduler) AddLivestream(livestreamID int64)
func (*StatsScheduler) AddReaction ¶
func (s *StatsScheduler) AddReaction(streamerName string, livestreamID int64, reaction string) error
func (*StatsScheduler) AddReport ¶
func (s *StatsScheduler) AddReport(streamerName string, livestreamID int64) error
スパム報告追加 (ユーザの配信に対して)
func (*StatsScheduler) EnterLivestream ¶
func (s *StatsScheduler) EnterLivestream(streamerName string, livestreamID int64) error
視聴開始/終了 ユーザ単位の視聴者数、ライブ配信単位の視聴者数を更新する必要がある
func (*StatsScheduler) ExitLivestream ¶
func (s *StatsScheduler) ExitLivestream(streamerName string, livestreamID int64) error
func (*StatsScheduler) GetLivestreamRank ¶
func (s *StatsScheduler) GetLivestreamRank(livestreamID int64) (int64, error)
func (*StatsScheduler) GetLivestreamStats ¶
func (s *StatsScheduler) GetLivestreamStats(livestreamID int64) (*LivestreamStats, error)
func (*StatsScheduler) GetUserRank ¶
func (s *StatsScheduler) GetUserRank(username string) (int64, error)
func (*StatsScheduler) GetUserStats ¶
func (s *StatsScheduler) GetUserStats(username string) (*UserStats, error)
type User ¶
type User struct { Name string DisplayName string Description string RawPassword string HashedPassword string DarkMode bool }
func GetInitialUserByID ¶
type UserStats ¶
type UserStats struct { Username string // 視聴者数 TotalViewers int64 // トータルライブコメント数 TotalLivecomments int64 // チップ合計金額 TotalTips int64 // contains filtered or unexported fields }
func NewUserStats ¶
func (*UserStats) FavoriteEmoji ¶
func (*UserStats) TotalReactions ¶
type UserStatsRanking ¶
type UserStatsRanking []*UserStats
func (UserStatsRanking) Len ¶
func (r UserStatsRanking) Len() int
func (UserStatsRanking) Less ¶
func (r UserStatsRanking) Less(i, j int) bool
func (UserStatsRanking) Swap ¶
func (r UserStatsRanking) Swap(i, j int)
Source Files ¶
- commit_state.go
- icon_scheduler.go
- initial.go
- initial_livecomment_pool.go
- initial_ngword_pool.go
- initial_reaction_pool.go
- interval_temperature.go
- livecomment_pool.go
- livecomment_scheduler.go
- livestream_tags_pool.go
- livestreams_pool.go
- reaction_pool.go
- reservation.go
- reservation_pool.go
- reservation_scheduler.go
- stats_scheduler.go
- tag_pool.go
- user_pool.go
- user_scheduler.go
Click to show internal directories.
Click to hide internal directories.