SDK

package
v0.0.0-...-348a65b Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LoginOnce sync.Mutex

Functions

This section is empty.

Types

type Check

type Check struct {
	Data    *CheckData `json:"data"`
	Message string     `json:"message"`
	Retcode any        `json:"retcode"`
}

type CheckData

type CheckData struct {
	Id      string   `json:"id"`
	Action  string   `json:"action"`
	Geetest *Geetest `json:"geetest"`
}

type ComboTokenReq

type ComboTokenReq struct {
	AppID     any    `json:"app_id"`
	ChannelID any    `json:"channel_id"`
	Data      string `json:"data"`
	Device    string `json:"device"`
	Sign      string `json:"sign"`
}

type ComboTokenReqLoginTokenData

type ComboTokenReqLoginTokenData struct {
	Uid   string `json:"uid"`
	Token string `json:"token"`
	Guest bool   `json:"guest"`
}

type ComboTokenRsp

type ComboTokenRsp struct {
	Retcode int                     `json:"retcode"`
	Message string                  `json:"message"`
	Data    *ComboTokenRspLoginData `json:"data"`
}

type ComboTokenRspLoginData

type ComboTokenRspLoginData struct {
	ComboID       string      `json:"combo_id"`
	OpenID        string      `json:"open_id"`
	ComboToken    string      `json:"combo_token"`
	Data          string      `json:"data"`
	Heartbeat     bool        `json:"heartbeat"`
	AccountType   int         `json:"account_type"`
	FatigueRemind interface{} `json:"fatigue_remind"`
}

type Geetest

type Geetest struct {
	Challenge  string `json:"challenge"`
	Gt         string `json:"gt"`
	NewCaptcha string `json:"new_captcha"`
	Success    string `json:"success"`
}

type GranterApiGetConfig

type GranterApiGetConfig struct {
	Data    *GranterApiGetConfigData `json:"data"`
	Message string                   `json:"message"`
	Retcode any                      `json:"retcode"`
}

type GranterApiGetConfigData

type GranterApiGetConfigData struct {
	Protocol               bool          `json:"protocol"`
	QrEnabled              bool          `json:"qr_enabled"`
	LogLevel               string        `json:"log_level"`
	AnnounceURL            string        `json:"announce_url"`
	PushAliasType          int           `json:"push_alias_type"`
	DisableYsdkGuard       bool          `json:"disable_ysdk_guard"`
	EnableAnnouncePicPopup bool          `json:"enable_announce_pic_popup"`
	AppName                string        `json:"app_name"`
	QrEnabledApps          QrEnabledApps `json:"qr_enabled_apps"`
	QrAppIcons             QrAppIcons    `json:"qr_app_icons"`
	QrCloudDisplayName     string        `json:"qr_cloud_display_name"`
	EnableUserCenter       bool          `json:"enable_user_center"`
}

type Login

type Login struct {
	Data    *LoginData `json:"data"`
	Message string     `json:"message"`
	Retcode any        `json:"retcode"`
}

type LoginAccount

type LoginAccount struct {
	UID               string `json:"uid"`
	Name              string `json:"name"`
	Email             string `json:"email"`
	Mobile            string `json:"mobile"`
	IsEmailVerify     string `json:"is_email_verify"`
	Realname          string `json:"realname"`
	IdentityCard      string `json:"identity_card"`
	Token             string `json:"token"`
	SafeMobile        string `json:"safe_mobile"`
	FacebookName      string `json:"facebook_name"`
	GoogleName        string `json:"google_name"`
	TwitterName       string `json:"twitter_name"`
	GameCenterName    string `json:"game_center_name"`
	AppleName         string `json:"apple_name"`
	SonyName          string `json:"sony_name"`
	TapName           string `json:"tap_name"`
	Country           string `json:"country"`
	ReactivateTicket  string `json:"reactivate_ticket"`
	AreaCode          string `json:"area_code"`
	DeviceGrantTicket string `json:"device_grant_ticket"`
	SteamName         string `json:"steam_name"`
	UnmaskedEmail     string `json:"unmasked_email"`
	UnmaskedEmailType int    `json:"unmasked_email_type"`
}

