objects

package
v0.0.0-...-ecf2efd Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 7 Imported by: 0

README

Common objects

This package is contains default MTProto objects for stuff like key generation, setting up session, etc.

Package generated by tlgen command, and manually reviewed, which means that we generated this files once and will not regenerate them again (only manual edits).

Instead, we are using this lib as gold standard of generating objects from TL schemes.

Current official TL schema of this package is located here.

This package currently fully implements this TL schema of MTProto protocol.

Documentation

Index

Constants

View Source
const (
	// CrcRpcResult публичная переменная, т.к. это специфический конструктор
	CrcRpcResult  = 0xf35c6d01 // nolint
	CrcGzipPacked = 0x3072cfa1
)

in some cases you are required

Variables

This section is empty.

Functions

This section is empty.

Types

type BadMsgNotification

type BadMsgNotification struct {
	BadMsgID    int64
	BadMsgSeqNo int32
	Code        int32
}

func (*BadMsgNotification) CRC

func (*BadMsgNotification) CRC() uint32

func (*BadMsgNotification) ImplementsBadMsgNotification

func (*BadMsgNotification) ImplementsBadMsgNotification()

type BadServerSalt

type BadServerSalt struct {
	BadMsgID    int64
	BadMsgSeqNo int32
	ErrorCode   int32
	NewSalt     int64
}

func (*BadServerSalt) CRC

func (*BadServerSalt) CRC() uint32

func (*BadServerSalt) ImplementsBadMsgNotification

func (*BadServerSalt) ImplementsBadMsgNotification()

type ClientDHInnerData

type ClientDHInnerData struct {
	Nonce       *tl.Int128
	ServerNonce *tl.Int128
	Retry       int64
	GB          []byte
}

func (*ClientDHInnerData) CRC

func (*ClientDHInnerData) CRC() uint32

type DHGenFail

type DHGenFail struct {
	Nonce         *tl.Int128
	ServerNonce   *tl.Int128
	NewNonceHash3 *tl.Int128
}

func (*DHGenFail) CRC

func (*DHGenFail) CRC() uint32

func (*DHGenFail) ImplementsSetClientDHParamsAnswer

func (*DHGenFail) ImplementsSetClientDHParamsAnswer()

type DHGenOk

type DHGenOk struct {
	Nonce         *tl.Int128
	ServerNonce   *tl.Int128
	NewNonceHash1 *tl.Int128
}

func (*DHGenOk) CRC

func (*DHGenOk) CRC() uint32

func (*DHGenOk) ImplementsSetClientDHParamsAnswer

func (t *DHGenOk) ImplementsSetClientDHParamsAnswer()

type DHGenRetry

type DHGenRetry struct {
	Nonce         *tl.Int128
	ServerNonce   *tl.Int128
	NewNonceHash2 *tl.Int128
}

func (*DHGenRetry) CRC

func (*DHGenRetry) CRC() uint32

func (*DHGenRetry) ImplementsSetClientDHParamsAnswer

func (*DHGenRetry) ImplementsSetClientDHParamsAnswer()

type FutureSalt

type FutureSalt struct {
	ValidSince int32
	ValidUntil int32
	Salt       int64
}

func (*FutureSalt) CRC

func (*FutureSalt) CRC() uint32

type FutureSalts

type FutureSalts struct {
	ReqMsgID int64
	Now      int32
	Salts    []*FutureSalt
}

func (*FutureSalts) CRC

func (*FutureSalts) CRC() uint32

type GzipPacked

type GzipPacked struct {
	Obj tl.Object
}

func (*GzipPacked) CRC

func (*GzipPacked) CRC() uint32

func (*GzipPacked) MarshalTL

func (*GzipPacked) MarshalTL(e *tl.Encoder) error

func (*GzipPacked) UnmarshalTL

func (t *GzipPacked) UnmarshalTL(d *tl.Decoder) error

type Message

type Message struct {
	MsgID int64
	SeqNo int32
	Bytes int32
	Body  tl.Object
}

