Source File
tl_long_gen.go
Belonging Package
github.com/gotd/td/tg
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_ = context.Background()
_ = fmt.Stringer(nil)
_ = strings.Builder{}
_ = errors.Is
_ = multierr.AppendInto
_ = sort.Ints
_ = tdp.Format
_ = tgerr.Error{}
_ = tdjson.Encoder{}
)
// Long represents TL type `long#22076cba`.
//
// See https://core.telegram.org/constructor/long for reference.
type Long struct {
}
// LongTypeID is TL type id of Long.
const LongTypeID = 0x22076cba
// Ensuring interfaces in compile-time for Long.
var (
_ bin.Encoder = &Long{}
_ bin.Decoder = &Long{}
_ bin.BareEncoder = &Long{}
_ bin.BareDecoder = &Long{}
)
func ( *Long) () bool {
if == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func ( *Long) () string {
if == nil {
return "Long(nil)"
}
type Long
return fmt.Sprintf("Long%+v", (*))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*Long) () uint32 {
return LongTypeID
}
// TypeName returns name of type in TL schema.
func (*Long) () string {
return "long"
}
// TypeInfo returns info about TL type.
func ( *Long) () tdp.Type {
:= tdp.Type{
Name: "long",
ID: LongTypeID,
}
if == nil {
.Null = true
return
}
.Fields = []tdp.Field{}
return
}
// Encode implements bin.Encoder.
func ( *Long) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode long#22076cba as nil")
}
.PutID(LongTypeID)
return .EncodeBare()
}
// EncodeBare implements bin.BareEncoder.
func ( *Long) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode long#22076cba as nil")
}
return nil
}
// Decode implements bin.Decoder.
func ( *Long) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode long#22076cba to nil")
}
if := .ConsumeID(LongTypeID); != nil {
return fmt.Errorf("unable to decode long#22076cba: %w", )
}
return .DecodeBare()
}
// DecodeBare implements bin.BareDecoder.
func ( *Long) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode long#22076cba to nil")
}
return nil
}
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. |