Documentation ¶
Index ¶
- func JsonFromBytes(bytes []byte) *gojsonq.JSONQ
- func JsonFromString(s string) *gojsonq.JSONQ
- type Bl3Client
- func (client *Bl3Client) GenerateVipCodeUrlMap() (map[string]string, error)
- func (client *Bl3Client) GetCodePlatforms(code string) ([]string, bool)
- func (client *Bl3Client) GetFullShiftCodeList() (ShiftCodeMap, error)
- func (client *Bl3Client) GetFullVipCodeMap() (VipCodeMap, error)
- func (client *Bl3Client) GetRedeemedVipCodeMap() (VipCodeMap, error)
- func (client *Bl3Client) GetShiftPlatforms() (StringSet, error)
- func (client *Bl3Client) GetVipActivities() ([]VipActivity, error)
- func (client *Bl3Client) Login(username string, password string) error
- func (client *Bl3Client) RedeemShiftCode(code, platform string) error
- func (client *Bl3Client) RedeemVipActivity(activity VipActivity) bool
- func (client *Bl3Client) RedeemVipCode(codeType, code string) (string, bool)
- type Bl3Config
- type HttpClient
- func (client *HttpClient) Do(req *Request) (*HttpResponse, error)
- func (client *HttpClient) Get(url string) (*HttpResponse, error)
- func (client *HttpClient) Head(url string) (*HttpResponse, error)
- func (client *HttpClient) Post(url, contentType string, body io.Reader) (*HttpResponse, error)
- func (client *HttpClient) PostJson(url string, data interface{}) (*HttpResponse, error)
- func (client *HttpClient) SetDefaultHeader(k, v string)
- type HttpResponse
- type ShiftCodeMap
- type ShiftConfig
- type StringSet
- type VipActivity
- type VipCodeMap
- type VipConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JsonFromBytes ¶
func JsonFromString ¶
Types ¶
type Bl3Client ¶
type Bl3Client struct { HttpClient Config Bl3Config }
func NewBl3Client ¶
func (*Bl3Client) GenerateVipCodeUrlMap ¶
func (*Bl3Client) GetCodePlatforms ¶
func (*Bl3Client) GetFullShiftCodeList ¶
func (client *Bl3Client) GetFullShiftCodeList() (ShiftCodeMap, error)
func (*Bl3Client) GetFullVipCodeMap ¶
func (client *Bl3Client) GetFullVipCodeMap() (VipCodeMap, error)
func (*Bl3Client) GetRedeemedVipCodeMap ¶
func (client *Bl3Client) GetRedeemedVipCodeMap() (VipCodeMap, error)
func (*Bl3Client) GetShiftPlatforms ¶
func (*Bl3Client) GetVipActivities ¶
func (client *Bl3Client) GetVipActivities() ([]VipActivity, error)
func (*Bl3Client) RedeemShiftCode ¶
func (*Bl3Client) RedeemVipActivity ¶
func (client *Bl3Client) RedeemVipActivity(activity VipActivity) bool
type Bl3Config ¶
type Bl3Config struct { Version string `json:"version"` LoginUrl string `json:"loginUrl"` LoginRedirectHeader string `json:"loginRedirectHeader"` SessionIdHeader string `json:"sessionIdHeader"` RequestHeaders map[string]string `json:"requestHeaders"` SessionHeader string `json:"sessionHeader"` Vip VipConfig `json:"vipConfig"` Shift ShiftConfig `json:"shiftConfig"` }
func (*Bl3Config) NewVipCodeMap ¶
func (conf *Bl3Config) NewVipCodeMap() VipCodeMap
type HttpClient ¶
type HttpClient struct { Client // contains filtered or unexported fields }
func NewHttpClient ¶
func NewHttpClient() (*HttpClient, error)
func (*HttpClient) Do ¶
func (client *HttpClient) Do(req *Request) (*HttpResponse, error)
func (*HttpClient) Get ¶
func (client *HttpClient) Get(url string) (*HttpResponse, error)
func (*HttpClient) Head ¶
func (client *HttpClient) Head(url string) (*HttpResponse, error)
func (*HttpClient) Post ¶
func (client *HttpClient) Post(url, contentType string, body io.Reader) (*HttpResponse, error)
func (*HttpClient) PostJson ¶
func (client *HttpClient) PostJson(url string, data interface{}) (*HttpResponse, error)
func (*HttpClient) SetDefaultHeader ¶
func (client *HttpClient) SetDefaultHeader(k, v string)
type HttpResponse ¶
type HttpResponse struct {
Response
}
func (*HttpResponse) BodyAsHtmlDoc ¶
func (response *HttpResponse) BodyAsHtmlDoc() (*goquery.Document, error)
func (*HttpResponse) BodyAsJson ¶
func (response *HttpResponse) BodyAsJson() (*gojsonq.JSONQ, error)
type ShiftCodeMap ¶
func (ShiftCodeMap) Contains ¶
func (codeMap ShiftCodeMap) Contains(code, platform string) bool
type ShiftConfig ¶
type VipActivity ¶
type VipCodeMap ¶
func (VipCodeMap) Add ¶
func (v VipCodeMap) Add(codeType, code string)
func (VipCodeMap) Diff ¶
func (v VipCodeMap) Diff(other VipCodeMap) VipCodeMap
type VipConfig ¶
type VipConfig struct { CodeListUrl string `json:"codeListUrl"` CodeListRowSelector string `json:"codeListRowSelector"` CodeListInvalidRegex string `json:"codeListInvalidRegex"` CodeListCheckIndex int `json:"codeListCheckIndex"` CodeListCodeIndex int `json:"codeListCodeIndex"` CodeListTypeIndex int `json:"codeListTypeIndex"` CodeTypeUrlMap map[string]string `json:"codeTypeUrlMap"` }
func (*VipConfig) DetectCodeTypes ¶
func (*VipConfig) GetCodeTypes ¶
Click to show internal directories.
Click to hide internal directories.