Documentation ¶
Index ¶
- func CreateClientForUser(userModel user_models.User) (client util.EaClient, err bst_models.Error)
- func FindCharacterFromMD5(md5 string) (string, bst_models.Error)
- func GetCookieFromEaGate(username string, password string, otp string, client util.EaClient) bst_models.Error
- func GetMD5FromImageData(imageData []byte) []byte
- func LoadImageDataFromUri(uri string) ([]byte, bst_models.Error)
- func ProfileEaSubscriptionState(client util.EaClient) (subscriptionType string, err bst_models.Error)
- func RunUpdatesOnAllEaUsers()
- func SolveCaptcha(captchaData Captcha) (session string, correct string, err bst_models.Error)
- type Captcha
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClientForUser ¶
func CreateClientForUser(userModel user_models.User) (client util.EaClient, err bst_models.Error)
createClientForUser will generate a http client for the provided user model. This is intended to only be used for this specific user model, as it will use cookies from the database for eagate integration.
func FindCharacterFromMD5 ¶
func FindCharacterFromMD5(md5 string) (string, bst_models.Error)
FindCharacterFromMD5 will attempt to locate the Captcha MD5 in the existing MD5 slices. Returns the character name or unknown and an error if not found.
func GetCookieFromEaGate ¶
func GetCookieFromEaGate(username string, password string, otp string, client util.EaClient) bst_models.Error
GetCookieFromEaGate will submit a request to login as the given username with the provided password and optionally, otp.
func LoadImageDataFromUri ¶
func LoadImageDataFromUri(uri string) ([]byte, bst_models.Error)
LoadMD5OfImageURI will attempt to Get an image from the provided URI, and calculate the MD5 checksum of this image. Returns the MD5 checksum as a string and an error if the process fails.
func ProfileEaSubscriptionState ¶
func ProfileEaSubscriptionState(client util.EaClient) (subscriptionType string, err bst_models.Error)
func RunUpdatesOnAllEaUsers ¶
func RunUpdatesOnAllEaUsers()
func SolveCaptcha ¶
func SolveCaptcha(captchaData Captcha) (session string, correct string, err bst_models.Error)
SolveCaptcha will load a Konami Captcha and attempt to solve it. It returns a string containing the captcha session, a slice containing all correct keys, and any errors encountered.
Types ¶
type Captcha ¶
type Captcha struct { Data struct { CorrectPic string `json:"correct_pic"` Kcsess string `json:"kcsess"` ChoiceList []struct { Attr string `json:"attr"` ImgURL string `json:"img_url"` Key string `json:"key"` } `json:"choicelist"` } `json:"data"` }
Captcha defines Konami Captcha JSON
func LoadCaptchaData ¶
func LoadCaptchaData(client util.EaClient) (captchaData Captcha, err bst_models.Error)