executor

package
v0.0.52 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 52 Imported by: 3

Documentation

Index

Constants

View Source
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"
)
View Source
const DefaultStructuredConcurrency = 20

Variables

View Source
var (
	IPV4, IPV6 = true, true
	R          []*model.Result

	Names                                                    []string
	M, TW, HK, JP, KR, NA, SA, EU, AFR, SEA, OCEA, SPORT, AI = false, false, false, false, false, false, false, false, false, false, false, false, false
)

Functions

func AIPlatforms

func AIPlatforms() [](func(c *http.Client) model.Result)

func Africa

func Africa() [](func(c *http.Client) model.Result)

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 Europe

func Europe() [](func(c *http.Client) model.Result)

func Excute

func Excute(F func(c *http.Client) model.Result, c *http.Client, useProgressBar bool, ipVersion string)

func FormarPrint

func FormarPrint(message string) string

func GetIpv4Info

func GetIpv4Info(showIP bool)

func GetIpv6Info

func GetIpv6Info(showIP bool)

func HongKong

func HongKong() [](func(c *http.Client) model.Result)

func IPV6Multination

func IPV6Multination() [](func(c *http.Client) model.Result)

func India

func India() [](func(c *http.Client) model.Result)

func Japan

func Japan() [](func(c *http.Client) model.Result)

func Korea

func Korea() [](func(c *http.Client) model.Result)

func ListPlatforms

func ListPlatforms(selection string) ([]string, error)

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 Multination

func Multination() [](func(c *http.Client) model.Result)

func NewBar

func NewBar(count int64) *pb.ProgressBar

func NorthAmerica

func NorthAmerica() [](func(c *http.Client) model.Result)

func Oceania

func Oceania() [](func(c *http.Client) model.Result)

func ParseRegionSelection added in v0.0.49

func ParseRegionSelection(value string) (string, error)

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 PreProcess

func PreProcess(FuncList [](func(c *http.Client) model.Result))

func PrintCenteredMessage

func PrintCenteredMessage(message string, totalLength int) string

func ProcessFunction

func ProcessFunction(FuncList [](func(c *http.Client) model.Result), c *http.Client, useProgressBar bool, ipVersion string)

func ReadSelect

func ReadSelect(language, flagString string) bool

func RemoveDuplicates

func RemoveDuplicates(input []string) []string

func RunNamedTests

func RunNamedTests(client *http.Client, ipVersion, language string, useProgressBar bool, testNames string) (string, error)

func RunTests

func RunTests(client *http.Client, ipVersion, language string, useProgressBar bool) string

func SetupConcurrency

func SetupConcurrency(conc uint64)

func SetupDnsServers

func SetupDnsServers(DnsServers string)

func SetupHttpProxy

func SetupHttpProxy(httpProxy string)

func SetupInterface

func SetupInterface(Iface string) error

func SetupSocksProxy

func SetupSocksProxy(socksProxy string)

func ShowResult

func ShowResult(r *model.Result) (s string)

func SouthAmerica

func SouthAmerica() [](func(c *http.Client) model.Result)

func SouthEastAsia

func SouthEastAsia() [](func(c *http.Client) model.Result)

func Sport

func Sport() [](func(c *http.Client) model.Result)

func SwitchOptions

func SwitchOptions(c string) bool

func Taiwan

func Taiwan() [](func(c *http.Client) model.Result)

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 ProviderMetadataSource struct {
	Schema      string    `json:"schema"`
	Count       int       `json:"count"`
	GeneratedAt time.Time `json:"generated_at,omitempty"`
	Source      string    `json:"-"`
	Fallback    bool      `json:"-"`
}

type RunOptions

type RunOptions struct {
	Selection    string
	IPVersion    string
	Client       *http.Client
	Concurrency  int
	Interface    string
	DNSServers   string
	HTTPProxy    string
	SOCKSProxy   string
	UseCache     bool
	IncludeHeads bool
}

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 RunSelection(ctx context.Context, client *http.Client, selection, ipVersion string) ([]StructuredResult, error)

func RunStructured

func RunStructured(ctx context.Context, opts RunOptions) ([]StructuredResult, error)

Jump to

Keyboard shortcuts

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