type MessageContainer

type MessageContainer []*messages.Encrypted

! исключение из правил: это оказывается почти-вектор, т.к.

записан как `msg_container#73f1f8dc messages:vector<%Message> = MessageContainer;`
судя по всему, <%Type> означает, что может это неявный вектор???

! возможно разработчики в этот момент поехаи кукухой, я не знаю правда

func (*MessageContainer) CRC

func (*MessageContainer) CRC() uint32

func (*MessageContainer) MarshalTL

func (t *MessageContainer) MarshalTL(e *tl.Encoder) error

func (*MessageContainer) UnmarshalTL

func (t *MessageContainer) UnmarshalTL(d *tl.Decoder) error

type MsgCopy

type MsgCopy struct {
	OrigMessage *Message
}

func (*MsgCopy) CRC

func (*MsgCopy) CRC() uint32

type MsgResendReq

type MsgResendReq struct {
	MsgIDs []int64
}

func (*MsgResendReq) CRC

func (*MsgResendReq) CRC() uint32

type MsgsAck

type MsgsAck struct {
	MsgIDs []int64
}

func (*MsgsAck) CRC

func (*MsgsAck) CRC() uint32

type MsgsAllInfo

type MsgsAllInfo struct {
	MsgIDs []int64
	Info   []byte
}

func (*MsgsAllInfo) CRC

func (*MsgsAllInfo) CRC() uint32

type MsgsDetailedInfo

type MsgsDetailedInfo struct {
	MsgID       int64
	AnswerMsgID int64
	Bytes       int32
	Status      int32
}

func (*MsgsDetailedInfo) CRC

func (*MsgsDetailedInfo) CRC() uint32

type MsgsNewDetailedInfo

type MsgsNewDetailedInfo struct {
	AnswerMsgID int64
	Bytes       int32
	Status      int32
}

func (*MsgsNewDetailedInfo) CRC

func (*MsgsNewDetailedInfo) CRC() uint32

type MsgsStateInfo

type MsgsStateInfo struct {
	ReqMsgID int64
	Info     []byte
}

func (*MsgsStateInfo) CRC

func (*MsgsStateInfo) CRC() uint32

type MsgsStateReq

type MsgsStateReq struct {
	MsgIDs []int64
}

func (*MsgsStateReq) CRC

func (*MsgsStateReq) CRC() uint32

type NewSessionCreated

type NewSessionCreated struct {
	FirstMsgID int64
	UniqueID   int64
	ServerSalt int64
}

func (*NewSessionCreated) CRC

func (*NewSessionCreated) CRC() uint32

type Null

type Null struct {
}

Null это пустой объект, который нужен для передачи в каналы TL с информацией, что ответа можно не ждать

func (*Null) CRC

func (*Null) CRC() uint32

type PQInnerData

type PQInnerData struct {
	Pq          []byte
	P           []byte
	Q           []byte
	Nonce       *tl.Int128
	ServerNonce *tl.Int128
	NewNonce    *tl.Int256
}

func (*PQInnerData) CRC

func (*PQInnerData) CRC() uint32

type PingParams

type PingParams struct {
	PingID int64
}

func (*PingParams) CRC

func (*PingParams) CRC() uint32

type Pong

type Pong struct {
	MsgID  int64
	PingID int64
}

func Ping

func Ping(m requester, pingID int64) (*Pong, error)

func (*Pong) CRC

func (*Pong) CRC() uint32

type ReqDHParamsParams

type ReqDHParamsParams struct {
	Nonce                *tl.Int128
	ServerNonce          *tl.Int128
	P                    []byte
	Q                    []byte
	PublicKeyFingerprint int64
	EncryptedData        []byte
}

func (*ReqDHParamsParams) CRC

func (*ReqDHParamsParams) CRC() uint32

type ReqPQParams

type ReqPQParams struct {
	Nonce *tl.Int128
}

func (*ReqPQParams) CRC

func (*ReqPQParams) CRC() uint32

