Documentation ¶
Index ¶
- Variables
- func IsValidUsername(username string) bool
- func NewGameStateRepository(rdb redis.RedisClient) *gameStateRepo
- func NewGameUserRepository(rdb redis.RedisClient) *userRepo
- func NewMarketRepository(rc redis.RedisClient) *marketRepo
- func NewNotifyRepository(rc redis.RedisClient) *notifyRepo
- func NewReportsRepository(rdb redis.RedisClient) *reportsRepo
- func NewWorldRepository(rc redis.RedisClient) *worldRepo
- type GameStateRepository
- type GameUser
- type GameUserRepository
- type MarketRepository
- type Mutex
- type NotifyRepository
- type ReportsRepository
- type User
- type UserRepository
- type WorldRepository
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidUsername = errors.New("username is invalid")
View Source
var ErrUserNotFound = errors.New("user not found")
View Source
var ErrUsernameTaken = errors.New("username is taken")
Functions ¶
func IsValidUsername ¶
func NewGameStateRepository ¶
func NewGameStateRepository(rdb redis.RedisClient) *gameStateRepo
func NewGameUserRepository ¶
func NewGameUserRepository(rdb redis.RedisClient) *userRepo
func NewMarketRepository ¶
func NewMarketRepository(rc redis.RedisClient) *marketRepo
func NewNotifyRepository ¶
func NewNotifyRepository(rc redis.RedisClient) *notifyRepo
func NewReportsRepository ¶
func NewReportsRepository(rdb redis.RedisClient) *reportsRepo
func NewWorldRepository ¶
func NewWorldRepository(rc redis.RedisClient) *worldRepo
Types ¶
type GameStateRepository ¶
type GameUserRepository ¶
type GameUserRepository interface { SetUserLatestActivity(ctx context.Context, userId string, value int64) error GetUserLatestActivity(ctx context.Context, userId string) (int64, error) GetAllUsers(ctx context.Context) ([]string, error) GetUserCount(ctx context.Context) (int64, error) CreateUser(ctx context.Context, userId, username string) error GetUser(ctx context.Context, userId string) (*GameUser, error) DeleteUser(ctx context.Context, userId string) error }
type MarketRepository ¶
type MarketRepository interface { GetGlobalDemandScore(ctx context.Context) (float64, error) SetUserDemandScore(ctx context.Context, userId string, demand float64) error GetDemandRankByUserId(ctx context.Context, userId string) (int64, error) GetDemandLeaderboard(ctx context.Context, skip int) (*models.DemandLeaderboard, error) }
type NotifyRepository ¶
type ReportsRepository ¶
type UserRepository ¶
type UserRepository interface { CreateUser(ctx context.Context, username string, password string) (string, error) GetAllUsers(ctx context.Context) ([]*User, error) GetUser(ctx context.Context, userId string) (*User, error) GetUserByUsername(ctx context.Context, username string) (*User, error) GetUserItems(ctx context.Context, userId string) ([]string, error) DeleteUser(ctx context.Context, userId string) error }
type WorldRepository ¶
type WorldRepository interface {
GetState(ctx context.Context) (*models.WorldState, error)
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.