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 ClientDHInnerData struct {
Nonce bin .Int128
ServerNonce bin .Int128
RetryID int64
GB []byte
}
const ClientDHInnerDataTypeID = 0x6643b654
var (
_ bin .Encoder = &ClientDHInnerData {}
_ bin .Decoder = &ClientDHInnerData {}
_ bin .BareEncoder = &ClientDHInnerData {}
_ bin .BareDecoder = &ClientDHInnerData {}
)
func (c *ClientDHInnerData ) Zero () bool {
if c == nil {
return true
}
if !(c .Nonce == bin .Int128 {}) {
return false
}
if !(c .ServerNonce == bin .Int128 {}) {
return false
}
if !(c .RetryID == 0 ) {
return false
}
if !(c .GB == nil ) {
return false
}
return true
}
func (c *ClientDHInnerData ) String () string {
if c == nil {
return "ClientDHInnerData(nil)"
}
type Alias ClientDHInnerData
return fmt .Sprintf ("ClientDHInnerData%+v" , Alias (*c ))
}
func (*ClientDHInnerData ) TypeID () uint32 {
return ClientDHInnerDataTypeID
}
func (*ClientDHInnerData ) TypeName () string {
return "client_DH_inner_data"
}
func (c *ClientDHInnerData ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "client_DH_inner_data" ,
ID : ClientDHInnerDataTypeID ,
}
if c == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Nonce" ,
SchemaName : "nonce" ,
},
{
Name : "ServerNonce" ,
SchemaName : "server_nonce" ,
},
{
Name : "RetryID" ,
SchemaName : "retry_id" ,
},
{
Name : "GB" ,
SchemaName : "g_b" ,
},
}
return typ
}
func (c *ClientDHInnerData ) Encode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode client_DH_inner_data#6643b654 as nil" )
}
b .PutID (ClientDHInnerDataTypeID )
return c .EncodeBare (b )
}
func (c *ClientDHInnerData ) EncodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't encode client_DH_inner_data#6643b654 as nil" )
}
b .PutInt128 (c .Nonce )
b .PutInt128 (c .ServerNonce )
b .PutLong (c .RetryID )
b .PutBytes (c .GB )
return nil
}
func (c *ClientDHInnerData ) Decode (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode client_DH_inner_data#6643b654 to nil" )
}
if err := b .ConsumeID (ClientDHInnerDataTypeID ); err != nil {
return fmt .Errorf ("unable to decode client_DH_inner_data#6643b654: %w" , err )
}
return c .DecodeBare (b )
}
func (c *ClientDHInnerData ) DecodeBare (b *bin .Buffer ) error {
if c == nil {
return fmt .Errorf ("can't decode client_DH_inner_data#6643b654 to nil" )
}
{
value , err := b .Int128 ()
if err != nil {
return fmt .Errorf ("unable to decode client_DH_inner_data#6643b654: field nonce: %w" , err )
}
c .Nonce = value
}
{
value , err := b .Int128 ()
if err != nil {
return fmt .Errorf ("unable to decode client_DH_inner_data#6643b654: field server_nonce: %w" , err )
}
c .ServerNonce = value
}
{
value , err := b .Long ()
if err != nil {
return fmt .Errorf ("unable to decode client_DH_inner_data#6643b654: field retry_id: %w" , err )
}
c .RetryID = value
}
{
value , err := b .Bytes ()
if err != nil {
return fmt .Errorf ("unable to decode client_DH_inner_data#6643b654: field g_b: %w" , err )
}
c .GB = value
}
return nil
}
func (c *ClientDHInnerData ) GetNonce () (value bin .Int128 ) {
if c == nil {
return
}
return c .Nonce
}
func (c *ClientDHInnerData ) GetServerNonce () (value bin .Int128 ) {
if c == nil {
return
}
return c .ServerNonce
}
func (c *ClientDHInnerData ) GetRetryID () (value int64 ) {
if c == nil {
return
}
return c .RetryID
}
func (c *ClientDHInnerData ) GetGB () (value []byte ) {
if c == nil {
return
}
return c .GB
}
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 .