Documentation ¶
Index ¶
- Constants
- Variables
- func ApiActivate(c *gin.Context)
- func ApiClubCashin(c *gin.Context)
- func ApiClubInfo(c *gin.Context)
- func ApiClubIs(c *gin.Context)
- func ApiClubList(c *gin.Context)
- func ApiClubRename(c *gin.Context)
- func ApiGameInfo(c *gin.Context)
- func ApiGameJoin(c *gin.Context)
- func ApiGameList(c *gin.Context)
- func ApiGameNew(c *gin.Context)
- func ApiGameRtpGet(c *gin.Context)
- func ApiKenoBetGet(c *gin.Context)
- func ApiKenoBetSet(c *gin.Context)
- func ApiKenoSelGet(c *gin.Context)
- func ApiKenoSelGetSlice(c *gin.Context)
- func ApiKenoSelSet(c *gin.Context)
- func ApiKenoSelSetSlice(c *gin.Context)
- func ApiKenoSpin(c *gin.Context)
- func ApiMemUsage(c *gin.Context)
- func ApiPing(c *gin.Context)
- func ApiPropsAlGet(c *gin.Context)
- func ApiPropsAlSet(c *gin.Context)
- func ApiPropsGet(c *gin.Context)
- func ApiPropsRtpGet(c *gin.Context)
- func ApiPropsRtpSet(c *gin.Context)
- func ApiPropsWalletAdd(c *gin.Context)
- func ApiPropsWalletGet(c *gin.Context)
- func ApiRefresh(c *gin.Context)
- func ApiSendCode(c *gin.Context)
- func ApiServInfo(c *gin.Context)
- func ApiSignin(c *gin.Context)
- func ApiSignis(c *gin.Context)
- func ApiSignup(c *gin.Context)
- func ApiSlotBetGet(c *gin.Context)
- func ApiSlotBetSet(c *gin.Context)
- func ApiSlotCollect(c *gin.Context)
- func ApiSlotDoubleup(c *gin.Context)
- func ApiSlotModeSet(c *gin.Context)
- func ApiSlotSelGet(c *gin.Context)
- func ApiSlotSelSet(c *gin.Context)
- func ApiSlotSpin(c *gin.Context)
- func ApiUserDelete(c *gin.Context)
- func ApiUserIs(c *gin.Context)
- func ApiUserRename(c *gin.Context)
- func ApiUserSecret(c *gin.Context)
- func Auth(required bool) gin.HandlerFunc
- func GetAdmin(c *gin.Context, cid uint64) (*User, AL)
- func GetRTP(user *User, club *Club) float64
- func Handle404(c *gin.Context)
- func Handle405(c *gin.Context)
- func InitScreen(game any)
- func MustAdmin(c *gin.Context, cid uint64) (*User, AL)
- func Negotiate(c *gin.Context, code int, data any)
- func Ret204(c *gin.Context)
- func Ret400(c *gin.Context, code int, err error)
- func Ret401(c *gin.Context, code int, err error)
- func Ret403(c *gin.Context, code int, err error)
- func Ret404(c *gin.Context, code int, err error)
- func Ret500(c *gin.Context, code int, err error)
- func RetErr(c *gin.Context, status, code int, err error)
- func RetOk(c *gin.Context, data any)
- func SafeTransaction(engine *xorm.Engine, f func(*Session) error) (err error)
- func SetupRouter(r *gin.Engine)
- type AL
- type AuthGetter
- type AuthResp
- type Banklog
- type Claims
- type Club
- func (club *Club) AddBank(bank float64)
- func (club *Club) AddCash(bank, fund, deposit float64)
- func (club *Club) AddDeposit(deposit float64)
- func (club *Club) AddFund(fund float64)
- func (club *Club) Bank() float64
- func (club *Club) CID() uint64
- func (club *Club) Deposit() float64
- func (club *Club) Fund() float64
- func (club *Club) Get() ClubData
- func (club *Club) GetCash() (bank, fund, deposit float64)
- func (club *Club) MRTP() float64
- func (club *Club) Name() string
- func (club *Club) Rate() float64
- func (club *Club) SetName(name string)
- type ClubData
- type Multlog
- type Props
- type Scene
- type Session
- type Spinlog
- type SqlBank
- func (sb *SqlBank) Access(engine *xorm.Engine, uid uint64, access AL) (err error)
- func (sb *SqlBank) Add(engine *xorm.Engine, uid, aid uint64, wallet, sum float64) (err error)
- func (sb *SqlBank) Flush(engine *xorm.Engine, d time.Duration) (err error)
- func (sb *SqlBank) Init(cid uint64, capacity, logsize int)
- func (sb *SqlBank) IsEmpty() bool
- func (sb *SqlBank) MRTP(engine *xorm.Engine, uid uint64, mrtp float64) (err error)
- func (sb *SqlBank) Put(engine *xorm.Engine, uid uint64, sum float64) (err error)
- type SqlStory
- type Story
- type UF
- type User
- func GetBasicAuth(credentials string) (user *User, code int, err error)
- func GetBearerAuth(tokenstr string) (user *User, code int, err error)
- func UserFromCookie(c *gin.Context) (*User, int, error)
- func UserFromForm(c *gin.Context) (*User, int, error)
- func UserFromHeader(c *gin.Context) (*User, int, error)
- func UserFromQuery(c *gin.Context) (*User, int, error)
- type Walletlog
Constants ¶
const ( AECnull = iota AEC_auth_absent AEC_auth_scheme AEC_basic_decode AEC_basic_nouser AEC_basic_deny AEC_token_nouser AEC_token_malform AEC_token_notsign AEC_token_badclaims AEC_token_expired AEC_token_notyet AEC_token_issuer AEC_token_error AEC_nourl AEC_nomethod AEC_signis_nobind AEC_signis_nouid AEC_signis_noemail AEC_sendcode_nobind AEC_sendcode_nouser AEC_sendcode_update AEC_sendcode_code AEC_activate_nobind AEC_activate_nouser AEC_activate_oldcode AEC_activate_badcode AEC_activate_update AEC_signup_nobind AEC_signup_smallsec AEC_signup_code AEC_signup_sql AEC_signin_nobind AEC_signin_nosecret AEC_signin_smallsec AEC_signin_nouser AEC_signin_activate AEC_signin_oldcode AEC_signin_badcode AEC_signin_denypass AEC_signin_sigtime AEC_signin_timeout AEC_signin_hs256 AEC_signin_denyhash AEC_game_new_nobind AEC_game_new_noclub AEC_game_new_nouser AEC_game_new_noaccess AEC_game_new_noalias AEC_game_new_sql AEC_game_join_nobind AEC_game_join_nouser AEC_game_join_noaccess AEC_game_join_noscene AEC_game_info_nobind AEC_game_info_noscene AEC_game_info_nouser AEC_game_info_noaccess AEC_game_info_noprops AEC_game_rtpget_nobind AEC_game_rtpget_noscene AEC_game_rtpget_noinfo AEC_game_rtpget_noclub AEC_game_rtpget_nouser AEC_game_rtpget_noaccess AEC_slot_betget_nobind AEC_slot_betget_noscene AEC_slot_betget_notslot AEC_slot_betget_noaccess AEC_slot_betset_nobind AEC_slot_betset_noscene AEC_slot_betset_notslot AEC_slot_betset_noaccess AEC_slot_betset_badbet AEC_slot_selget_nobind AEC_slot_selget_noscene AEC_slot_selget_notslot AEC_slot_selget_noaccess AEC_slot_selset_nobind AEC_slot_selset_noscene AEC_slot_selset_notslot AEC_slot_selset_noaccess AEC_slot_selset_badsel AEC_slot_modeset_nobind AEC_slot_modeset_noscene AEC_slot_modeset_notslot AEC_slot_modeset_noaccess AEC_slot_modeset_badmode AEC_slot_spin_nobind AEC_slot_spin_noscene AEC_slot_spin_notslot AEC_slot_spin_noclub AEC_slot_spin_nouser AEC_slot_spin_noaccess AEC_slot_spin_badbet AEC_slot_spin_badsel AEC_slot_spin_noprops AEC_slot_spin_nomoney AEC_slot_spin_badbank AEC_slot_spin_sqlbank AEC_slot_doubleup_nobind AEC_slot_doubleup_noscene AEC_slot_doubleup_notslot AEC_slot_doubleup_noclub AEC_slot_doubleup_nouser AEC_slot_doubleup_noaccess AEC_slot_doubleup_noprops AEC_slot_doubleup_nogain AEC_slot_doubleup_sqlbank AEC_slot_collect_nobind AEC_slot_collect_noscene AEC_slot_collect_notslot AEC_slot_collect_noaccess AEC_slot_collect_denied AEC_keno_betget_nobind AEC_keno_betget_noscene AEC_keno_betget_notslot AEC_keno_betget_noaccess AEC_keno_betset_nobind AEC_keno_betset_noscene AEC_keno_betset_notslot AEC_keno_betset_noaccess AEC_keno_betset_badbet AEC_keno_selget_nobind AEC_keno_selget_noscene AEC_keno_selget_notslot AEC_keno_selget_noaccess AEC_keno_selset_nobind AEC_keno_selset_noscene AEC_keno_selset_notslot AEC_keno_selset_noaccess AEC_keno_selset_badsel AEC_keno_selgetslice_nobind AEC_keno_selgetslice_noscene AEC_keno_selgetslice_notslot AEC_keno_selgetslice_noaccess AEC_keno_selsetslice_nobind AEC_keno_selsetslice_noscene AEC_keno_selsetslice_notslot AEC_keno_selsetslice_noaccess AEC_keno_selsetslice_badsel AEC_keno_spin_nobind AEC_keno_spin_noscene AEC_keno_spin_notslot AEC_keno_spin_noclub AEC_keno_spin_nouser AEC_keno_spin_noaccess AEC_keno_spin_noprops AEC_keno_spin_nomoney AEC_keno_spin_badbank AEC_keno_spin_sqlbank AEC_prop_get_nobind AEC_prop_get_noclub AEC_prop_get_nouser AEC_prop_get_noaccess AEC_prop_walletget_nobind AEC_prop_walletget_noclub AEC_prop_walletget_nouser AEC_prop_walletget_noaccess AEC_prop_walletadd_nobind AEC_prop_walletadd_limit AEC_prop_walletadd_noclub AEC_prop_walletadd_nouser AEC_prop_walletadd_noaccess AEC_prop_walletadd_noprops AEC_prop_walletadd_nomoney AEC_prop_walletadd_sql AEC_prop_alget_nobind AEC_prop_alget_noclub AEC_prop_alget_nouser AEC_prop_alget_noaccess AEC_prop_alset_nobind AEC_prop_alset_noclub AEC_prop_alset_nouser AEC_prop_alset_noaccess AEC_prop_alset_noprops AEC_prop_alset_nolevel AEC_prop_alset_sql AEC_prop_rtpget_nobind AEC_prop_rtpget_noclub AEC_prop_rtpget_nouser AEC_prop_rtpget_noaccess AEC_prop_rtpset_nobind AEC_prop_rtpset_noclub AEC_prop_rtpset_nouser AEC_prop_rtpset_noaccess AEC_prop_rtpset_noprops AEC_prop_rtpset_sql AEC_user_is_nobind AEC_user_rename_nobind AEC_user_rename_nouser AEC_user_rename_noaccess AEC_user_rename_update AEC_user_secret_nobind AEC_user_secret_smallsec AEC_user_secret_nouser AEC_user_secret_noaccess AEC_user_secret_notequ AEC_user_secret_update AEC_user_delete_nobind AEC_user_delete_nouser AEC_user_delete_noaccess AEC_user_delete_nosecret AEC_user_delete_sqluser AEC_user_delete_sqllock AEC_user_delete_sqlprops AEC_user_delete_sqlgames AEC_club_is_nobind AEC_club_info_nobind AEC_club_info_noclub AEC_club_info_noaccess AEC_club_rename_nobind AEC_club_rename_noclub AEC_club_rename_noaccess AEC_club_rename_update AEC_club_cashin_nobind AEC_club_cashin_nosum AEC_club_cashin_noclub AEC_club_cashin_noaccess AEC_club_cashin_bankout AEC_club_cashin_fundout AEC_club_cashin_lockout AEC_club_cashin_sqlbank AEC_club_cashin_sqllog )
API error codes. Each error code have unique source code point, so this error code at service reply exactly points to error place.
Variables ¶
var ( ErrNoJwtID = errors.New("jwt-token does not have user id") ErrBadJwtID = errors.New("jwt-token id does not refer to registered user") ErrNoAuth = errors.New("authorization is required") ErrNoScheme = errors.New("authorization does not have expected scheme") ErrNoSecret = errors.New("expected password or SHA256 hash on it and current time as a nonce") ErrSmallKey = errors.New("password too small") ErrNoCred = errors.New("user with given credentials does not registered") ErrActivate = errors.New("activation required for this account") ErrOldCode = errors.New("verification code expired") ErrBadCode = errors.New("verification code does not pass") ErrNotPass = errors.New("password is incorrect") ErrSigTime = errors.New("signing time can not been recognized (time in RFC3339 expected)") ErrSigOut = errors.New("nonce is expired") ErrBadHash = errors.New("hash cannot be decoded in hexadecimal") )
var ( Err404 = errors.New("page not found") Err405 = errors.New("method not allowed") ErrNoClub = errors.New("club with given ID does not found") ErrNoUser = errors.New("user with given ID does not found") ErrNoProps = errors.New("properties for given user and club does not found") ErrNoAddSum = errors.New("no sum to change balance of bank or fund or deposit") ErrNoMoney = errors.New("not enough money on balance") ErrNoGain = errors.New("no money won") ErrBankOut = errors.New("not enough money at bank") ErrFundOut = errors.New("not enough money at jackpot fund") ErrLockOut = errors.New("not enough money at deposit") ErrNotSlot = errors.New("specified GID refers to non-slot game") ErrNotKeno = errors.New("specified GID refers to non-keno game") ErrNoAccess = errors.New("no access rights for this feature") ErrNoLevel = errors.New("admin have no privilege to modify specified access level to user") ErrNotConf = errors.New("password confirmation does not pass") ErrZero = errors.New("given value is zero") ErrTooBig = errors.New("given value exceeds the limit") ErrNoAliase = errors.New("no game alias") ErrNotOpened = errors.New("game with given ID is not opened") ErrBadBank = errors.New("can not generate spin with current bank balance") )
var ( SpinBuf util.SqlBuf[Spinlog] MultBuf util.SqlBuf[Multlog] BankBat = map[uint64]*SqlBank{} JoinBuf = SqlStory{} )
var AuthGetters = []AuthGetter{ UserFromHeader, UserFromQuery, UserFromCookie, }
AuthGetters is the list of functions to extract the authorization data from the parts of request. List and order in it can be changed.
var (
Cfg = cfg.Cfg
)
var Clubs util.RWMap[uint64, *Club]
All created clubs, by CID.
var MultCounter uint64 // last multiplier log ID
var Offered = []string{ binding.MIMEJSON, binding.MIMEXML, binding.MIMEYAML, binding.MIMETOML, }
var PropMaster []Props
Properties master for new registered user.
var Scenes util.RWMap[uint64, *Scene]
Scenes cache, by GID.
var SpinCounter uint64 // last spin log ID
var StoryCounter uint64 // last GID
var Users util.RWMap[uint64, *User]
All registered users, by UID.
Functions ¶
func ApiActivate ¶
func ApiClubCashin ¶
Adding or withdrawing coins from club bank, fund and lock balances.
func ApiClubList ¶
func ApiGameInfo ¶
Returns full info of game scene with given GID, and balance on wallet.
func ApiGameList ¶
Returns full list of all available games by game type IDs.
func ApiKenoSpin ¶
func ApiPropsAlGet ¶
Returns personal access level for pointed user at pointed club.
func ApiPropsAlSet ¶
Set personal access level for given user at given club.
func ApiPropsGet ¶
Returns all properties for pointed user at pointed club.
func ApiPropsRtpGet ¶
Returns master RTP for pointed user at pointed club. This RTP if it set have more priority then club RTP.
func ApiPropsRtpSet ¶
Set personal master RTP for given user at given club.
func ApiPropsWalletAdd ¶
Adds some coins to user wallet. Sum can be < 0 to remove some coins.
func ApiPropsWalletGet ¶
Returns balance at wallet for pointed user at pointed club.
func ApiRefresh ¶
func ApiSendCode ¶
func ApiSlotCollect ¶
func ApiSlotModeSet ¶
Change game mode depending on the user's choice.
func ApiUserDelete ¶
Deletes registration, drops user and all linked records from database, and moves all remained coins at wallets to clubs deposits.
func ApiUserSecret ¶
func Auth ¶
func Auth(required bool) gin.HandlerFunc
Auth is authorization middleware, sets User object associated with authorization to gin context. `required` parameter tells to continue if authorization is absent.
func GetAdmin ¶
GetAdmin returns User pointer for authorized requests, and access level for it. Or nil pointer for unauthorized requests. It called after Auth(false) middleware.
func MustAdmin ¶
MustAdmin always returns User pointer for authorized requests, and access level for it. It called after Auth(true) middleware.
func SafeTransaction ¶
func SetupRouter ¶ added in v0.7.0
Types ¶
type AL ¶
type AL uint
Access level.
const ( ALmem AL = 1 << iota // user have access to club ALgame // can change club game settings and users gameplay ALuser // can change user properties and move user money to/from club deposit ALclub // can change club bank, fund, deposit ALadmin // can change same access levels to other users ALall = ALgame | ALuser | ALclub | ALadmin )
type AuthResp ¶
type AuthResp struct { XMLName xml.Name `json:"-" yaml:"-" xml:"ret"` UID uint64 `json:"uid" yaml:"uid" xml:"uid"` Email string `json:"email" yaml:"email" xml:"email"` Access string `json:"access" yaml:"access" xml:"access"` Refrsh string `json:"refrsh" yaml:"refrsh" xml:"refrsh"` Expire string `json:"expire" yaml:"expire" xml:"expire"` Living string `json:"living" yaml:"living" xml:"living"` }
type Banklog ¶
type Banklog struct { ID uint64 `xorm:"pk autoincr" json:"id" yaml:"id" xml:"id,attr"` CTime time.Time `xorm:"created 'ctime' notnull default CURRENT_TIMESTAMP" json:"ctime" yaml:"ctime" xml:"ctime"` Bank float64 `xorm:"notnull 'bank'" json:"bank" yaml:"bank" xml:"bank"` Fund float64 `xorm:"notnull 'fund'" json:"fund" yaml:"fund" xml:"fund"` Lock float64 `xorm:"notnull 'lock'" json:"lock" yaml:"lock" xml:"lock"` BankSum float64 `xorm:"notnull 'banksum'" json:"banksum" yaml:"banksum" xml:"banksum" form:"banksum"` FundSum float64 `xorm:"notnull 'fundsum'" json:"fundsum" yaml:"fundsum" xml:"fundsum" form:"fundsum"` LockSum float64 `xorm:"notnull 'locksum'" json:"locksum" yaml:"locksum" xml:"locksum" form:"locksum"` }
type Claims ¶
type Claims struct { jwt.RegisteredClaims UID uint64 `json:"uid,omitempty"` }
Claims of JWT-tokens. Contains additional profile identifier.
type Club ¶
type Club struct {
// contains filtered or unexported fields
}
Club means independent bank into which gambles some users.
func (*Club) AddDeposit ¶ added in v0.7.0
type ClubData ¶ added in v0.7.0
type ClubData struct { CID uint64 `xorm:"pk autoincr" json:"cid" yaml:"cid" xml:"cid,attr"` // club ID CTime time.Time `xorm:"created 'ctime' notnull default CURRENT_TIMESTAMP" json:"ctime" yaml:"ctime" xml:"ctime"` // creation time UTime time.Time `xorm:"updated 'utime' notnull default CURRENT_TIMESTAMP" json:"utime" yaml:"utime" xml:"utime"` // update time Name string `xorm:"notnull" json:"name,omitempty" yaml:"name,omitempty" xml:"name,omitempty"` Bank float64 `xorm:"notnull default 0" json:"bank" yaml:"bank" xml:"bank"` // users win/lost balance, in coins Fund float64 `xorm:"notnull default 0" json:"fund" yaml:"fund" xml:"fund"` // jackpot fund, in coins Lock float64 `xorm:"notnull default 0" json:"lock" yaml:"lock" xml:"lock"` // not changed deposit within games Rate float64 `xorm:"'rate' notnull default 2.5" json:"rate" yaml:"rate" xml:"rate"` // jackpot rate for games with progressive jackpot MRTP float64 `xorm:"'mrtp' notnull default 0" json:"mrtp" yaml:"mrtp" xml:"mrtp"` // master RTP }
type Multlog ¶
type Multlog struct { ID uint64 `xorm:"pk" json:"id" yaml:"id" xml:"id,attr"` CTime time.Time `xorm:"created 'ctime' notnull default CURRENT_TIMESTAMP" json:"ctime" yaml:"ctime" xml:"ctime"` GID uint64 `xorm:"notnull" json:"gid" yaml:"gid" xml:"gid,attr"` // game ID MRTP float64 `xorm:"notnull" json:"mrtp" yaml:"mrtp" xml:"mrtp,attr"` // master RTP Mult int `xorm:"notnull" json:"mult" yaml:"mult" xml:"mult"` // multiplier Risk float64 `xorm:"notnull" json:"risk" yaml:"risk" xml:"risk"` Gain float64 `xorm:"notnull" json:"gain" yaml:"gain" xml:"gain"` Wallet float64 `xorm:"notnull" json:"wallet" yaml:"wallet" xml:"wallet"` }
type Props ¶
type Props struct { CID uint64 `xorm:"notnull index(bid)" json:"cid" yaml:"cid" xml:"cid,attr"` // club ID UID uint64 `xorm:"notnull index(bid)" json:"uid" yaml:"uid" xml:"uid,attr"` // user ID CTime time.Time `xorm:"created 'ctime' notnull default CURRENT_TIMESTAMP" json:"ctime" yaml:"ctime" xml:"ctime"` // creation time UTime time.Time `xorm:"updated 'utime' notnull default CURRENT_TIMESTAMP" json:"utime" yaml:"utime" xml:"utime"` // update time Wallet float64 `xorm:"notnull default 0" json:"wallet" yaml:"wallet" xml:"wallet"` // in coins Access AL `xorm:"notnull default 0" json:"access" yaml:"access" xml:"access"` // access level MRTP float64 `xorm:"notnull default 0" json:"mrtp" yaml:"mrtp" xml:"mrtp"` // personal master RTP }
Props contains properties for user at some club. Any property can be zero by default, or if object does not created at DB.
type Scene ¶
type Scene struct { Story `yaml:",inline"` SID uint64 `json:"sid" yaml:"sid" xml:"sid,attr"` // last spin ID Game any `json:"game" yaml:"game" xml:"game"` }
Scene represents game with all the connected environment.
type Spinlog ¶
type Spinlog struct { SID uint64 `xorm:"pk" json:"sid" yaml:"sid" xml:"sid,attr"` // spin ID CTime time.Time `xorm:"created 'ctime' notnull default CURRENT_TIMESTAMP" json:"ctime" yaml:"ctime" xml:"ctime"` // creation time GID uint64 `xorm:"notnull" json:"gid" yaml:"gid" xml:"gid,attr"` // game ID MRTP float64 `xorm:"notnull" json:"mrtp" yaml:"mrtp" xml:"mrtp,attr"` // master RTP Game string `xorm:"notnull" json:"game" yaml:"game" xml:"game"` // game data Wins string `xorm:"text" json:"wins,omitempty" yaml:"wins,omitempty" xml:"wins,omitempty"` // list of wins marshaled to JSON Gain float64 `xorm:"notnull" json:"gain" yaml:"gain" xml:"gain"` // total gain at last spin Wallet float64 `xorm:"notnull" json:"wallet" yaml:"wallet" xml:"wallet"` }
type SqlBank ¶
type SqlBank struct {
// contains filtered or unexported fields
}
type SqlStory ¶
type SqlStory struct {
// contains filtered or unexported fields
}
type Story ¶
type Story struct { GID uint64 `xorm:"pk" json:"gid" yaml:"gid" xml:"gid,attr"` // game ID CTime time.Time `xorm:"created 'ctime' notnull default CURRENT_TIMESTAMP" json:"ctime" yaml:"ctime" xml:"ctime"` // creation time UTime time.Time `xorm:"updated 'utime' notnull default CURRENT_TIMESTAMP" json:"utime" yaml:"utime" xml:"utime"` // update time Alias string `xorm:"notnull" json:"alias" yaml:"alias" xml:"alias"` // game type identifier CID uint64 `xorm:"notnull" json:"cid" yaml:"cid" xml:"cid,attr"` // club ID UID uint64 `xorm:"notnull" json:"uid" yaml:"uid" xml:"uid,attr"` // user ID }
Story is opened game for user with UID at club with CID. Each instance of game have own GID. Alias - is game type identifier.
type User ¶
type User struct { UID uint64 `xorm:"pk autoincr" json:"uid" yaml:"uid" xml:"uid,attr"` // user ID CTime time.Time `xorm:"created 'ctime' notnull default CURRENT_TIMESTAMP" json:"ctime" yaml:"ctime" xml:"ctime"` // creation time UTime time.Time `xorm:"updated 'utime' notnull default CURRENT_TIMESTAMP" json:"utime" yaml:"utime" xml:"utime"` // update time Email string `xorm:"notnull unique index" json:"email" yaml:"email" xml:"email"` // unique user email Secret string `xorm:"notnull" json:"secret" yaml:"secret" xml:"secret"` // auth password Name string `xorm:"notnull" json:"name,omitempty" yaml:"name,omitempty" xml:"name,omitempty"` // user name Code uint32 `xorm:"notnull default 0" json:"code,omitempty" yaml:"code,omitempty" xml:"code,omitempty"` // verification code Status UF `xorm:"notnull default 0" json:"status,omitempty" yaml:"status,omitempty" xml:"status,omitempty"` // account status GAL AL `xorm:"notnull default 0" json:"gal,omitempty" yaml:"gal,omitempty" xml:"gal,omitempty"` // global access level // contains filtered or unexported fields }
User means registration of somebody. Each user can have splitted wallet with some coins balance in each Club. User can opens several games without any limitation.
func (*User) InsertProps ¶
type Walletlog ¶
type Walletlog struct { ID uint64 `xorm:"pk autoincr" json:"id" yaml:"id" xml:"id,attr"` CTime time.Time `xorm:"created 'ctime' notnull default CURRENT_TIMESTAMP" json:"ctime" yaml:"ctime" xml:"ctime"` // creation time CID uint64 `xorm:"notnull index(bid)" json:"cid" yaml:"cid" xml:"cid,attr"` // club ID UID uint64 `xorm:"notnull index(bid)" json:"uid" yaml:"uid" xml:"uid,attr"` // user ID AID uint64 `xorm:"notnull" json:"aid" yaml:"aid" xml:"aid"` // admin ID Wallet float64 `xorm:"notnull" json:"wallet" yaml:"wallet" xml:"wallet"` // new value in coins Sum float64 `xorm:"notnull" json:"sum" yaml:"sum" xml:"sum"` }