clients

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CN = 1 << iota
	OS
)

Variables

View Source
var (
	ErrURLNotFound    = errors.New("URL not found")
	ErrClientNotFound = errors.New("client not found")
	ErrUIDNotFound    = errors.New("UID not found")

	CNClient = Client{
		PersistentDataPath: filepath.Join(os.Getenv("USERPROFILE"), `\AppData\LocalLow\miHoYo\原神`),
		QueryLinkHostName:  "webstatic.mihoyo.com",
		APIGetWishHistory:  "https://hk4e-api.mihoyo.com/event/gacha_info/api/getGachaLog",
	}
	OSClient = Client{
		PersistentDataPath: filepath.Join(os.Getenv("USERPROFILE"), `\AppData\LocalLow\miHoYo\Genshin Impact`),
		QueryLinkHostName:  "webstatic-sea.hoyoverse.com",
		APIGetWishHistory:  "https://hk4e-api-os.hoyoverse.com/event/gacha_info/api/getGachaLog",
	}
)
View Source
var DataPathRE = regexp.MustCompile(`.:/.*?/(YuanShen_Data|GenshinImpact_Data)/`)

Functions

func DetectVersions added in v0.2.2

func DetectVersions() int

func FindDataPath added in v0.3.0

func FindDataPath(outputLog []byte) string

Types

type Client

type Client struct {
	PersistentDataPath string
	QueryLinkHostName  string
	APIGetWishHistory  string
}

func Default added in v0.2.2

func Default() (client Client, err error)

func (Client) FindQueryLinkWithAuthKey

func (client Client) FindQueryLinkWithAuthKey() (*url.URL, error)

func (Client) FindURLFromCacheData added in v0.3.0

func (client Client) FindURLFromCacheData(f func(u *url.URL) bool) (*url.URL, error)

func (Client) FindURLFromOutputLog

func (client Client) FindURLFromOutputLog(f func(u *url.URL) bool) (*url.URL, error)

func (Client) GetBaseURL

func (client Client) GetBaseURL() (baseURL string, err error)

func (Client) GetUID

func (client Client) GetUID() (string, error)

func (Client) OutputLogPath

func (client Client) OutputLogPath() string

func (Client) UIDInfoPath

func (client Client) UIDInfoPath() string

Jump to

Keyboard shortcuts

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