genshindaily

package
v0.0.0-...-49d8a77 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

func HandleMessage

func HandleMessage(ctx context.Context, c *Config) (string, 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 (h *DailyHandler) HandleMessage(ctx context.Context) (*models.Result, error)

func (*DailyHandler) InitNotifiers

func (h *DailyHandler) InitNotifiers(ctx context.Context) error

func (*DailyHandler) Notify

func (h *DailyHandler) Notify(ctx context.Context, res *models.Result) error

func (*DailyHandler) SignIn

func (h *DailyHandler) SignIn(cookies []*http.Cookie) (*models.Result, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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