Source File
connection_state.go
Belonging Package
github.com/gotd/td/telegram
package telegram// ConnectionState represents the state of the primary connection.//// See Options.OnConnectionState.type ConnectionState intconst (// ConnectionStateConnecting means that client is establishing the primary// connection (initial connect or reconnect after failure).ConnectionStateConnecting ConnectionState = iota// ConnectionStateReady means that the primary connection is initialized// and ready to send requests.ConnectionStateReady// ConnectionStateDisconnected means that the primary connection is dead.// Client will reconnect automatically, transitioning to// ConnectionStateConnecting.ConnectionStateDisconnected)// String implements fmt.Stringer.func ( ConnectionState) () string {switch {case ConnectionStateConnecting:return "connecting"case ConnectionStateReady:return "ready"case ConnectionStateDisconnected:return "disconnected"default:return "unknown"}}// notifyConnectionState calls OnConnectionState callback, if set.func ( *Client) ( ConnectionState) {if .onConnectionState != nil {.onConnectionState()}}
![]() |
The pages are generated with Golds v0.8.4. (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. |