lbfx

package
v0.0.0-...-8a99b67 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LeaderboardClientModule = fx.Provide(
	func(
		setting LeaderboardSettingParams,
		sSetting sfx.SecuritySettingsParams,
	) (out LeaderboardClientResult, err error) {
		if cli, e := CreateLeaderboardClient(setting.Url, sSetting); e != nil {
			err = e
		} else {
			out.Client = cli
		}
		return
	},
)
View Source
var LeaderboardClientPrivateModule = fx.Provide(
	func(
		setting LeaderboardSettingParams,
		sSetting sfx.SecuritySettingsParams,
	) (out LeaderboardClientPrivateResult, err error) {
		if cli, e := CreateLeaderboardPrivateClient(setting.Url, sSetting); e != nil {
			err = e
		} else {
			out.Client = cli
		}
		return
	},
)
View Source
var LeaderboardSettingModule = fx.Provide(
	func() (out LeaderboardSettingResult, err error) {
		err = out.LoadFromEnv()
		return
	})

Functions

Types

type LeaderboardClientParams

type LeaderboardClientParams struct {
	fx.In

	Client leaderboard.LeaderboardServiceClient `name:"LeaderboardClient"`
}

type LeaderboardClientPrivateParams

type LeaderboardClientPrivateParams struct {
	fx.In

	Client leaderboard.LeaderboardPrivateServiceClient `name:"LeaderboardClientPrivate"`
}

type LeaderboardClientPrivateResult

type LeaderboardClientPrivateResult struct {
	fx.Out

	Client leaderboard.LeaderboardPrivateServiceClient `name:"LeaderboardClientPrivate"`
}

type LeaderboardClientResult

type LeaderboardClientResult struct {
	fx.Out

	Client leaderboard.LeaderboardServiceClient `name:"LeaderboardClient"`
}

type LeaderboardSettingParams

type LeaderboardSettingParams struct {
	fx.In
	Url string `name:"leaderboardUrl"`
	// leaderboard expired time in days
	Expire int64 `name:"leaderboardExpire"`
	// leaderboard max number
	MaxNum int32 `name:"leaderboardMaxNum"`
	// can star the leaderboard rank
	StarRank int32 `name:"leaderboardStarRank"`
}

type LeaderboardSettingResult

type LeaderboardSettingResult struct {
	fx.Out

	Url string `name:"leaderboardUrl" envconfig:"LEADERBOARD_URL" default:"localhost:8081"`
	// Expire is the expired time of the leaderboard in days
	Expire int64 `name:"leaderboardExpire" envconfig:"LEADERBOARD_EXPIRE" default:"30"`
	// MaxNum is the max number of the leaderboard
	MaxNum int32 `name:"leaderboardMaxNum" envconfig:"LEADERBOARD_MAX_NUM" default:"5000"`
	// StarRank is the rank that can be starred
	StarRank int32 `name:"leaderboardStarRank" envconfig:"LEADERBOARD_STAR_RANK" default:"3"`
}

func (*LeaderboardSettingResult) LoadFromEnv

func (g *LeaderboardSettingResult) LoadFromEnv() (err error)

Jump to

Keyboard shortcuts

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