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 CatchResponseErrorCode(data []byte) error
- func IsPacketEncrypted(data []byte) bool
- func MessageRequireToAck(msg serialize.TL) bool
- func RpcErrorToNative(r *serialize.RpcError) error
- func SaveSession(s *Session, path string) error
- func TryExpandError(errStr string) (nativeErrorName string, additionalData interface{})
- 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) GetLastSeqNo() int32
- func (m *MTProto) GetServerSalt() int64
- func (m *MTProto) GetSessionID() int64
- func (m *MTProto) LoadSession() (err error)
- func (m *MTProto) MakeRequest(msg serialize.TL) (serialize.TL, error)
- func (m *MTProto) MakeRequestAsSlice(msg serialize.TL, as reflect.Type) (serialize.TL, error)
- func (m *MTProto) Ping(pingID int64) (*serialize.Pong, error)
- func (m *MTProto) ReqDHParams(nonce, serverNonce *serialize.Int128, p, q []byte, publicKeyFingerprint int64, ...) (serialize.ServerDHParams, error)
- func (m *MTProto) ReqPQ(nonce *serialize.Int128) (*serialize.ResPQ, error)
- func (m *MTProto) SaveSession() (err error)
- func (m *MTProto) SetAuthKey(key []byte)
- func (m *MTProto) SetClientDHParams(nonce, serverNonce *serialize.Int128, encryptedData []byte) (serialize.SetClientDHParamsAnswer, error)
- func (m *MTProto) SetDCStorages(in map[int]string)
- func (m *MTProto) Stop() error
- type PingParams
- type ReqDHParamsParams
- type ReqPQParams
- type Session
- type SetClientDHParamsParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CatchResponseErrorCode ¶
func IsPacketEncrypted ¶
func MessageRequireToAck ¶
func RpcErrorToNative ¶
func SaveSession ¶
func TryExpandError ¶
Types ¶
type BadMsgError ¶
type BadMsgError struct {
*serialize.BadMsgNotification
Description string
}
func BadMsgErrorFromNative ¶
func BadMsgErrorFromNative(in *serialize.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 interface{} // 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 interface{})
// если задан, то в канал пишутся ошибки
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 ¶
func (*MTProto) GetSessionID ¶
получает текущий идентификатор сессии
func (*MTProto) LoadSession ¶
func (*MTProto) MakeRequestAsSlice ¶
func (*MTProto) ReqDHParams ¶
func (*MTProto) SaveSession ¶
func (*MTProto) SetAuthKey ¶
func (*MTProto) SetClientDHParams ¶
func (*MTProto) SetDCStorages ¶
type PingParams ¶
type PingParams struct {
PingID int64
}
func (*PingParams) CRC ¶
func (_ *PingParams) CRC() uint32
func (*PingParams) DecodeFrom ¶
func (t *PingParams) DecodeFrom(d *serialize.Decoder)
func (*PingParams) Encode ¶
func (t *PingParams) Encode() []byte
type ReqDHParamsParams ¶
type ReqDHParamsParams struct {
Nonce *serialize.Int128
ServerNonce *serialize.Int128
P []byte
Q []byte
PublicKeyFingerprint int64
EncryptedData []byte
}
func (*ReqDHParamsParams) CRC ¶
func (_ *ReqDHParamsParams) CRC() uint32
func (*ReqDHParamsParams) DecodeFrom ¶
func (t *ReqDHParamsParams) DecodeFrom(d *serialize.Decoder)
func (*ReqDHParamsParams) Encode ¶
func (t *ReqDHParamsParams) Encode() []byte
type ReqPQParams ¶
func (*ReqPQParams) CRC ¶
func (_ *ReqPQParams) CRC() uint32
func (*ReqPQParams) DecodeFrom ¶
func (t *ReqPQParams) DecodeFrom(d *serialize.Decoder)
func (*ReqPQParams) Encode ¶
func (t *ReqPQParams) Encode() []byte
type Session ¶
func LoadSession ¶
type SetClientDHParamsParams ¶
type SetClientDHParamsParams struct {
Nonce *serialize.Int128
ServerNonce *serialize.Int128
EncryptedData []byte
}
func (*SetClientDHParamsParams) CRC ¶
func (_ *SetClientDHParamsParams) CRC() uint32
func (*SetClientDHParamsParams) DecodeFrom ¶
func (t *SetClientDHParamsParams) DecodeFrom(d *serialize.Decoder)
func (*SetClientDHParamsParams) Encode ¶
func (t *SetClientDHParamsParams) Encode() []byte
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
encoding
|
|
|
examples
|
|
|
auth
command
|
|
|
get_channel_users
command
|
|
|
get_chats
command
|
|
|
get_configs_for_calls
command
|
|
|
get_saved_contacts
command
|
|
|
get_self
command
|
|
|
internal
|
|
|
init.go нужен для того что бы иметь один единственный инит в пакете, и при этом не заставляет его генерироваться через generate-tl-files
|
init.go нужен для того что бы иметь один единственный инит в пакете, и при этом не заставляет его генерироваться через generate-tl-files |
Click to show internal directories.
Click to hide internal directories.
Full-native implementation of MTProto protocol on Golang!
All code, from sending requests to encryption serialization is written on pure golang. You don't need to fetch any additional dependencies.
Lib is supports all the API and MTProto features, including video calls and post comments. You can create additional pull request to push api updates!
All changes in TDLib and Android client are monitoring to get the latest features and changes in TL schemas. New methods are creates by adding new lines into TL schema and updating generated code!
No more SQLite databases and caching unnecessary files, that you don't need. Also you can control how sessions are stored, auth process and literally everything that you need!
You can use more than 10 accounts at same time! xelaj/MTProto doesn't create huge overhead in memory or cpu consumption as TDLib. Thanks for that, you can create huge number of connection instances and don't worry about memory overload!