Versions in this module Expand all Collapse all v0 v0.2.1 Jun 20, 2026 v0.2.0 May 21, 2026 v0.1.0 May 2, 2026 Changes in this version + const IDBoolFalse + const IDBoolTrue + const IDClientAuthorizationWithProxyFailed + const IDClientAuthorizationWithProxySuccess + const IDClientAuthorizeWithProxyLong + const IDClientAuthorizeWithProxyShort + const IDClientConnectToProxy + const IDClientConnectedToProxy + const IDClientGetWorkerTypesV2 + const IDClientParams + const IDClientPaymentStatus + const IDClientProxyConnectionAuthLong + const IDClientProxyConnectionAuthShort + const IDClientQueryAnswer + const IDClientQueryAnswerError + const IDClientQueryAnswerErrorEx + const IDClientQueryAnswerEx + const IDClientQueryAnswerPart + const IDClientQueryAnswerPartError + const IDClientQueryAnswerPartEx + const IDClientQueryFinalInfo + const IDClientRefund + const IDClientRefundRejected + const IDClientRequestRefund + const IDClientRunQueryEx + const IDClientUpdatePaymentStatus + const IDClientWorkerInstanceV2 + const IDClientWorkerTypeV2 + const IDClientWorkerTypesV2 + const IDProxyParams + const IDProxySignedPayment + const IDProxySignedPaymentEmpty + const IDTokensUsed + const IDWorkerParams + const MaxFrameSize + const MinFrameSize + var ErrInvalidBool = errors.New("tl: invalid bool constructor id") + var ErrInvalidLength = errors.New("tl: invalid length prefix") + var ErrShortBuffer = errors.New("tl: short buffer") + var ErrUnknownConstructor = errors.New("tl: unknown constructor id") + var IDHTTPHeader = ConstructorID("http.header name:string value:string = http.Header") + var IDHTTPRequest = uint32(0x47492de5) + var IDHTTPResponse = uint32(0x1cd0c42b) + var IDTCPConnect = crc32.ChecksumIEEE([]byte("tcp.connect id:long = tcp.Packet")) + var IDTCPConnected = crc32.ChecksumIEEE([]byte("tcp.connected id:long = tcp.Packet")) + var IDTCPPacket = crc32.ChecksumIEEE([]byte("tcp.packet data:bytes = tcp.Packet")) + var IDTCPPing = crc32.ChecksumIEEE([]byte("tcp.ping id:long = tcp.Packet")) + var IDTCPPong = crc32.ChecksumIEEE([]byte("tcp.pong id:long = tcp.Packet")) + var IDTCPQuery = crc32.ChecksumIEEE([]byte("tcp.query id:long data:bytes = tcp.Packet")) + var IDTCPQueryAnswer = crc32.ChecksumIEEE([]byte("tcp.queryAnswer id:long data:bytes = tcp.Packet")) + var IDTCPQueryError = crc32.ChecksumIEEE([]byte("tcp.queryError id:long code:int message:string = tcp.Packet")) + func ConstructorID(signature string) uint32 + func EncodeTCPConnect(id int64) []byte + func EncodeTCPConnected(id int64) []byte + func EncodeTCPPacket(data []byte) []byte + func EncodeTCPPing(id int64) []byte + func EncodeTCPPong(id int64) []byte + func EncodeTCPQuery(queryID int64, data []byte) []byte + func IDStatus(id uint32) string + func ReadSimpleFrame(r io.Reader) ([]byte, error) + func WriteSimpleFrame(w io.Writer, payload []byte) error + type ClientAuthorizeWithProxyLong struct + func (c ClientAuthorizeWithProxyLong) Encode(w *Writer) + type ClientAuthorizeWithProxyShort struct + Data []byte + func (c ClientAuthorizeWithProxyShort) Encode(w *Writer) + type ClientConnectToProxy struct + MinConfigVersion int32 + Params ClientParams + func (c ClientConnectToProxy) Encode(w *Writer) + type ClientParams struct + ClientOwnerAddr string + Flags uint32 + IsTest bool + MaxProtoVersion int32 + MinProtoVersion int32 + func DecodeClientParamsBody(r *Reader) (ClientParams, error) + func (p ClientParams) Encode(w *Writer, boxed bool) + func (p ClientParams) HasIsTest() bool + func (p ClientParams) HasProtoVersion() bool + type DecodedTCPPacket struct + Data []byte + ErrCode int32 + ErrMsg string + ID int64 + Kind TCPPacketKind + func DecodeTCPPacket(payload []byte) (*DecodedTCPPacket, error) + type FramedConn struct + Strict bool + func NewFramedConn(rw io.ReadWriter) *FramedConn + func (c *FramedConn) InSeqno() int32 + func (c *FramedConn) OutSeqno() int32 + func (c *FramedConn) ReadFrame() ([]byte, error) + func (c *FramedConn) WriteFrame(payload []byte) error + type ProxyParams struct + Flags uint32 + IsTest bool + OwnerAddress string + ProtoVersion int32 + PublicKey [32]byte + SCAddress string + func DecodeProxyParamsBody(r *Reader) (ProxyParams, error) + func (p ProxyParams) Encode(w *Writer, boxed bool) + func (p ProxyParams) HasIsTest() bool + func (p ProxyParams) HasProtoVersion() bool + type Reader struct + func NewReader(buf []byte) *Reader + func (r *Reader) EOF() bool + func (r *Reader) Pos() int + func (r *Reader) ReadBool() (bool, error) + func (r *Reader) ReadBytes() ([]byte, error) + func (r *Reader) ReadDouble() (float64, error) + func (r *Reader) ReadFlags() (uint32, error) + func (r *Reader) ReadInt128() ([16]byte, error) + func (r *Reader) ReadInt256() ([32]byte, error) + func (r *Reader) ReadInt32() (int32, error) + func (r *Reader) ReadInt64() (int64, error) + func (r *Reader) ReadRaw(n int) ([]byte, error) + func (r *Reader) ReadString() (string, error) + func (r *Reader) ReadUint32() (uint32, error) + func (r *Reader) ReadUint64() (uint64, error) + func (r *Reader) ReadVectorBytes() ([][]byte, error) + func (r *Reader) ReadVectorInt256() ([][32]byte, error) + func (r *Reader) ReadVectorLen() (int, error) + func (r *Reader) ReadVectorString() ([]string, error) + func (r *Reader) Remaining() int + type TCPPacketKind int + const TCPKindConnect + const TCPKindConnected + const TCPKindPacket + const TCPKindPing + const TCPKindPong + const TCPKindQuery + const TCPKindQueryAnswer + const TCPKindQueryError + const TCPKindUnknown + type TokensUsed struct + CachedTokens int64 + CompletionTokens int64 + PromptTokens int64 + ReasoningTokens int64 + TotalTokens int64 + func DecodeTokensUsed(r *Reader) (TokensUsed, error) + func (t TokensUsed) Encode(w *Writer) + type Writer struct + func NewWriter() *Writer + func NewWriterCap(n int) *Writer + func (w *Writer) Bytes() []byte + func (w *Writer) Len() int + func (w *Writer) Reset() + func (w *Writer) WriteBool(v bool) + func (w *Writer) WriteBytes(b []byte) + func (w *Writer) WriteDouble(v float64) + func (w *Writer) WriteFlags(flags uint32) + func (w *Writer) WriteInt128(v [16]byte) + func (w *Writer) WriteInt256(v [32]byte) + func (w *Writer) WriteInt32(v int32) + func (w *Writer) WriteInt64(v int64) + func (w *Writer) WriteRaw(b []byte) + func (w *Writer) WriteString(s string) + func (w *Writer) WriteUint32(v uint32) + func (w *Writer) WriteUint64(v uint64) + func (w *Writer) WriteVectorBytes(items [][]byte) + func (w *Writer) WriteVectorInt256(items [][32]byte) + func (w *Writer) WriteVectorLen(n int) + func (w *Writer) WriteVectorString(items []string)