api

package
v0.0.0-...-bfed37f Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: GPL-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResultCodeServerErr = 11001

	ResultCodeExistAccount      = 22001
	ResultCodeExistName         = 22002
	ResultCodeIncorrectAccount  = 22003
	ResultCodeIncorrectPassword = 22004

	ResultCodeCorpExistCorpAccount  = 23002
	ResultCodeCorpServerErr         = 23003
	ResultCodeCorpIncorrectAccount  = 22004
	ResultCodeCorpIncorrectPassword = 22005
	ResultCodeCorpNotActivate       = 22006

	ResultCodePreviousPointErr = 41100

	ResultCodeUserKeyErr = 51001
	ResultCodeParamErr   = 51002
)

Variables

This section is empty.

Functions

func RenderTemplate

func RenderTemplate(w http.ResponseWriter, name string, data interface{})

Types

type ActionFn

type ActionFn func(http.ResponseWriter, *http.Request)

type ApiServer

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

func NewApiServer

func NewApiServer(cfg *config.ApiConfig, name string, backend *redis.RedisClient, db *mysql.Database, dbAuth *mysql.Database) *ApiServer

func (*ApiServer) ActionBalanceMulti

func (s *ApiServer) ActionBalanceMulti(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ActionCreateAccount

func (s *ApiServer) ActionCreateAccount(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ActionCropWalletEth

func (s *ApiServer) ActionCropWalletEth(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ActionUserLogout

func (s *ApiServer) ActionUserLogout(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ActionUserRefreshToken

func (s *ApiServer) ActionUserRefreshToken(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ActionWalletEth

func (s *ApiServer) ActionWalletEth(w http.ResponseWriter, r *http.Request)

func (*ApiServer) AuthenticateIndex

func (s *ApiServer) AuthenticateIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ChangeServerStatusIndex

func (s *ApiServer) ChangeServerStatusIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) CheckAPIJwtToken

func (s *ApiServer) CheckAPIJwtToken(r *http.Request, requestURI string) (bool, string)

func (*ApiServer) CheckJwtToken

func (s *ApiServer) CheckJwtToken(r *http.Request, requestURI string) (bool, string)

func (*ApiServer) CorpAddGameIndex

func (s *ApiServer) CorpAddGameIndex(w http.ResponseWriter, r *http.Request)

회사에 게임을 추가 한다.

func (*ApiServer) CorpLogOutIndex

func (s *ApiServer) CorpLogOutIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) CorpLoginIndex

func (s *ApiServer) CorpLoginIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) CorpUserAddPointIndex

func (s *ApiServer) CorpUserAddPointIndex(w http.ResponseWriter, r *http.Request)

게임에 유저의 정보(로그인)를 얻어 온다.

func (*ApiServer) CorpUserGetPointIndex

func (s *ApiServer) CorpUserGetPointIndex(w http.ResponseWriter, r *http.Request)

게임에 유저의 정보(로그인)를 얻어 온다.

func (*ApiServer) CorpUserLoginIndex

func (s *ApiServer) CorpUserLoginIndex(w http.ResponseWriter, r *http.Request)

게임에 유저의 정보(로그인)를 얻어 온다.

func (*ApiServer) CreateCorp

func (s *ApiServer) CreateCorp(w http.ResponseWriter, r *http.Request)

func (*ApiServer) CreateCorpIndex

func (s *ApiServer) CreateCorpIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) CreateCorpToken

func (s *ApiServer) CreateCorpToken(id, gameId, access string, expirationMin int64) (string, error)

func (*ApiServer) CreateJwtToken

func (s *ApiServer) CreateJwtToken(userId int64, access string, expirationSec int64) (string, string, error)

func (*ApiServer) CreateToken

func (s *ApiServer) CreateToken(userName, access string, expirationSec int64) (string, error)

func (*ApiServer) CreateWallet

func (s *ApiServer) CreateWallet() (privateKey, walletAddr string)

func (*ApiServer) GetServStatusIndex

func (s *ApiServer) GetServStatusIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) GetTokenIndex

func (s *ApiServer) GetTokenIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) GetVersionIndex

func (s *ApiServer) GetVersionIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) Health

func (s *ApiServer) Health(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ModuleIndex

func (s *ApiServer) ModuleIndex(w http.ResponseWriter, r *http.Request)

func (*ApiServer) RedisMessage

func (s *ApiServer) RedisMessage(payload string)

func (*ApiServer) RenderAuthView

func (s *ApiServer) RenderAuthView(w http.ResponseWriter, r *http.Request)

func (*ApiServer) RenderMainView

func (s *ApiServer) RenderMainView(w http.ResponseWriter, r *http.Request)

func (*ApiServer) ServerApiError

func (s *ApiServer) ServerApiError(w http.ResponseWriter, r *http.Request, statusCode int, status int, errMsg string)

func (*ApiServer) ServerError

func (s *ApiServer) ServerError(w http.ResponseWriter, r *http.Request, errMsg string)

func (*ApiServer) Start

func (s *ApiServer) Start()

func (*ApiServer) TestAuthenticate

func (s *ApiServer) TestAuthenticate(w http.ResponseWriter, r *http.Request)

func (*ApiServer) TokenValid

func (s *ApiServer) TokenValid(accessToken string) (*jwt.Token, error)

func (*ApiServer) VerifyToken

func (s *ApiServer) VerifyToken(accessToken string) (*jwt.Token, error)

func (*ApiServer) WriteHttpResponseOK

func (s *ApiServer) WriteHttpResponseOK(w http.ResponseWriter, result map[string]interface{})

type DbIPInbound

type DbIPInbound struct {
	Ip    string `json:"ip"`
	Rule  string `json:"rule"`
	Alarm string `json:"alarm"`
	Desc  string `json:"desc"`
}

type DevSubList

type DevSubList struct {
	DevId   string `json:"devid"`
	SubId   string `json:"subid"`
	Amount  string `json:"amount"`
	AllowId bool   `json:"allowid"`
}

type Entry

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

type EntryActions

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

type GUser

type GUser struct {
	Name        string `json:"name"`
	Email       string `json:"email"`
	EmailVerify bool   `json:"email_verified"`
	Locale      string `json:"locale"`
	Sub         string `json:"sub"`
	Picture     string `json:"picture"`
}

type User

type User struct {
	Username string `json:"user_name"`
	Password string `json:"password"`
	Access   string `json:"access"`
	GameCode string `json:"game_code"`
}

type UserToken

type UserToken struct {
	Username   string `json:"username"`
	Password   string `json:"password"`
	Access     string `json:"access"`
	ExpireTime int64  `json:"expire-time"`
}

type ValueAuthGoogleParam

type ValueAuthGoogleParam struct {
	Code     string `json:"code"`
	Account  string `json:"account"`
	Password string `json:"password"`
}

type ValueCorpParam

type ValueCorpParam struct {
	UserName string `json:"user_name"`
	Password string `json:"password"`
	CorpName string `json:"corp_name"`
	GameName string `json:"game_name"`
	PickId   string `json:"pick_id"`
	UserKey  string `json:"user_key"`
}

type ValueTokenParam

type ValueTokenParam struct {
	RefreshToken string `json:"refresh_token"`
	// contains filtered or unexported fields
}

type ValueUserDataParam

type ValueUserDataParam struct {
	UserKey       string `json:"user_key"`
	PreviousPoint string `json:"previous_point"`
	AdjustPoint   string `json:"adjust_point"`
	WalletAddress string `json:"wallet_address"`
}

Jump to

Keyboard shortcuts

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