Documentation
¶
Index ¶
- Constants
- func ApplyUmask(perm os.FileMode) os.FileMode
- func StoreUmask(mask int)
- func ValidateFlareSolverrConfig(path string, cfg FlareSolverrConfig) error
- func ValidateHTTPBaseURL(path, raw string) error
- func ValidateRequestDelay(path string, delay int) error
- type FlareSolverrConfig
- type UserAgentString
- func (u UserAgentString) MarshalJSON() ([]byte, error)
- func (u UserAgentString) MarshalYAML() (interface{}, error)
- func (u *UserAgentString) Scan(value interface{}) error
- func (u *UserAgentString) UnmarshalJSON(data []byte) error
- func (u *UserAgentString) UnmarshalYAML(unmarshal func(interface{}) error) error
Constants ¶
const ( DirPerm = 0777 DirPermTemp = 0700 FilePerm = 0666 )
const ( // DefaultUserAgent is the true/identifying UA for Javinizer. DefaultUserAgent = "Javinizer (+https://github.com/javinizer/Javinizer)" // DefaultFakeUserAgent is a browser-like UA for scraper-hostile sites. // Used as fallback when scraper UserAgent is not set. DefaultFakeUserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36" )
Variables ¶
This section is empty.
Functions ¶
func StoreUmask ¶
func StoreUmask(mask int)
func ValidateFlareSolverrConfig ¶
func ValidateFlareSolverrConfig(path string, cfg FlareSolverrConfig) error
ValidateFlareSolverrConfig validates FlareSolverr configuration
func ValidateHTTPBaseURL ¶
ValidateHTTPBaseURL validates that a base URL is a valid HTTP or HTTPS URL.
func ValidateRequestDelay ¶
ValidateRequestDelay validates request delay configuration
Types ¶
type FlareSolverrConfig ¶
type FlareSolverrConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"` // Enable FlareSolverr for bypassing Cloudflare
URL string `yaml:"url" json:"url"` // FlareSolverr endpoint (default: http://localhost:8191/v1)
Timeout int `yaml:"timeout" json:"timeout"` // Request timeout in seconds (default: 30)
MaxRetries int `yaml:"max_retries" json:"max_retries"` // Max retry attempts for FlareSolverr calls (default: 3)
SessionTTL int `yaml:"session_ttl" json:"session_ttl"` // Session TTL in seconds (default: 300)
}
FlareSolverrConfig holds FlareSolverr configuration for bypassing Cloudflare Copied from internal/config to avoid circular dependency
type UserAgentString ¶
type UserAgentString struct {
Value string
}
UserAgentString is a custom User-Agent string type that marshals/unmarshals as a plain string.
func (UserAgentString) MarshalJSON ¶
func (u UserAgentString) MarshalJSON() ([]byte, error)
MarshalJSON implements json.Marshaler so UserAgentString marshals as a plain string.
func (UserAgentString) MarshalYAML ¶
func (u UserAgentString) MarshalYAML() (interface{}, error)
MarshalYAML implements custom marshaling so the field serializes as a plain string.
func (*UserAgentString) Scan ¶
func (u *UserAgentString) Scan(value interface{}) error
Scan implements sql.Scanner for database compatibility.
func (*UserAgentString) UnmarshalJSON ¶
func (u *UserAgentString) UnmarshalJSON(data []byte) error
UnmarshalJSON implements json.Unmarshaler so UserAgentString unmarshals from a plain string or an object with a "value" field.
func (*UserAgentString) UnmarshalYAML ¶
func (u *UserAgentString) UnmarshalYAML(unmarshal func(interface{}) error) error
UnmarshalYAML implements custom unmarshaling so the field accepts a plain string.