Documentation ¶
Overview ¶
also why gocritic detects false positive, but if i write explanation, golangci-lint throws error that description expected as lintrer??? //TODO nolint: lll
Index ¶
- func CloseOnCancel(ctx context.Context, c io.Closer)
- func MessageRequireToAck(msg tl.Object) bool
- func RpcErrorToNative(r *objects.RpcError) error
- func TryExpandError(errStr string) (nativeErrorName string, additionalData any)
- type BadMsgError
- type BadSystemMessageCode
- type Config
- type ErrResponseCode
- type MTProto
- func (m *MTProto) AddCustomServerRequestHandler(handler customHandlerFunc)
- func (m *MTProto) CreateConnection() error
- func (m *MTProto) Disconnect() error
- func (m *MTProto) GetAuthKey() []byte
- func (m *MTProto) GetSeqNo() int32
- func (m *MTProto) GetServerSalt() int64
- func (m *MTProto) GetSessionID() int64
- func (m *MTProto) LoadSession(s *session.Session)
- func (m *MTProto) MakeRequest(msg tl.Object) (any, error)
- func (m *MTProto) MakeRequestWithHintToDecoder(msg tl.Object, expectedTypes ...reflect.Type) (any, error)
- func (m *MTProto) Reconnect() error
- func (m *MTProto) SaveSession() (err error)
- func (m *MTProto) SetAuthKey(key []byte)
- func (m *MTProto) SetDCList(in map[int]string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MessageRequireToAck ¶
func RpcErrorToNative ¶
func TryExpandError ¶
Types ¶
type BadMsgError ¶
type BadMsgError struct { *objects.BadMsgNotification Description string }
func BadMsgErrorFromNative ¶
func BadMsgErrorFromNative(in *objects.BadMsgNotification) *BadMsgError
func (*BadMsgError) Error ¶
func (e *BadMsgError) Error() string
type BadSystemMessageCode ¶
type BadSystemMessageCode int32
const ( ErrBadMsgUnknown BadSystemMessageCode = 0 ErrBadMsgIdTooLow BadSystemMessageCode = 16 ErrBadMsgIdTooHigh BadSystemMessageCode = 17 ErrBadMsgIncorrectMsgIdBits BadSystemMessageCode = 18 ErrBadMsgWrongContainerMsgId BadSystemMessageCode = 19 // this must never happen ErrBadMsgMessageTooOld BadSystemMessageCode = 20 ErrBadMsgSeqNoTooLow BadSystemMessageCode = 32 ErrBadMsgSeqNoTooHigh BadSystemMessageCode = 33 ErrBadMsgSeqNoExpectedEven BadSystemMessageCode = 34 ErrBadMsgSeqNoExpectedOdd BadSystemMessageCode = 35 ErrBadMsgServerSaltIncorrect BadSystemMessageCode = 48 ErrBadMsgInvalidContainer BadSystemMessageCode = 64 )
type ErrResponseCode ¶
type ErrResponseCode struct { Code int Message string Description string AdditionalInfo any // some errors has additional data like timeout seconds, dc id etc. }
func (*ErrResponseCode) Error ¶
func (e *ErrResponseCode) Error() string
type MTProto ¶
type MTProto struct { //! DEPRECATED RecoverFunc используется только до того момента, когда из пакета будут убраны все паники RecoverFunc func(i any) // if set, all critical errors writing to this channel Warnings chan error // contains filtered or unexported fields }
func NewMTProto ¶
func (*MTProto) AddCustomServerRequestHandler ¶
func (m *MTProto) AddCustomServerRequestHandler(handler customHandlerFunc)
func (*MTProto) CreateConnection ¶
func (*MTProto) Disconnect ¶
Disconnect is closing current TCP connection and stopping all routines like pinging, reading etc.
func (*MTProto) GetAuthKey ¶
GetAuthKey returns decryption key of current session salt 🧐
func (*MTProto) GetServerSalt ¶
GetServerSalt returns current server salt 🧐
func (*MTProto) GetSessionID ¶
GetSessionID returns the current session id 🧐
func (*MTProto) LoadSession ¶
func (*MTProto) MakeRequestWithHintToDecoder ¶
func (*MTProto) SaveSession ¶
func (*MTProto) SetAuthKey ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
auth_bot
Example of using Mtproto for Telegram bot
|
Example of using Mtproto for Telegram bot |
internal
|
|
internal/srp
Пакет srp реализует Secure Random Password protocol, который телеграм использует для реализации 2FA.
|
Пакет srp реализует Secure Random Password protocol, который телеграм использует для реализации 2FA. |
Click to show internal directories.
Click to hide internal directories.