package mt
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
var (
_ = bin .Buffer {}
_ = context .Background ()
_ = fmt .Stringer (nil )
_ = strings .Builder {}
_ = errors .Is
_ = multierr .AppendInto
_ = sort .Ints
_ = tdp .Format
_ = tgerr .Error {}
_ = tdjson .Encoder {}
)
type MsgsAllInfo struct {
MsgIDs []int64
Info []byte
}
const MsgsAllInfoTypeID = 0x8cc0d131
var (
_ bin .Encoder = &MsgsAllInfo {}
_ bin .Decoder = &MsgsAllInfo {}
_ bin .BareEncoder = &MsgsAllInfo {}
_ bin .BareDecoder = &MsgsAllInfo {}
)
func (m *MsgsAllInfo ) Zero () bool {
if m == nil {
return true
}
if !(m .MsgIDs == nil ) {
return false
}
if !(m .Info == nil ) {
return false
}
return true
}
func (m *MsgsAllInfo ) String () string {
if m == nil {
return "MsgsAllInfo(nil)"
}
type Alias MsgsAllInfo
return fmt .Sprintf ("MsgsAllInfo%+v" , Alias (*m ))
}
func (*MsgsAllInfo ) TypeID () uint32 {
return MsgsAllInfoTypeID
}
func (*MsgsAllInfo ) TypeName () string {
return "msgs_all_info"
}
func (m *MsgsAllInfo ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "msgs_all_info" ,
ID : MsgsAllInfoTypeID ,
}
if m == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "MsgIDs" ,
SchemaName : "msg_ids" ,
},
{
Name : "Info" ,
SchemaName : "info" ,
},
}
return typ
}
func (m *MsgsAllInfo ) Encode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode msgs_all_info#8cc0d131 as nil" )
}
b .PutID (MsgsAllInfoTypeID )
return m .EncodeBare (b )
}
func (m *MsgsAllInfo ) EncodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't encode msgs_all_info#8cc0d131 as nil" )
}
b .PutVectorHeader (len (m .MsgIDs ))
for _ , v := range m .MsgIDs {
b .PutLong (v )
}
b .PutBytes (m .Info )
return nil
}
func (m *MsgsAllInfo ) Decode (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode msgs_all_info#8cc0d131 to nil" )
}
if err := b .ConsumeID (MsgsAllInfoTypeID ); err != nil {
return fmt .Errorf ("unable to decode msgs_all_info#8cc0d131: %w" , err )
}
return m .DecodeBare (b )
}
func (m *MsgsAllInfo ) DecodeBare (b *bin .Buffer ) error {
if m == nil {
return fmt .Errorf ("can't decode msgs_all_info#8cc0d131 to nil" )
}
{
headerLen , err := b .VectorHeader ()
if err != nil {
return fmt .Errorf ("unable to decode msgs_all_info#8cc0d131: field msg_ids: %w" , err )
}
if headerLen > 0 {
m .MsgIDs = make ([]int64 , 0 , headerLen %bin .PreallocateLimit )
}
for idx := 0 ; idx < headerLen ; idx ++ {
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode msgs_all_info#8cc0d131: field msg_ids: %w" , err )
}
m .MsgIDs = append (m .MsgIDs , value )
}
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode msgs_all_info#8cc0d131: field info: %w" , err )
}
m .Info = value
}
return nil
}
func (m *MsgsAllInfo ) GetMsgIDs () (value []int64 ) {
if m == nil {
return
}
return m .MsgIDs
}
func (m *MsgsAllInfo ) GetInfo () (value []byte ) {
if m == nil {
return
}
return m .Info
}
The pages are generated with Golds v0.6.7 . (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 @Go100and1 (reachable from the left QR code) to get the latest news of Golds .