Documentation
¶
Index ¶
- Constants
- Variables
- func AIPlatforms() [](func(c *http.Client) model.Result)
- func Africa() [](func(c *http.Client) model.Result)
- func ClearCache()
- func EmbeddedProviderMetadataSnapshot() ([]ProviderMetadata, ProviderMetadataSource, error)
- func EnableCache()
- func Europe() [](func(c *http.Client) model.Result)
- func Excute(F func(c *http.Client) model.Result, c *http.Client, useProgressBar bool, ...)
- func FormarPrint(message string) string
- func GetIpv4Info(showIP bool)
- func GetIpv6Info(showIP bool)
- func HongKong() [](func(c *http.Client) model.Result)
- func IPV6Multination() [](func(c *http.Client) model.Result)
- func India() [](func(c *http.Client) model.Result)
- func Japan() [](func(c *http.Client) model.Result)
- func Korea() [](func(c *http.Client) model.Result)
- func ListPlatforms(selection string) ([]string, error)
- func LoadProviderMetadata(ctx context.Context, client *http.Client) ([]ProviderMetadata, ProviderMetadataSource, error)
- func Multination() [](func(c *http.Client) model.Result)
- func NewBar(count int64) *pb.ProgressBar
- func NorthAmerica() [](func(c *http.Client) model.Result)
- func Oceania() [](func(c *http.Client) model.Result)
- func ParseRegionSelection(value string) (string, error)
- func PreProcess(FuncList [](func(c *http.Client) model.Result))
- func PrintCenteredMessage(message string, totalLength int) string
- func ProcessFunction(FuncList [](func(c *http.Client) model.Result), c *http.Client, ...)
- func ReadSelect(language, flagString string) bool
- func RemoveDuplicates(input []string) []string
- func RunNamedTests(client *http.Client, ipVersion, language string, useProgressBar bool, ...) (string, error)
- func RunTests(client *http.Client, ipVersion, language string, useProgressBar bool) string
- func SetupConcurrency(conc uint64)
- func SetupDnsServers(DnsServers string)
- func SetupHttpProxy(httpProxy string)
- func SetupInterface(Iface string) error
- func SetupSocksProxy(socksProxy string)
- func ShowResult(r *model.Result) (s string)
- func SouthAmerica() [](func(c *http.Client) model.Result)
- func SouthEastAsia() [](func(c *http.Client) model.Result)
- func Sport() [](func(c *http.Client) model.Result)
- func SwitchOptions(c string) bool
- func Taiwan() [](func(c *http.Client) model.Result)
- func ValidateRunOptions(opts RunOptions) error
- type ProviderMetadata
- type ProviderMetadataSource
- type RunOptions
- type StructuredResult
- func RunNamedStructured(ctx context.Context, opts RunOptions, testNames string) ([]StructuredResult, error)
- func RunSelection(ctx context.Context, client *http.Client, selection, ipVersion string) ([]StructuredResult, error)
- func RunStructured(ctx context.Context, opts RunOptions) ([]StructuredResult, error)
Constants ¶
const ( ProviderMetadataSchema = "goecs.unlocktests/provider-metadata-v1" ProviderMetadataManifestSchema = "goecs.unlocktests/provider-metadata-manifest-v1" DefaultProviderMetadataMinimum = 100 DefaultProviderMetadataSyncSource = "https://raw.githubusercontent.com/HsukqiLee/MediaUnlockTest/main/pkg/providers/lists.go" )
const DefaultStructuredConcurrency = 20
Variables ¶
Functions ¶
func ClearCache ¶
func ClearCache()
func EmbeddedProviderMetadataSnapshot ¶ added in v0.0.44
func EmbeddedProviderMetadataSnapshot() ([]ProviderMetadata, ProviderMetadataSource, error)
EmbeddedProviderMetadataSnapshot returns the compile-time snapshot together with the version metadata needed by aggregators and GUIs.
func EnableCache ¶
func EnableCache()
func FormarPrint ¶
func GetIpv4Info ¶
func GetIpv4Info(showIP bool)
func GetIpv6Info ¶
func GetIpv6Info(showIP bool)
func ListPlatforms ¶
func LoadProviderMetadata ¶
func LoadProviderMetadata(ctx context.Context, client *http.Client) ([]ProviderMetadata, ProviderMetadataSource, error)
LoadProviderMetadata loads descriptive metadata only. It never changes the provider function registry or any private provider request logic.
func NewBar ¶
func NewBar(count int64) *pb.ProgressBar
func ParseRegionSelection ¶ added in v0.0.49
ParseRegionSelection converts region names and this project's menu numbers to the legacy selection string used by this module. Keeping numeric values aligned with the interactive menu avoids a second, conflicting numbering scheme for the same groups.
Multiple values may be separated by commas or whitespace. Numeric ranges are inclusive, so "11-18" selects every menu group from Hong Kong to Oceania. Duplicate selections are removed without changing their supplied order.
func PrintCenteredMessage ¶
func ProcessFunction ¶
func ReadSelect ¶
func RemoveDuplicates ¶
func RunNamedTests ¶
func SetupConcurrency ¶
func SetupConcurrency(conc uint64)
func SetupDnsServers ¶
func SetupDnsServers(DnsServers string)
func SetupHttpProxy ¶
func SetupHttpProxy(httpProxy string)
func SetupInterface ¶
func SetupSocksProxy ¶
func SetupSocksProxy(socksProxy string)
func ShowResult ¶
func SwitchOptions ¶
func ValidateRunOptions ¶ added in v0.0.47
func ValidateRunOptions(opts RunOptions) error
ValidateRunOptions lets CLI and embedding layers reject ignored or invalid network settings before mutating the shared legacy transports.
Types ¶
type ProviderMetadata ¶
type ProviderMetadata struct {
ID string `json:"id"`
Name string `json:"name"`
Category string `json:"category"`
Groups []string `json:"groups"`
SupportsIPv6 bool `json:"supports_ipv6"`
Aliases []string `json:"aliases,omitempty"`
}
func EmbeddedProviderMetadata ¶ added in v0.0.43
func EmbeddedProviderMetadata() ([]ProviderMetadata, error)
EmbeddedProviderMetadata returns the validated compile-time snapshot without performing network access.
type ProviderMetadataSource ¶
type RunOptions ¶
type StructuredResult ¶
type StructuredResult struct {
Name string `json:"name"`
Status string `json:"status"`
Region string `json:"region,omitempty"`
Info string `json:"info,omitempty"`
UnlockType string `json:"unlock_type,omitempty"`
Error string `json:"error,omitempty"`
IPVersion string `json:"ip_version"`
}
func RunNamedStructured ¶
func RunNamedStructured(ctx context.Context, opts RunOptions, testNames string) ([]StructuredResult, error)
RunNamedStructured executes only the explicitly named providers while retaining the structured network, timeout, concurrency, and IP-version behavior used by RunStructured.
func RunSelection ¶
func RunStructured ¶
func RunStructured(ctx context.Context, opts RunOptions) ([]StructuredResult, error)