importer

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultSubscriptionTimeout  = 15 * time.Second
	DefaultSubscriptionMaxBytes = 5 * 1024 * 1024
)

Variables

This section is empty.

Functions

func DeduplicateImported

func DeduplicateImported(eps []v2rayn.ImportedEndpoint) []v2rayn.ImportedEndpoint

func FetchSubscription added in v1.1.0

func FetchSubscription(ctx context.Context, rawURL string, opts SubscriptionOptions) (string, string, error)

FetchSubscription downloads a single HTTP(S) URL with timeout and response body limits. Returned errors use a sanitized URL without query/fragment data.

func ImportLinkFile

func ImportLinkFile(path string) ([]v2rayn.ImportedEndpoint, error)

func ImportPastedSubscriptions added in v1.1.0

func ImportPastedSubscriptions(ctx context.Context, text string, opts SubscriptionOptions) ([]v2rayn.ImportedEndpoint, error)

ImportPastedSubscriptions accepts text pasted into the TUI. HTTP(S) tokens are fetched; non-HTTP content is parsed locally as raw share links or a pasted base64/plain subscription body.

func ImportSubscriptionURLs added in v1.1.0

func ImportSubscriptionURLs(ctx context.Context, urls []string, opts SubscriptionOptions) ([]v2rayn.ImportedEndpoint, error)

ImportSubscriptionURLs fetches one or more HTTP(S) subscription URLs and parses v2rayN/base64/plain share-link content from the response bodies.

func ImportV2rayN

func ImportV2rayN(dir string) ([]v2rayn.ImportedEndpoint, error)

Types

type SubscriptionOptions added in v1.1.0

type SubscriptionOptions struct {
	Timeout  time.Duration
	MaxBytes int64
	Client   *http.Client
}

SubscriptionOptions controls remote subscription fetching. The defaults are intentionally conservative because subscription URLs can contain secrets.

Jump to

Keyboard shortcuts

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