Source File
tl_string_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{}
)
// String represents TL type `string#b5286e24`.
//
// See https://core.telegram.org/constructor/string for reference.
type String struct {
}
// StringTypeID is TL type id of String.
const StringTypeID = 0xb5286e24
// Ensuring interfaces in compile-time for String.
var (
_ bin.Encoder = &String{}
_ bin.Decoder = &String{}
_ bin.BareEncoder = &String{}
_ bin.BareDecoder = &String{}
)
func ( *String) () bool {
if == nil {
return true
}
return true
}
// String implements fmt.Stringer.
func ( *String) () string {
if == nil {
return "String(nil)"
}
type String
return fmt.Sprintf("String%+v", (*))
}
// TypeID returns type id in TL schema.
//
// See https://core.telegram.org/mtproto/TL-tl#remarks.
func (*String) () uint32 {
return StringTypeID
}
// TypeName returns name of type in TL schema.
func (*String) () string {
return "string"
}
// TypeInfo returns info about TL type.
func ( *String) () tdp.Type {
:= tdp.Type{
Name: "string",
ID: StringTypeID,
}
if == nil {
.Null = true
return
}
.Fields = []tdp.Field{}
return
}
// Encode implements bin.Encoder.
func ( *String) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode string#b5286e24 as nil")
}
.PutID(StringTypeID)
return .EncodeBare()
}
// EncodeBare implements bin.BareEncoder.
func ( *String) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't encode string#b5286e24 as nil")
}
return nil
}
// Decode implements bin.Decoder.
func ( *String) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode string#b5286e24 to nil")
}
if := .ConsumeID(StringTypeID); != nil {
return fmt.Errorf("unable to decode string#b5286e24: %w", )
}
return .DecodeBare()
}
// DecodeBare implements bin.BareDecoder.
func ( *String) ( *bin.Buffer) error {
if == nil {
return fmt.Errorf("can't decode string#b5286e24 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. |