GSE5Mlib

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

! Copyright © 2022 chouette.21.00@gmail.com Released under the MIT license https://opensource.org/licenses/mit-license.php

Index

Constants

View Source
const Version = "0102F4"

Variables

View Source
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"},
}
View Source
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

View Source
var WebServer string

Functions

func GetEventInf

func GetEventInf(
	eventid string,
	eventinfo *Event_Inf,
) (
	status int,
)

func GetEventInfAndRoomList

func GetEventInfAndRoomList(
	eventid string,
	ieventid int,
	breg int,
	ereg int,
	eventinfo *Event_Inf,
	roominfolist *RoomInfoList,
) (
	isquest bool,
	status int,
)

func GetEventListByAPI

func GetEventListByAPI(eventinflist *[]Event_Inf) (status int)

func GetIsOnliveByAPI

func GetIsOnliveByAPI(room_id string) (
	isonlive bool,
	startedat time.Time,
	status int,
)

func GetNextliveByAPI

func GetNextliveByAPI(room_id string) (
	nextlive string,
	status int,
)

func GetPointsByAPI

func GetPointsByAPI(id string) (Point, Rank, Gap int, EventID string)

idで指定した配信者さんの獲得ポイントを取得する。 戻り値は 獲得ポイント、順位、上位とのポイント差(1位の場合は2位とのポイント差)、イベント名 レベルイベントのときは順位、上位とのポイント差は0がセットされる。

func GetRoomInfoByAPI

func GetRoomInfoByAPI(room_id string) (
	genre string,
	rank string,
	nrank string,
	prank string,
	level int,
	followers int,
	roomname string,
	roomurlkey string,
	startedat time.Time,
	status int,
)

func GetSerialFromYymmddHhmmss

func GetSerialFromYymmddHhmmss(yymmdd, hhmmss string) (tserial float64)

func GetUserInf

func GetUserInf(r *http.Request)

ファンクション名とリモートアドレス、ユーザーエージェントを表示する。

func GetUserInfForHistory

func GetUserInfForHistory() (status int)

func InsertEventInf

func InsertEventInf(eventinf *Event_Inf) (
	status int,
)

func InsertIntoEventUser

func InsertIntoEventUser(i int, eventid string, roominf RoomInfo) (status int)

func InsertIntoOrUpdateUser

func InsertIntoOrUpdateUser(tnow time.Time, eventid string, roominf RoomInfo) (status int)

func InsertRoomInf

func InsertRoomInf(eventid string, roominfolist *RoomInfoList)

func OpenDb

func OpenDb() (status int)

func SelectEventInfAndRoomList

func SelectEventInfAndRoomList() (IDlist []int, status int)

func SelectEventNoAndName

func SelectEventNoAndName(eventid string) (
	eventname string,
	period string,
	status int,
)

func SelectPointList

func SelectPointList(userno int, eventid string) (norow int, tp *[]time.Time, pp *[]int)

func SelectUserColor

func SelectUserColor(userno int, eventid string) (
	color string,
	colorvalue string,
	status int,
)

func SelectUserName

func SelectUserName(userno int) (
	longname string,
	shortname string,
	rank string,
	nrank string,
	level int,
	followers int,
	status int,
)

func UpdateEventInf

func UpdateEventInf(eventinf *Event_Inf) (
	status int,
)

func UpdateEventuserSetPoint

func UpdateEventuserSetPoint(eventid, userid string, point int) (status int)

func UpdatePointsSetQstatus

func UpdatePointsSetQstatus(
	eventid string,
	userno int,
	tstart string,
	tend string,
	point string,
) (status int)

func UpdateRoomInf

func UpdateRoomInf(eventid, suserno, longname, shortname, istarget, graph, color, iscntrbpoint string) (status int)

Types

type Color

type Color struct {
	Name  string
	Value string
}

type ColorInf

type ColorInf struct {
	Color      string
	Colorvalue string
	Selected   string
}

