Source File
tl_gzip_packed_gen.go
Belonging Package
github.com/gotd/td/internal/mt
// Code generated by gotdgen, DO NOT EDIT.
package mt
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{}
)
// GzipPacked represents TL type `gzip_packed#3072cfa1`.
type GzipPacked struct {
// PackedData field of GzipPacked.
PackedData []byte
}
// GzipPackedTypeID is TL type id of GzipPacked.
const GzipPackedTypeID = 0x3072cfa1
// Ensuring interfaces in compile-time for GzipPacked.
var (
_ bin.Encoder = &GzipPacked{}
_ bin.Decoder = &GzipPacked{}
_ bin.BareEncoder = &GzipPacked{}
_ bin.BareDecoder = &GzipPacked{}
)
func ( *GzipPacked) () bool {
if == nil {
return true
}
if !(.PackedData == nil) {
return false
}
return true
}
// String implements fmt.Stringer.
func ( *GzipPacked) () string {
if == nil {
return "GzipPacked(nil)"
}
type GzipPacked
return fmt.Sprintf("GzipPacked%+v", (*))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*GzipPacked) () uint32 {
return GzipPackedTypeID
}
// TypeName returns name of type in TL schema.
func (*GzipPacked) () string {
return "gzip_packed"
}
// TypeInfo returns info about TL type.
func ( *GzipPacked) () tdp.Type {
:= tdp.Type{
Name: "gzip_packed",
ID: GzipPackedTypeID,
}
if == nil {
.Null = true
return
}
.Fields = []tdp.Field{
{
Name: "PackedData",
SchemaName: "packed_data",
},
}
return
}
// Encode implements bin.Encoder.
func ( *GzipPacked) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode gzip_packed#3072cfa1 as nil")
}
.PutID(GzipPackedTypeID)
return .EncodeBare()
}
// EncodeBare implements bin.BareEncoder.
func ( *GzipPacked) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode gzip_packed#3072cfa1 as nil")
}
.PutBytes(.PackedData)
return nil
}
// Decode implements bin.Decoder.
func ( *GzipPacked) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode gzip_packed#3072cfa1 to nil")
}
if := .ConsumeID(GzipPackedTypeID); != nil {
return fmt.Errorf("unable to decode gzip_packed#3072cfa1: %w", )
}
return .DecodeBare()
}
// DecodeBare implements bin.BareDecoder.
func ( *GzipPacked) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode gzip_packed#3072cfa1 to nil")
}
{
, := .Bytes()
if != nil {
return fmt.Errorf("unable to decode gzip_packed#3072cfa1: field packed_data: %w", )
}
.PackedData =
}
return nil
}
// GetPackedData returns value of PackedData field.
func ( *GzipPacked) () ( []byte) {
if == nil {
return
}
return .PackedData
}
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. |