mysql

package
v0.0.0-...-33909b6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRanking

func AddRanking(ctx context.Context, id string, name string, score int) error

AddRanking は,usersテーブルにユーザデータを追加します

Types

type UserMap

type UserMap struct {
	ID        string `gorm:"primaryKey"`
	Name      string `gorm:"not null"`
	HighScore int    `gorm:"not null;index:,sort:desc"`
}

type UserResponse

type UserResponse struct {
	ID        string
	Name      string
	HighScore int
	Rank      int
}

func GetRankings

func GetRankings(ctx context.Context, limit int) ([]*UserResponse, error)

GetRankings は,上位{limit}件のユーザデータを返します

Jump to

Keyboard shortcuts

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