Documentation ¶
Index ¶
- Variables
- func CreateCompetition(tenant *isuports.TenantRow) *isuports.CompetitionRow
- func CreateCompetitions(tenant *isuports.TenantRow) []*isuports.CompetitionRow
- func CreateFixedPlayer(tenant *isuports.TenantRow) *isuports.PlayerRow
- func CreatePlayer(tenant *isuports.TenantRow) *isuports.PlayerRow
- func CreatePlayerData(tenant *isuports.TenantRow, players []*isuports.PlayerRow, ...) ([]*isuports.PlayerScoreRow, []*isuports.VisitHistoryRow, int64, ...)
- func CreatePlayers(tenant *isuports.TenantRow) []*isuports.PlayerRow
- func CreateScore() int64
- func CreateTenant(tag TenantTag) *isuports.TenantRow
- func FakeCompetitionName() string
- func FakeTenantName() string
- func RandomString(n int) string
- func Run(tenantsNum int) error
- func UniqueRandomString(n int) string
- type BenchmarkerCompeittion
- type BenchmarkerSource
- type BenchmarkerTenantSource
- type TenantTag
Constants ¶
This section is empty.
Variables ¶
View Source
var DatabaseDSN string // MySQLのDSN
View Source
var Epoch = time.Date(2022, 05, 01, 0, 0, 0, 0, time.UTC) // サービス開始時点(IDの起点)
View Source
var EpochUnix = Epoch.Unix()
View Source
var GenID = func(ts int64) string {
return genID(ts)
}
View Source
var GenTenantID = func() int64 { return atomic.AddInt64(&tenantID, 1) }
テナントIDは連番で生成
View Source
var Now = func() time.Time { return defaultNow } // ベンチから使うときは上書きできるようにしておく
View Source
var NowUnix = func() int64 { return Now().Unix() }
View Source
var OutDir = "." // テナントDBの出力先ディレクトリ
Functions ¶
func CreateCompetition ¶
func CreateCompetition(tenant *isuports.TenantRow) *isuports.CompetitionRow
func CreateCompetitions ¶
func CreateCompetitions(tenant *isuports.TenantRow) []*isuports.CompetitionRow
func CreatePlayerData ¶
func CreatePlayerData( tenant *isuports.TenantRow, players []*isuports.PlayerRow, competitions []*isuports.CompetitionRow, ) ( []*isuports.PlayerScoreRow, []*isuports.VisitHistoryRow, int64, []*BenchmarkerCompeittion, []*BenchmarkerSource, )
func CreateScore ¶
func CreateScore() int64
func CreateTenant ¶
func FakeCompetitionName ¶
func FakeCompetitionName() string
func FakeTenantName ¶
func FakeTenantName() string
func RandomString ¶
func UniqueRandomString ¶
Types ¶
type BenchmarkerCompeittion ¶
type BenchmarkerSource ¶
type BenchmarkerTenantSource ¶
type BenchmarkerTenantSource struct { TenantID int64 `json:"tenant_id"` TenantName string `json:"tenant_name"` Billing int64 `json:"billing"` Competitions []*BenchmarkerCompeittion `json:"competitions"` }
Click to show internal directories.
Click to hide internal directories.