egress

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 15 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package egress 查询出口的公网 IP,并按本地 IP 库推出出口所在的国家、时区与语言

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Exit

type Exit struct {
	IP       string `json:"ip"`
	Country  string `json:"country"`
	Timezone string `json:"timezone"`
	Locale   string `json:"locale"`
}

Exit 是一个出口的公网 IP 与按 IP 定位的国家、时区和语言

func Environment

func Environment(ctx context.Context, proxy string, locale string, timezone string) (Exit, error)

Environment 返回账户的语言与时区:两项都给出时原样返回,否则经 proxy 查询出口,未给出的项取出口所在地的语言与时区

func Lookup

func Lookup(ctx context.Context, proxy string) (Exit, error)

Lookup 经 proxy 取得出口公网 IP,再按本地 IP 库推出国家、时区与该国最常用的语言;proxy 为空时直连,IP 库缺失或过期时经同一出口下载

Jump to

Keyboard shortcuts

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