Files
go-flaresolverr/model.go

119 lines
4.7 KiB
Go

package flaresolverr
import "net/http"
type ChallengeResolutionResultT struct {
URL string `json:"url"`
Status int `json:"status"`
Headers map[string]string `json:"headers"`
Response string `json:"-"`
RawResponse any `json:"response"`
Cookies []*http.Cookie
RawCookies []struct {
Name string `json:"name"`
Value string `json:"value"`
Domain string `json:"domain"`
Path string `json:"path"`
Expires float64 `json:"expires"`
Size int64 `json:"size"`
HttpOnly bool `json:"httpOnly"`
Secure bool `json:"secure"`
Session bool `json:"session"`
SameSite string `json:"sameSite"`
Priority string `json:"priority"`
SameParty bool `json:"sameParty"`
SourceScheme string `json:"sourceScheme"`
SourcePort uint `json:"sourcePort"`
PartitionKey string `json:"partitionKey"`
} `json:"cookies"`
UserAgent string `json:"userAgent"`
}
type ChallengeResolutionT struct {
Status string `json:"status"`
Message string `json:"message"`
Result *ChallengeResolutionResultT `json:"result"`
}
type Cookie struct {
Name string `json:"name"`
Value string `json:"value"`
}
type V1RequestBase struct {
Cmd string `json:"cmd,omitempty"`
Cookies []Cookie `json:"cookies,omitempty"`
MaxTimeout int `json:"maxTimeout,omitempty"`
Proxy struct {
Url string `json:"url"`
} `json:"proxy,omitempty"`
Session string `json:"session,omitempty"`
SessionTTLMinutes int `json:"session_ttl_minutes,omitempty"`
Headers map[string]string `json:"headers,omitempty"` // Deprecated v2.0.0
UserAgent string `json:"userAgent,omitempty"` // Deprecated v2.0.0
// V1Request
URL string `json:"url,omitempty"`
PostData string `json:"postData,omitempty"` // Must be a string with application/x-www-form-urlencoded
ReturnOnlyCookies bool `json:"returnOnlyCookies,omitempty"`
Download bool `json:"download,omitempty"` // Deprecated v2.0.0
ReturnRawHtml bool `json:"returnRawHtml,omitempty"` // Deprecated v2.0.0
}
type V1ResponseBase struct {
Status string `json:"status"`
Message string `json:"message"`
Session string `json:"session"`
Sessions []string `json:"sessions"`
StartTimestamp int64 `json:"startTimestamp"`
EndTimestamp int64 `json:"endTimestamp"`
Version string `json:"version"`
Solution *ChallengeResolutionResultT `json:"solution"`
// Hidden vars
Error500 bool `json:"__error_500__"`
}
type IndexResponse struct {
Msg string `json:"msg"`
Version string `json:"version"`
UserAgent string `json:"userAgent"`
}
type HealthResponse struct {
Status string `json:"status"`
}
type Ja3 struct {
Ja3 string `json:"ja3"`
Ja3N string `json:"ja3n"`
Ja3Digest string `json:"ja3_digest"`
Ja3NDigest string `json:"ja3n_digest"`
ScrapflyFp string `json:"scrapfly_fp"`
ScrapflyFpDigest string `json:"scrapfly_fp_digest"`
TLS struct {
Version string `json:"version"`
Ciphers []string `json:"ciphers"`
Curves []string `json:"curves"`
Extensions []string `json:"extensions"`
Points []string `json:"points"`
Protocols []string `json:"protocols"`
Versions []string `json:"versions"`
HandshakeDuration string `json:"handshake_duration"`
IsSessionResumption bool `json:"is_session_resumption"`
SessionTicketSupported bool `json:"session_ticket_supported"`
SupportSecureRenegotiation bool `json:"support_secure_renegotiation"`
SupportedTLSVersions []int `json:"supported_tls_versions"`
SupportedProtocols []string `json:"supported_protocols"`
SignatureAlgorithms []int `json:"signature_algorithms"`
PskKeyExchangeMode string `json:"psk_key_exchange_mode"`
CertCompressionAlgorithms string `json:"cert_compression_algorithms"`
EarlyData bool `json:"early_data"`
UsingPsk bool `json:"using_psk"`
SelectedProtocol string `json:"selected_protocol"`
SelectedCurveGroup int `json:"selected_curve_group"`
SelectedCipherSuite int `json:"selected_cipher_suite"`
KeyShares []int `json:"key_shares"`
} `json:"tls"`
}