type github.com/gotd/td/telegram.Client
131 uses
github.com/gotd/td/telegram (current package)
account_status.go#L122: func (c *Client) handleServiceNotification(u *tg.UpdateServiceNotification) {
account_status.go#L194: func (c *Client) FreezeState(ctx context.Context) (FreezeState, error) {
account_status.go#L220: func (c *Client) observeRestriction(input bin.Encoder, err error) {
account_status.go#L265: func (c *Client) checkFreeze(ctx context.Context, method string) {
auth.go#L9: func (c *Client) Auth() *auth.Client {
auth.go#L16: func (c *Client) QR() qrlogin.QR {
auth_lost.go#L85: func (c *Client) waitAuthLost(ctx context.Context) error {
auth_lost.go#L206: func (c *Client) observeAuth(input bin.Encoder, output bin.Decoder, err error) {
auth_lost.go#L225: func (c *Client) authLostDetected(err error) {
auth_lost.go#L289: func (c *Client) reportAuthLost(err error) {
auth_lost.go#L309: func (c *Client) markAuthorized() {
bot.go#L12: func RunUntilCanceled(ctx context.Context, client *Client) error {
bot.go#L25: setup func(ctx context.Context, client *Client) error,
bot.go#L26: cb func(ctx context.Context, client *Client) error,
builder.go#L85: func ClientFromEnvironment(opts Options) (*Client, error) {
builder.go#L146: func TestClient(ctx context.Context, opts Options, cb func(ctx context.Context, client *Client) error) error {
cdn.go#L131: func (c *Client) cachedCDNKeys() ([]exchange.PublicKey, bool, uint64) {
cdn.go#L138: func (c *Client) cachedCDNKeysForDC(dcID int) ([]exchange.PublicKey, bool) {
cdn.go#L145: func (c *Client) cdnConfigFetchContext(caller context.Context) context.Context {
cdn.go#L157: func (c *Client) loadCDNKeys(ctx context.Context) (fetchedCDNKeys, error) {
cdn.go#L189: func (c *Client) fetchCDNKeys(ctx context.Context) ([]exchange.PublicKey, error) {
cdn.go#L230: func (c *Client) refreshCDNKeys(ctx context.Context) ([]exchange.PublicKey, error) {
cdn.go#L261: func (c *Client) fetchCDNKeysForDC(ctx context.Context, dcID int) ([]exchange.PublicKey, error) {
cdn_conn_dead.go#L15: func (c *Client) handleCDNConnDead(dcID int, err error) {
cfg.go#L31: func (c *Client) Config() tg.Config {
cfg.go#L35: func (c *Client) fetchConfig(ctx context.Context) {
client.go#L59: type Client struct {
client.go#L242: func NewClient(appID int, appHash string, opt Options) *Client {
client.go#L249: client := &Client{
client.go#L349: func (c *Client) replaceConn(conn clientConn) {
client.go#L356: func (c *Client) init() {
client.go#L398: func (c *Client) ServerTimeOffset() time.Duration {
conn_builder.go#L18: client *Client
conn_builder.go#L29: func (c *Client) asHandler() manager.Handler {
conn_builder.go#L48: client *Client
conn_builder.go#L61: func (c *Client) asCDNHandler() manager.Handler {
conn_builder.go#L87: func (c *Client) dcList() dcs.List {
conn_builder.go#L96: func (c *Client) primaryDC(dc int) mtproto.Dialer {
conn_builder.go#L104: func (c *Client) createPrimaryConn(setup manager.SetupCallback) pool.Conn {
conn_builder.go#L116: func (c *Client) createConnWith(
connect.go#L23: func (c *Client) runUntilRestart(ctx context.Context, dc *int) error {
connect.go#L130: func (c *Client) isPermanentError(err error) bool {
connect.go#L148: func (c *Client) reconnectUntilClosed(ctx context.Context) error {
connect.go#L193: func (c *Client) onReady() {
connect.go#L203: func (c *Client) resetReady() {
connect.go#L218: func (c *Client) Run(ctx context.Context, f func(ctx context.Context) error) (err error) {
connect.go#L235: func (c *Client) run(ctx context.Context, f func(ctx context.Context) error) (err error) {
connection_state.go#L94: func (c *Client) notifyConnectionState(s ConnectionState, dc int) {
connection_state.go#L110: func (c *Client) notifyConnDead(e ConnDeadEvent) {
dc_transfer.go#L11: func (c *Client) dcTransferSetup(dcID int) manager.SetupCallback {
download.go#L21: client *Client
download.go#L82: client *Client
download.go#L110: func (c *Client) Downloader() *downloader.Downloader {
download.go#L132: func (c *Client) homeDownloader() *downloader.Downloader {
download.go#L145: func (c *Client) DownloadScheduler(dc int) *downloader.Scheduler {
download.go#L229: func (c *Client) CDNProvider() downloader.CDNProvider {
download.go#L234: func (c *Client) Download(location tg.InputFileLocationClass) *downloader.Builder {
download.go#L246: func (c *Client) DownloadVia(invoker tg.Invoker, location tg.InputFileLocationClass) *downloader.Builder {
download.go#L251: func (c *Client) DownloadWeb(location tg.InputWebFileLocationClass) *downloader.Builder {
download.go#L256: func (c *Client) DownloadWebVia(invoker tg.Invoker, location tg.InputWebFileLocationClass) *downloader.Builder {
file_dc.go#L34: func (c *Client) FileDC(ctx context.Context, dc int) (tg.Invoker, error) {
file_dc.go#L61: client *Client
handle_updates.go#L15: func (c *Client) updateInterceptor(updates ...tg.UpdateClass) {
handle_updates.go#L26: func (c *Client) processUpdates(updates tg.UpdatesClass) error {
handle_updates.go#L51: func (c *Client) handleUpdates(b *bin.Buffer) error {
invoke.go#L25: func (c *Client) API() *tg.Client {
invoke.go#L31: func (c *Client) Invoke(ctx context.Context, input bin.Encoder, output bin.Decoder) error {
invoke.go#L63: client *Client
invoke.go#L77: func (c *Client) invokeDirect(ctx context.Context, input bin.Encoder, output bin.Decoder) error {
invoke.go#L121: func (c *Client) invokeConn(ctx context.Context, input bin.Encoder, output bin.Decoder) error {
invoke.go#L213: func (c *Client) restartSuspect(ctx context.Context, connChanged <-chan struct{}) error {
invoke.go#L242: func (c *Client) withResponseDeadline(
lifecycle.go#L126: func (c *Client) Start(ctx context.Context, opts ...StartOption) error {
lifecycle.go#L229: func (c *Client) finishStart(err error, startFailed bool) {
lifecycle.go#L245: func (c *Client) Stop() {
lifecycle.go#L285: func (c *Client) Shutdown(ctx context.Context) error {
lifecycle.go#L316: func (c *Client) Close() error {
lifecycle.go#L323: func (c *Client) Done() <-chan struct{} {
lifecycle.go#L338: func (c *Client) Wait(ctx context.Context) error {
lifecycle.go#L354: func Connect(ctx context.Context, appID int, appHash string, opt Options, so ...StartOption) (*Client, error) {
logout.go#L40: func (c *Client) LogOut(ctx context.Context) (*tg.AuthLoggedOut, error) {
logout.go#L62: func (c *Client) logOutGuests(ctx context.Context) {
logout.go#L119: func (c *Client) wipeSession(ctx context.Context) error {
metrics.go#L159: func (c *Client) meters() *clientMetrics {
metrics.go#L199: func (c *Client) now() time.Time {
metrics.go#L208: func (c *Client) registerPoolsGauge() func() {
migrate_to_dc.go#L17: func (c *Client) ensureRestart(ctx context.Context, reason string) error {
migrate_to_dc.go#L39: func (c *Client) invokeMigrate(ctx context.Context, dcID int, input bin.Encoder, output bin.Decoder) error {
migrate_to_dc.go#L67: func (c *Client) migrateToDc(ctx context.Context, dcID int) error {
migrate_to_dc.go#L79: func (c *Client) MigrateTo(ctx context.Context, dcID int) error {
pfs.go#L14: func (c *Client) handlePrimaryConnDead(err error) {
pfs.go#L36: func (c *Client) dropKeyLocked(dc int, s *pool.SyncSession) {
pfs.go#L44: func (c *Client) handleDCConnDead(dcID int, err error) {
ping.go#L8: func (c *Client) Ping(ctx context.Context) error {
pool.go#L26: func (c *Client) createPool(dc int, max int64, creator func() pool.Conn) (*pool.DC, error) {
pool.go#L42: func (c *Client) Pool(max int64) (CloseInvoker, error) {
pool.go#L54: func (c *Client) primaryPool(dc int, max int64, dialer mtproto.Dialer) (*pool.DC, error) {
pool.go#L63: func (c *Client) primaryConn(dialer mtproto.Dialer) pool.Conn {
pool.go#L73: func (c *Client) dc(
pool.go#L243: func (c *Client) DC(ctx context.Context, dc int, max int64) (CloseInvoker, error) {
pool.go#L249: func (c *Client) MediaOnly(ctx context.Context, dc int, max int64) (CloseInvoker, error) {
pool.go#L257: func (c *Client) CDN(ctx context.Context, dc int, max int64) (CloseInvoker, error) {
rand_int64.go#L8: func (c *Client) RandInt64() (int64, error) {
self.go#L14: func (c *Client) Self(ctx context.Context) (*tg.User, error) {
send_message.go#L12: func (c *Client) SendMessage(ctx context.Context, req *tg.MessagesSendMessageRequest) error {
session.go#L19: func (c *Client) restoreConnection(ctx context.Context) error {
session.go#L78: func (c *Client) restoreDCKeys(ctx context.Context, data *session.Data) {
session.go#L103: func (c *Client) fillDCKeys(data *session.Data) {
session.go#L133: func (c *Client) updateStoredSession(ctx context.Context, f func(data *session.Data)) error {
session.go#L156: func (c *Client) dcAuthPendingFor(data pool.Session) bool {
session.go#L165: func (c *Client) ctxOrBackground() context.Context {
session.go#L174: func (c *Client) dcKeyAuthorized(dc int) bool {
session.go#L188: func (c *Client) setDCAuthorized(ctx context.Context, dc int, authorized bool) {
session.go#L221: func (c *Client) acquireSessionState(dc int) *mtproto.SessionState {
session.go#L240: func (c *Client) onPrimaryNewSession() {
session.go#L260: func (c *Client) SelfID() (id int64, bot bool, ok bool) {
session.go#L266: func (c *Client) setSelf(ctx context.Context, u *tg.User) {
session.go#L283: func (c *Client) saveSession(cfg tg.Config, s mtproto.Session) error {
session.go#L339: func (c *Client) onSession(cfg tg.Config, s mtproto.Session) error {
session.go#L375: func (c *Client) onCDNSession(cfg tg.Config, s mtproto.Session) error {
session.go#L384: func (c *Client) isDroppedKey(data pool.Session) bool {
session.go#L394: func (c *Client) storeDCSess(target map[int]*pool.SyncSession, data pool.Session) {
sub_conns.go#L81: func (c *Client) invokeSub(ctx context.Context, dc int, input bin.Encoder, output bin.Decoder) error {
sub_conns.go#L91: func (c *Client) invokeCachedDC(
sub_conns.go#L131: func (c *Client) cachedDC(ctx context.Context, cache *dcPoolCache, dc int) (CloseInvoker, error) {
sub_conns.go#L157: func (c *Client) createCachedDC(ctx context.Context, cache *dcPoolCache, dc int, call *subConnCall) {
tdlib_json.go#L71: func (c *Client) InvokeRawJSON(ctx context.Context, jsonRequest string) (jsonResponse string, err error) {
transfer.go#L11: func (c *Client) exportAuth(ctx context.Context, dcID int) (*tg.AuthExportedAuthorization, error) {
transfer.go#L26: type AuthTransferHandler func(ctx context.Context, client *Client, fn func(context.Context) error) error
transfer.go#L28: func noopOnTransfer(ctx context.Context, _ *Client, fn func(context.Context) error) error {
transfer.go#L34: func (c *Client) transfer(ctx context.Context, to *tg.Client, dc int) (tg.AuthAuthorizationClass, error) {
 |
The pages are generated with Golds v0.8.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |