score

package
v0.0.0-...-30aa3f0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Score

type Score struct {
	ID         string `spanner:"Id"` // 0 ~ 10億
	ClassRank  int64  // 6:10億以上,5:1億以上,4:1000万以上,3:100万以上,2:10万以上,1:10000以上,0:10000未満
	CircleID   string `spanner:"CircleId"` // 所属しているサークル,100000種類ぐらい
	Score      int64
	Shard      int64 // 0 ~ 9
	MaxScore   int64 // 過去最高スコア
	CommitedAt time.Time
}

type ScoreStore

type ScoreStore struct {
	// contains filtered or unexported fields
}

ScoreStore is 固定行数で更新をひたすら行うTable

func NewScoreStore

func NewScoreStore(ctx context.Context, sc *spanner.Client) (*ScoreStore, error)

func (*ScoreStore) CircleID

func (s *ScoreStore) CircleID(id int64) string

func (*ScoreStore) Get

func (s *ScoreStore) Get(ctx context.Context, id string) (*Score, error)

func (*ScoreStore) InsertBatch

func (s *ScoreStore) InsertBatch(ctx context.Context, ids []string) error

InsertBatch is 最初に一気にデータを作るためのもの

func (*ScoreStore) Upsert

func (s *ScoreStore) Upsert(ctx context.Context, e *Score) error

Upsert is Scoreを更新する

type ScoreUser

type ScoreUser struct {
	ID         string `spanner:"Id"`
	CommitedAt time.Time
}

type ScoreUserStore

type ScoreUserStore struct {
	// contains filtered or unexported fields
}

func NewScoreUserStore

func NewScoreUserStore(ctx context.Context, sc *spanner.Client) (*ScoreUserStore, error)

func (*ScoreUserStore) ID

func (s *ScoreUserStore) ID(ctx context.Context, id int64) string

func (*ScoreUserStore) InsertBatch

func (s *ScoreUserStore) InsertBatch(ctx context.Context, ids []string) error

Jump to

Keyboard shortcuts

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