type ColorInfList

type ColorInfList []ColorInf

type CurrentScore

type CurrentScore struct {
	Rank      int
	Srank     string
	Userno    int
	Shorturl  string
	Eventid   string
	Username  string
	Roomrank  string
	Roomnrank string
	Roomlevel string
	Followers string
	NextLive  string
	Point     int
	Spoint    string
	Sdfr      string
	Pstatus   string
	Ptime     string
	Qstatus   string
	Qtime     string
}

type DBConfig

type DBConfig struct {
	WebServer string `yaml:"WebServer"`
	HTTPport  string `yaml:"HTTPport"`
	SSLcrt    string `yaml:"SSLcrt"`
	SSLkey    string `yaml:"SSLkey"`
	Dbhost    string `yaml:"Dbhost"`
	Dbname    string `yaml:"Dbname"`
	Dbuser    string `yaml:"Dbuser"`
	Dbpw      string `yaml:"Dbpw"`
	TimeLimit int    `yaml:"TimeLimit"`
}
var Dbconfig *DBConfig

func LoadConfig

func LoadConfig(filePath string) (dbconfig *DBConfig, err error)

設定ファイルを読み込む

以下の記事を参考にさせていただきました。
        【Go初学】設定ファイル、環境変数から設定情報を取得する
                https://note.com/artefactnote/n/n8c22d1ac4b86

type Event

type Event struct {
	EventID   string
	EventName string
	Selected  string
}

func SelectEventList

func SelectEventList(userno int) (eventlist []Event, status int)

type Event_Inf

type Event_Inf struct {
	Event_ID    string
	Event_name  string
	Event_no    int
	MaxPoint    int
	Start_time  time.Time
	Sstart_time string
	Start_date  float64
	End_time    time.Time
	Send_time   string
	Period      string
	Dperiod     float64
	Intervalmin int
	Modmin      int
	Modsec      int
	Fromorder   int
	Toorder     int
	Resethh     int
	Resetmm     int
	Nobasis     int
	Maxdsp      int
	NoEntry     int
	NoRoom      int    //	ルーム数
	EventStatus string //	"Over", "BeingHeld", "NotHeldYet"
	Pntbasis    int
	Ordbasis    int
	League_ids  string
	Cmap        int
	Target      int
	Maxpoint    int
}
var Event_inf Event_Inf

func SelectEventInf

func SelectEventInf(eventid string) (eventinf Event_Inf, status int)

type LongName

type LongName struct {
	Name string
}

type Point

type Point struct {
	Pnt  int
	Spnt string
	Tpnt string
}

type PointPerDay

type PointPerDay struct {
	Eventid         string
	Eventname       string
	Period          string
	Usernolist      []int
	Longnamelist    []LongName
	Pointrecordlist []PointRecord
}

type PointRecord

type PointRecord struct {
	Day       string
	Tday      time.Time
	Pointlist []Point
}

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
	Nrank      string
	Prank      string
	Followers  int
	Sfollowers string
	Level      int
	Slevel     string
	//	APIで取得できるデータ(2)
	Point        int //	イベント終了直後はイベントページから取得できることもある
	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

type RoomLevel

type RoomLevel struct {
	User_name string
	Genre     string
	Rank      string
	Nrank     string
	Prank     string
	Level     int
	Followers int

	Sts string
	// contains filtered or unexported fields
}

type RoomLevelInf

type RoomLevelInf struct {
	Userno        int
	User_name     string
	RoomLevelList []RoomLevel
}

func SelectRoomLevel

func SelectRoomLevel(userno int, levelonly int) (roomlevelinf RoomLevelInf, status int)

type User

type User struct {
	Userno       int
	Userlongname string
	Selected     string
}

func SelectEventuserList

func SelectEventuserList(eventid string) (userlist []User, status int)

func SelectUserList

func SelectUserList() (userlist []User, status int)

Jump to

Keyboard shortcuts

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