Documentation ¶
Overview ¶
Copyright © 2024 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Copyright © 2024 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Copyright © 2024 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
! Copyright © 2023 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
! Copyright © 2024 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Copyright © 2024 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
! Copyright © 2024 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Copyright © 2024 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Copyright © 2024 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
! Copyright © 2023 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php
Index ¶
- Constants
- Variables
- func ConverGenre2Abbr(genre string) (abbr string)
- func GetEventsRankingByApi(client *http.Client, eid string, mode int) (pranking *srapi.Eventranking, err error)
- func InserIntoGiftScore(client *http.Client, dbmap *gorp.DbMap, giftid int, cgr *srapi.GrRanking, ...) (err error)
- func InserIntoGiftScoreCntrb(client *http.Client, dbmap *gorp.DbMap, giftid int, userno int, ...) (err error)
- func InserIntoViewerGiftScore(client *http.Client, dbmap *gorp.DbMap, giftid int, cugr *srapi.UgrRanking, ...) (err error)
- func InsertEventinflistToEvent(tevent string, eventinflist *[]exsrapi.Event_Inf, bcheck bool) (err error)
- func InsertIntoOrUpdateUser(tnow time.Time, eventid string, roominf RoomInfo) (status int)
- func InsertIntoUser(client *http.Client, tnow time.Time, userno int) (err error)
- func InsertIntoWuser(client *http.Client, tnow time.Time, userno int) (err error)
- func InsertNewOnes(client *http.Client, order int, eventinf exsrapi.Event_Inf, room srapi.Room) (err error)
- func MakeSortKeyOfRank(rank string, nextscore int) (irank int)
- func SelectCurEventList() (eventlist []exsrapi.Event_Inf, err error)
- func SelectEventNoAndName(tevent, eventid string) (eventname string, period string, status int)
- func SelectEventRoomInfList(tevent string, eventid string, roominfolist *RoomInfoList) (eventname string, status int)
- func SelectEventinflistFromEvent(cond int, keyword string, offset int, limit int) (eventinflist []exsrapi.Event_Inf, err error)
- func SelectFromEvent(tevent string, eventid string) (peventinf *exsrapi.Event_Inf, err error)
- func SelectPointList(userno int, eventid string) (norow int, tp *[]time.Time, pp *[]int)
- func UpdatePointsSetQstatus(eventid string, userno int, tstart string, tend string, point string) (status int)
- func UpdateUserSetProperty(client *http.Client, tnow time.Time, user *User) (err error)
- func UpdateWuserSetProperty(client *http.Client, tnow time.Time, wuser *Wuser) (err error)
- func UpinsUserSetProperty(client *http.Client, tnow time.Time, user *User, lmin int, wait int) (err error)
- func UpinsViewerSetProperty(client *http.Client, tnow time.Time, viewer *Viewer, lmin int) (err error)
- func UpinsWuserSetProperty(client *http.Client, tnow time.Time, wuser *Wuser, lmin int, wait int) (err error)
- type Campaign
- type Color
- type ColorInf
- type ColorInfList
- type DBConfig
- type Environment
- type Event
- type Eventuser
- type GiftRanking
- type GiftScore
- type GiftScoreCntrb
- type PerSlot
- type PerSlotInf
- type Points
- type RoomInfo
- type RoomInfoList
- type Timetable
- type User
- type Userhistory
- type Viewer
- type ViewerGiftScore
- type ViewerHistory
- type Wuser
Constants ¶
const Version = "01AP03"
Variables ¶
var Colorlist1 []Color = []Color{
{"cyan", "cyan"},
{"magenta", "magenta"},
{"yellow", "yellow"},
{"royalblue", "royalblue"},
{"coral", "coral"},
{"khaki", "khaki"},
{"deepskyblue", "deepskyblue"},
{"crimson", "crimson"},
{"orange", "orange"},
{"lightsteelblue", "lightsteelblue"},
{"pink", "pink"},
{"sienna", "sienna"},
{"springgreen", "springgreen"},
{"blueviolet", "blueviolet"},
{"salmon", "salmon"},
{"lime", "lime"},
{"red", "red"},
{"darkorange", "darkorange"},
{"skyblue", "skyblue"},
{"lightpink", "lightpink"},
}
var Colorlist2 []Color = []Color{
{"red", "#FF2800"},
{"yellow", "#FAF500"},
{"green", "#35A16B"},
{"blue", "#0041FF"},
{"skyblue", "#66CCFF"},
{"lightpink", "#FFD1D1"},
{"orange", "#FF9900"},
{"purple", "#9A0079"},
{"brown", "#663300"},
{"lightgreen", "#87D7B0"},
{"white", "#FFFFFF"},
{"gray", "#77878F"},
}
https://www.fukushihoken.metro.tokyo.lg.jp/kiban/machizukuri/kanren/color.files/colorudguideline.pdf
var Db *sql.DB // プログラム中では一貫してこの変数を使うこと
var Dberr error // プログラム中では一貫してこの変数を使うこと
var Dbmap *gorp.DbMap
var Dialer sshql.Dialer
var Event_inf exsrapi.Event_Inf
var SortByFollowers bool
Functions ¶
func GetEventsRankingByApi ¶ added in v1.3.0
func InserIntoGiftScore ¶ added in v1.3.0
func InserIntoGiftScore( client *http.Client, dbmap *gorp.DbMap, giftid int, cgr *srapi.GrRanking, tnow time.Time, ) ( err error, )
ギフトランキングデータを格納する 必要に応じて配信者(user)の情報を新たに作る、あるいは更新する。
func InserIntoGiftScoreCntrb ¶ added in v1.4.0
func InserIntoGiftScoreCntrb( client *http.Client, dbmap *gorp.DbMap, giftid int, userno int, grc *srapi.GrcRanking, tnow time.Time, ) ( err error, )
ギフトランキング・リスナー貢献ランキングデータを格納する 必要に応じてリスナー(viewer)の情報を新たに作る、あるいは更新する。
func InserIntoViewerGiftScore ¶ added in v1.3.0
func InserIntoViewerGiftScore( client *http.Client, dbmap *gorp.DbMap, giftid int, cugr *srapi.UgrRanking, tnow time.Time, ) ( err error, )
リスナーギフトランキングデータを格納する 必要に応じてリスナー(viewer)の情報を新たに作る、あるいは更新する。
func InsertEventinflistToEvent ¶
func InsertEventinflistToEvent( tevent string, eventinflist *[]exsrapi.Event_Inf, bcheck bool, ) ( err error, )
イベント情報リストをイベントテーブルに格納する。 格納できたときは (*eventinflist)[i].Valid = false とする。 格納できないときは (*eventinflist)[i].Valid = true とする。 (*eventinflist)[i].Valid はイベント情報とは無関係で 処理の状況を示すために使われる。
func InsertIntoOrUpdateUser ¶ added in v1.1.0
func InsertIntoUser ¶ added in v1.2.0
テーブル user に新しいデータを追加する
func InsertIntoWuser ¶ added in v1.3.0
テーブル user に新しいデータを追加する
func InsertNewOnes ¶ added in v1.1.0
func MakeSortKeyOfRank ¶ added in v1.2.0
Rank情報からランクのソートキーを作る
func SelectCurEventList ¶ added in v1.1.0
DBから現在開催中のイベントを抜き出す
func SelectEventNoAndName ¶
func SelectEventRoomInfList ¶
func SelectEventRoomInfList( tevent string, eventid string, roominfolist *RoomInfoList, ) ( eventname string, status int, )
func SelectEventinflistFromEvent ¶ added in v1.1.0
func SelectEventinflistFromEvent( cond int, keyword string, offset int, limit int, ) ( eventinflist []exsrapi.Event_Inf, err error, )
指定した条件に該当するイベントのリストを作る。
func SelectFromEvent ¶
func SelectPointList ¶
func UpdatePointsSetQstatus ¶
func UpdateUserSetProperty ¶ added in v1.2.0
テーブル user を SHOWROOMのAPI api/roomprofile を使って得られる情報で更新する。
func UpdateWuserSetProperty ¶ added in v1.3.0
テーブル user を SHOWROOMのAPI api/roomprofile を使って得られる情報で更新する。
func UpinsUserSetProperty ¶ added in v1.2.0
func UpinsUserSetProperty(client *http.Client, tnow time.Time, user *User, lmin int, wait int) ( err error, )
ルーム番号 user.Userno が テーブル user に存在しないときは新しいデータを挿入し、存在するときは 既存のデータを更新する。
Types ¶
type ColorInfList ¶
type ColorInfList []ColorInf
type DBConfig ¶
type DBConfig struct { UseSSH bool `yaml:"UseSSH"` DBhost string `yaml:"DBhost"` DBport string `yaml:"DBport"` DBname string `yaml:"DBname"` DBuser string `yaml:"DBuser"` DBpswd string `yaml:"DBpswd"` SRacct string `yaml:"SRacct"` SRpswd string `yaml:"SRpswd"` SSHhost string `yaml:"SSHhost"` SSHport int `yaml:"SSHport"` SSHuser string `yaml:"SSHuser"` SSHpswd string `yaml:"SSHpswd"` SSHprvkey string `yaml:"SSHprvkey"` }
type Environment ¶ added in v1.3.0
type Environment struct { // Intervalhour int `yaml:"Intervalhour"` Lmin int `yaml:"Lmin"` Waitmsec int `yaml:"Waitmsec"` }
var Env Environment = Environment{
Lmin: 14400,
Waitmsec: 100,
}
type Event ¶ added in v1.3.0
type Event struct { Eventid string Ieventid int Event_name string Period string Starttime time.Time Endtime time.Time Noentry int Intervalmin int Modmin int Modsec int Fromorder int Toorder int Resethh int Resetmm int Nobasis int Maxdsp int Cmap int Target int Rstatus string Maxpoint int Achk int Aclr int }
イベント構造体 PRIMARY KEY (eventid)
type Eventuser ¶ added in v1.3.0
type Eventuser struct { Eventid string Userno int Istarget string Iscntrbpoints string Graph string Color string Point int Vld int }
イベントに参加しているユーザの構造体 PRIMARY KEY (`eventid`,`userno`)
type GiftRanking ¶ added in v1.3.3
type GiftScoreCntrb ¶ added in v1.4.0
type GiftScoreCntrb struct { Giftid int Userno int Viewerid int Orderno int Score int Ts time.Time }
ギフト貢献ランキング
type PerSlotInf ¶
type PerSlotInf struct { Eventname string Eventid string Period string Roomname string Roomid int Perslotlist []PerSlot }
func MakePointPerSlot ¶
func MakePointPerSlot(tevent, eventid string) (perslotinflist []PerSlotInf, status int)
type RoomInfo ¶
type RoomInfo struct { Name string // ルーム名のリスト Longname string Shortname string Account string // アカウントのリスト、アカウントは配信のURLの最後の部分の英数字です。 ID string // IDのリスト、IDはプロフィールのURLの最後の部分で5~6桁の数字です。 Userno int // APIで取得できるデータ(1) Genre string Rank string Irank int Nrank string Prank string Followers int Sfollowers string Fans int Fans_lst int Level int Slevel string // APIで取得できるデータ(2) Order int Point int // イベント終了後12時間〜36時間はイベントページから取得できることもある Spoint string Istarget string Graph string Iscntrbpoint string Color string Colorvalue string Colorinflist ColorInfList Formid string Eventid string Status string Statuscolor string }
type RoomInfoList ¶
type RoomInfoList []RoomInfo
func (RoomInfoList) Choose ¶
func (r RoomInfoList) Choose(from, to int) (s RoomInfoList)
func (RoomInfoList) Swap ¶
func (r RoomInfoList) Swap(i, j int)
type Timetable ¶ added in v1.3.0
type Timetable struct { Eventid string Userid int Sampletm1 time.Time Sampletm2 time.Time Stime time.Time Etime time.Time Target int Totalpoint int Earnedpoint int Status int }
配信枠の構造体(配信枠別リスナー別貢献ポイント用)
PRIMARY KEY (eventid,userid,sampletm1)
type User ¶ added in v1.2.0
type User struct { Userno int Userid string User_name string Longname string Shortname string Genre string GenreID int Rank string Nrank string Prank string Irank int Inrank int Iprank int Itrank int Level int Followers int Fans int FanPower int Fans_lst int FanPower_lst int Ts time.Time Getp string Graph string Color string Currentevent string }
type Userhistory ¶ added in v1.3.0
type Userhistory struct { Userno int User_name string Genre string Rank string Nrank string Prank string Level int Followers int Fans int Fans_lst int Ts time.Time }
userの履歴を保存する構造体 PRIMARY KEY (`userno`,`ts`)
type ViewerGiftScore ¶ added in v1.3.0
type ViewerGiftScore struct { Giftid int Viewerid int Orderno int Score int Status string Ts time.Time }
ユーザーギフトランキング(userは配信者の意味で使用しているのでviewerとしてある)