package tg
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 InputClientProxy struct {
Address string
Port int
}
const InputClientProxyTypeID = 0x75588b3f
var (
_ bin .Encoder = &InputClientProxy {}
_ bin .Decoder = &InputClientProxy {}
_ bin .BareEncoder = &InputClientProxy {}
_ bin .BareDecoder = &InputClientProxy {}
)
func (i *InputClientProxy ) Zero () bool {
if i == nil {
return true
}
if !(i .Address == "" ) {
return false
}
if !(i .Port == 0 ) {
return false
}
return true
}
func (i *InputClientProxy ) String () string {
if i == nil {
return "InputClientProxy(nil)"
}
type Alias InputClientProxy
return fmt .Sprintf ("InputClientProxy%+v" , Alias (*i ))
}
func (i *InputClientProxy ) FillFrom (from interface {
GetAddress () (value string )
GetPort () (value int )
}) {
i .Address = from .GetAddress ()
i .Port = from .GetPort ()
}
func (*InputClientProxy ) TypeID () uint32 {
return InputClientProxyTypeID
}
func (*InputClientProxy ) TypeName () string {
return "inputClientProxy"
}
func (i *InputClientProxy ) TypeInfo () tdp .Type {
typ := tdp .Type {
Name : "inputClientProxy" ,
ID : InputClientProxyTypeID ,
}
if i == nil {
typ .Null = true
return typ
}
typ .Fields = []tdp .Field {
{
Name : "Address" ,
SchemaName : "address" ,
},
{
Name : "Port" ,
SchemaName : "port" ,
},
}
return typ
}
func (i *InputClientProxy ) Encode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputClientProxy#75588b3f as nil" )
}
b .PutID (InputClientProxyTypeID )
return i .EncodeBare (b )
}
func (i *InputClientProxy ) EncodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't encode inputClientProxy#75588b3f as nil" )
}
b .PutString (i .Address )
b .PutInt (i .Port )
return nil
}
func (i *InputClientProxy ) Decode (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputClientProxy#75588b3f to nil" )
}
if err := b .ConsumeID (InputClientProxyTypeID ); err != nil {
return fmt .Errorf ("unable to decode inputClientProxy#75588b3f: %w" , err )
}
return i .DecodeBare (b )
}
func (i *InputClientProxy ) DecodeBare (b *bin .Buffer ) error {
if i == nil {
return fmt .Errorf ("can't decode inputClientProxy#75588b3f to nil" )
}
{
value , err := b .String ()
if err != nil {
return fmt .Errorf ("unable to decode inputClientProxy#75588b3f: field address: %w" , err )
}
i .Address = value
}
{
value , err := b .Int ()
if err != nil {
return fmt .Errorf ("unable to decode inputClientProxy#75588b3f: field port: %w" , err )
}
i .Port = value
}
return nil
}
func (i *InputClientProxy ) GetAddress () (value string ) {
if i == nil {
return
}
return i .Address
}
func (i *InputClientProxy ) GetPort () (value int ) {
if i == nil {
return
}
return i .Port
}
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 .