dc

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default DC to connect to if not sure.
	DefaultDC = 2

	// How often should we request updates from
	// https://core.telegram.org/getProxyConfig
	PublicConfigUpdateEach  = time.Hour
	PublicConfigUpdateURLv4 = "https://core.telegram.org/getProxyConfig"
	PublicConfigUpdateURLv6 = "https://core.telegram.org/getProxyConfigV6"

	// How often should we extract hosts from Telegram using help.getConfig
	// method.
	OwnConfigUpdateEach = time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Addr

type Addr struct {
	Network    string
	Address    string
	Obfuscator obfuscation.Obfuscator
}

func (Addr) String

func (d Addr) String() string

type Logger

type Logger interface {
	Info(msg string)
	WarningError(msg string, err error)
}

type PublicConfigUpdater added in v2.1.11

type PublicConfigUpdater struct {
	// contains filtered or unexported fields
}

func NewPublicConfigUpdater added in v2.1.11

func NewPublicConfigUpdater(tg *Telegram, logger Logger, client *http.Client) *PublicConfigUpdater

func (*PublicConfigUpdater) Run added in v2.1.11

func (p *PublicConfigUpdater) Run(ctx context.Context, url, network string)

func (*PublicConfigUpdater) Wait added in v2.1.11

func (u *PublicConfigUpdater) Wait()

type Telegram

type Telegram struct {
	// contains filtered or unexported fields
}

func New

func New(ipPreference string) (*Telegram, error)

func (*Telegram) GetAddresses

func (t *Telegram) GetAddresses(dc int) []Addr

type Updater added in v2.1.11

type Updater interface {
	Run(ctx context.Context)
}

Jump to

Keyboard shortcuts

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