Documentation
¶
Index ¶
- Constants
- Variables
- func GetInfo(ctx context.Context, r *resty.Client, info **models.InfoResponse) error
- func GetRewards(ctx context.Context, r *resty.Client, rewards **models.RewardsResponse) error
- func HandleMessage(ctx context.Context, c *Config) (string, error)
- type Config
- type DailyHandler
- func (h *DailyHandler) GetInfoAndRewards() (info *models.InfoResponse, rewards *models.RewardsResponse, err error)
- func (h *DailyHandler) HandleMessage(ctx context.Context) (*models.Result, error)
- func (h *DailyHandler) InitNotifiers(ctx context.Context) error
- func (h *DailyHandler) Notify(ctx context.Context, res *models.Result) error
- func (h *DailyHandler) SignIn(cookies []*http.Cookie) (*models.Result, error)
Constants ¶
View Source
const ( DefaultLang = "en-us" ActID = "e202102251931481" UserAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148" RefererURL = "https://webstatic-sea.mihoyo.com/ys/event/signin-sea/index.html?act_id=%s" InfoURL = "https://hk4e-api-os.mihoyo.com/event/sol/info?lang=%s&act_id=%s" RewardURL = "https://hk4e-api-os.mihoyo.com/event/sol/home?lang=%s&act_id=%s" SignURL = "https://hk4e-api-os.mihoyo.com/event/sol/sign?lang=%s" )
Variables ¶
View Source
var Commit = "ffffffff"
View Source
var Date = "1 January 1970 12:00:00"
View Source
var ErrAlreadyCheckedIn = errors.New("already checked in")
View Source
var Version = "dev"
Functions ¶
func GetInfo ¶
func GetInfo(ctx context.Context, r *resty.Client, info **models.InfoResponse) error
Get Info Response
func GetRewards ¶
func GetRewards(ctx context.Context, r *resty.Client, rewards **models.RewardsResponse) error
Types ¶
type Config ¶
type Config struct { Cookies string `json:"cookies" validate:"required"` Notifiers []json.RawMessage `json:"notifiers"` }
type DailyHandler ¶
type DailyHandler struct { *Config // contains filtered or unexported fields }
func (*DailyHandler) GetInfoAndRewards ¶
func (h *DailyHandler) GetInfoAndRewards() (info *models.InfoResponse, rewards *models.RewardsResponse, err error)
func (*DailyHandler) HandleMessage ¶
func (*DailyHandler) InitNotifiers ¶
func (h *DailyHandler) InitNotifiers(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.