type ResPQ

type ResPQ struct {
	Nonce        *tl.Int128
	ServerNonce  *tl.Int128
	Pq           []byte
	Fingerprints []int64
}

func ReqPQ

func ReqPQ(m requester, nonce *tl.Int128) (*ResPQ, error)

func (*ResPQ) CRC

func (*ResPQ) CRC() uint32

type RpcAnswerDropped

type RpcAnswerDropped struct {
	MsgID int64
	SewNo int32
	Bytes int32
}

func (*RpcAnswerDropped) CRC

func (*RpcAnswerDropped) CRC() uint32

func (*RpcAnswerDropped) ImplementsRpcDropAnswer

func (*RpcAnswerDropped) ImplementsRpcDropAnswer()

type RpcAnswerDroppedRunning

type RpcAnswerDroppedRunning null

func (*RpcAnswerDroppedRunning) CRC

func (*RpcAnswerDroppedRunning) ImplementsRpcDropAnswer

func (*RpcAnswerDroppedRunning) ImplementsRpcDropAnswer()

type RpcAnswerUnknown

type RpcAnswerUnknown null

func (*RpcAnswerUnknown) CRC

func (*RpcAnswerUnknown) CRC() uint32

func (*RpcAnswerUnknown) ImplementsRpcDropAnswer

func (*RpcAnswerUnknown) ImplementsRpcDropAnswer()

type RpcDropAnswer

type RpcDropAnswer interface {
	tl.Object
	ImplementsRpcDropAnswer()
}

type RpcError

type RpcError struct {
	ErrorCode    int32
	ErrorMessage string
}

func (*RpcError) CRC

func (*RpcError) CRC() uint32

type RpcResult

type RpcResult struct {
	ReqMsgID int64
	Obj      tl.Object
}

func (*RpcResult) CRC

func (*RpcResult) CRC() uint32

type ServerDHInnerData

type ServerDHInnerData struct {
	Nonce       *tl.Int128
	ServerNonce *tl.Int128
	G           int32
	DhPrime     []byte
	GA          []byte
	ServerTime  int32
}

func (*ServerDHInnerData) CRC

func (*ServerDHInnerData) CRC() uint32

type ServerDHParams

type ServerDHParams interface {
	tl.Object
	ImplementsServerDHParams()
}

func ReqDHParams

func ReqDHParams(
	m requester,
	nonce, serverNonce *tl.Int128, p, q []byte, publicKeyFingerprint int64, encryptedData []byte,
) (ServerDHParams, error)

type ServerDHParamsFail

type ServerDHParamsFail struct {
	Nonce        *tl.Int128
	ServerNonce  *tl.Int128
	NewNonceHash *tl.Int128
}

func (*ServerDHParamsFail) CRC

func (*ServerDHParamsFail) CRC() uint32

func (*ServerDHParamsFail) ImplementsServerDHParams

func (*ServerDHParamsFail) ImplementsServerDHParams()

type ServerDHParamsOk

type ServerDHParamsOk struct {
	Nonce           *tl.Int128
	ServerNonce     *tl.Int128
	EncryptedAnswer []byte
}

func (*ServerDHParamsOk) CRC

func (*ServerDHParamsOk) CRC() uint32

func (*ServerDHParamsOk) ImplementsServerDHParams

func (*ServerDHParamsOk) ImplementsServerDHParams()

type SetClientDHParamsAnswer

type SetClientDHParamsAnswer interface {
	tl.Object
	ImplementsSetClientDHParamsAnswer()
}

func SetClientDHParams

func SetClientDHParams(m requester, nonce, serverNonce *tl.Int128, encryptedData []byte) (SetClientDHParamsAnswer, error)

type SetClientDHParamsParams

type SetClientDHParamsParams struct {
	Nonce         *tl.Int128
	ServerNonce   *tl.Int128
	EncryptedData []byte
}

func (*SetClientDHParamsParams) CRC

Jump to

Keyboard shortcuts

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