type LoginAccountRequestJson

type LoginAccountRequestJson struct {
	Account  string `json:"account"`
	Password string `json:"password"`
	IsCrypto bool   `json:"is_crypto"`
}

type LoginData

type LoginData struct {
	Account             *LoginAccount `json:"account"`
	DeviceGrantRequired bool          `json:"device_grant_required"`
	SafeMoblieRequired  bool          `json:"safe_moblie_required"`
	RealpersonRequired  bool          `json:"realperson_required"`
	ReactivateRequired  bool          `json:"reactivate_required"`
	RealnameOperation   string        `json:"realname_operation"`
}

type LoginTokenRequest

type LoginTokenRequest struct {
	Uid   string `json:"uid"`
	Token string `json:"token"`
}

type QrAppIcons

type QrAppIcons struct {
	App   string `json:"app"`
	Bbs   string `json:"bbs"`
	Cloud string `json:"cloud"`
}

type QrEnabledApps

type QrEnabledApps struct {
	Bbs   bool `json:"bbs"`
	Cloud bool `json:"cloud"`
}

type RiskyApiCheck

type RiskyApiCheck struct {
	ActionType string `json:"action_type"`
	APIName    string `json:"api_name"`
	Username   string `json:"username"`
}

type Server

type Server struct {
	Config *config.Config
	Store  *DataBase.Store
	Router *gin.Engine

	AutoCreate sync.Mutex
	// contains filtered or unexported fields
}

func (*Server) Api

func (s *Server) Api(c *gin.Context)

func (*Server) ComboGranterApiGetConfigHandler

func (s *Server) ComboGranterApiGetConfigHandler(c *gin.Context)

func (*Server) GetAgreementInfos

func (s *Server) GetAgreementInfos(c *gin.Context)

func (*Server) GetExperimentListHandler

func (s *Server) GetExperimentListHandler(c *gin.Context)

func (*Server) HandleDefault

func (s *Server) HandleDefault(c *gin.Context)

func (*Server) IfKey

func (s *Server) IfKey(key string) bool

func (*Server) InitRouter

func (s *Server) InitRouter()

func (*Server) LoginRequestHandler

func (s *Server) LoginRequestHandler(c *gin.Context)

登录流程 1.从数据库获取此用户名,有返回,无则下一步 2.若关闭了自动注册返回次用户不存在,否则进入下一步 3.此步是开启了自动注册,将用户名写入数据库,并且获取到key作为accountUid返回

func (*Server) QueryDispatchHandler

func (s *Server) QueryDispatchHandler(c *gin.Context)

func (*Server) QueryGatewayHandler

func (s *Server) QueryGatewayHandler(c *gin.Context)

func (*Server) QueryGatewayHandlerCaptureCn

func (s *Server) QueryGatewayHandlerCaptureCn(c *gin.Context)

func (*Server) QueryGatewayHandlerCaptureOs

func (s *Server) QueryGatewayHandlerCaptureOs(c *gin.Context)

func (*Server) RiskyApiCheckHandler

func (s *Server) RiskyApiCheckHandler(c *gin.Context)

func (*Server) SdkDataUploadHandler

func (s *Server) SdkDataUploadHandler(c *gin.Context)

func (*Server) Shutdown

func (s *Server) Shutdown(context.Context) error

func (*Server) Start

func (s *Server) Start() error

func (*Server) V2LoginRequestHandler

func (s *Server) V2LoginRequestHandler(c *gin.Context)

流程: 1.检查token是否正确 2.若正确则生成token返回 3.若错误或不存在则返回错误

func (*Server) VerifyRequestHandler

func (s *Server) VerifyRequestHandler(c *gin.Context)

Jump to

Keyboard shortcuts

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