api

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrRateLimited = errors.New("rate limited")
)

Functions

This section is empty.

Types

type API

type API struct {
	Options
	// contains filtered or unexported fields
}

func New

func New(opts Options) (*API, error)

func (*API) Do

func (a *API) Do(req *http.Request) (*http.Response, error)

func (*API) GenerateFingerprint added in v0.0.5

func (a *API) GenerateFingerprint(location string) DeviceFingerprint

func (*API) GenerateFingerprintString added in v0.0.5

func (a *API) GenerateFingerprintString(location string) (string, error)

func (*API) GetCookie added in v0.0.5

func (a *API) GetCookie(name string) string

func (*API) GetCookies

func (a *API) GetCookies() []*http.Cookie

func (*API) GetCredentials

func (a *API) GetCredentials() Credentials

func (*API) GetUserAgent

func (a *API) GetUserAgent() useragent.UserAgent

func (*API) Login

func (a *API) Login(ctx context.Context) error

func (*API) SetCookies

func (a *API) SetCookies(cookies []*http.Cookie)

type Browser added in v0.0.5

type Browser struct {
	Name         string `json:"name"`
	MajorVersion string `json:"majorVersion"`
}

type Credentials

type Credentials struct {
	Username string
	Password string
}

type DeviceFingerprint added in v0.0.5

type DeviceFingerprint struct {
	UserAgent     string     `json:"userAgent"`
	Timezone      Timezone   `json:"timezone"`
	Screen        Screen     `json:"screen"`
	Language      Language   `json:"language"`
	Fonts         Fonts      `json:"fonts"`
	Plugins       Plugins    `json:"plugins"`
	CookieEnabled string     `json:"cookieEnabled"`
	JavaEnabled   string     `json:"javaEnabled"`
	Canvas        string     `json:"canvas"`
	TrueBrowser   string     `json:"trueBrowser"`
	Tcn           string     `json:"tcn"`
	Browser       Browser    `json:"browser"`
	System        System     `json:"system"`
	Latency       Latency    `json:"latency"`
	FormFields    FormFields `json:"formFields"`
	Version       string     `json:"version"`
	Timestamp     string     `json:"timestamp"`
	Checksum      string     `json:"checksum"`
	Rt            []string   `json:"rt"`
}

type Fonts added in v0.0.5

type Fonts struct {
	InstalledFonts []string `json:"installedFonts"`
}

type FormFields added in v0.0.5

type FormFields struct {
	URL        string `json:"url"`
	FormInputs []any  `json:"formInputs"`
}

type Language added in v0.0.5

type Language struct {
	Language string `json:"language"`
}

type Latency added in v0.0.5

type Latency struct {
	RequestTime    string `json:"requestTime"`
	NetworkLatency string `json:"networkLatency"`
}

type Options

type Options struct {
	Logger *slog.Logger

	Credentials         Credentials
	BrowserUserDataPath string
	BrowserBinary       string
}

type Plugins added in v0.0.5

type Plugins struct {
	InstalledPlugins []string `json:"installedPlugins"`
}

type Screen added in v0.0.5

type Screen struct {
	Width                string `json:"width"`
	Height               string `json:"height"`
	ColorDepth           string `json:"colorDepth"`
	FontSmoothingEnabled string `json:"fontSmoothingEnabled"`
}

type System added in v0.0.5

type System struct {
	OperatingSystem string `json:"operatingSystem"`
	OSVersion       string `json:"osVersion"`
	Platform        string `json:"platform"`
}

type Timezone added in v0.0.5

type Timezone struct {
	Timezone string `json:"timezone"`
}

type Token added in v0.0.5

type Token struct {
	Token            string     `json:"token"`
	Cvv              string     `json:"cvv"`
	ExpirationDate   string     `json:"expirationDate"`
	LastFour         string     `json:"lastFour"`
	TokenReferenceID string     `json:"tokenReferenceId"`
	CreatedTimestamp string     `json:"createdTimestamp"`
	TokenName        string     `json:"tokenName"`
	TokenStatus      string     `json:"tokenStatus"`
	TokenType        string     `json:"tokenType"`
	TokenRules       TokenRules `json:"tokenRules"`
	CardReferenceID  string     `json:"cardReferenceId"`
}

type TokenMerchantBinding added in v0.0.5

type TokenMerchantBinding struct {
	BindingType  string `json:"bindingType"`
	MdxID        string `json:"mdxId"`
	MerchantName any    `json:"merchantName"`
	URLID        string `json:"urlId"`
}

type TokenRules added in v0.0.5

type TokenRules struct {
	AllowAuthorizations bool                 `json:"allowAuthorizations"`
	MerchantBinding     TokenMerchantBinding `json:"merchantBinding"`
}

Jump to

Keyboard shortcuts

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