meta

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Code generated by tl2gen; DO NOT EDIT.

Code generated by tl2gen; DO NOT EDIT.

Code generated by tl2gen; DO NOT EDIT.

Code generated by tl2gen; DO NOT EDIT.

Code generated by tl2gen; DO NOT EDIT.

Code generated by tl2gen; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTLName

func GetTLName(tag uint32, notFoundName string) string

for quick one-liners

func SchemaCommit

func SchemaCommit() string

func SchemaGenerator

func SchemaGenerator() string

func SchemaTimestamp

func SchemaTimestamp() uint32

func SchemaURL

func SchemaURL() string

func SetGlobalFactoryCreateForEnumElement

func SetGlobalFactoryCreateForEnumElement(name string)

Do not call directly, called by factory init code

func SetGlobalFactoryCreateForFunction

func SetGlobalFactoryCreateForFunction(name string, createFunction func() Function, createFunctionLong func() Function)

Do not call directly, called by factory init code

func SetGlobalFactoryCreateForFunctionBytes

func SetGlobalFactoryCreateForFunctionBytes(name string, createFunctionBytes func() Function, createFunctionLongBytes func() Function)

Do not call directly, called by factory init code

func SetGlobalFactoryCreateForObject

func SetGlobalFactoryCreateForObject(name string, createObject func() Object)

Do not call directly, called by factory init code

func SetGlobalFactoryCreateForObjectBytes

func SetGlobalFactoryCreateForObjectBytes(name string, createObjectBytes func() Object)

Do not call directly, called by factory init code

Types

type Function

type Function interface {
	Object

	// tctx is for options controlling transcoding short-long version during Long ID and legacyTypeNames->newTypeNames transition
	// pass empty basictl.JSONWriteContext{} if you do not know which options you need
	ReadResultTL1WriteResultJSON(tctx *basictl.JSONWriteContext, r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error
	ReadResultJSONWriteResultTL1(r []byte, w []byte) ([]byte, []byte, error)                                 // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error

}

type Object

type Object interface {
	TLName() string // returns type's TL name. For union, returns constructor name depending on actual union value
	TLTag() uint32  // returns type's TL tag. For union, returns constructor tag depending on actual union value
	String() string // returns type's representation for debugging (JSON for now)

	ReadTL1(w []byte) ([]byte, error)              // reads type's bare TL representation by consuming bytes from the start of w and returns remaining bytes, plus error
	ReadTL1Boxed(w []byte) ([]byte, error)         // same as Read, but reads/checks TLTag first (this method is general version of Write, use it only when you are working with interface)
	WriteTL1General(w []byte) ([]byte, error)      // same as Write, but has common signature (with error) for all objects, so can be called through interface
	WriteTL1BoxedGeneral(w []byte) ([]byte, error) // same as WriteBoxed, but has common signature (with error) for all objects, so can be called through interface

	MarshalJSON() ([]byte, error) // returns type's JSON representation, plus error
	UnmarshalJSON([]byte) error   // reads type's JSON representation

	ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error
	// like MarshalJSON, but appends to w and returns it
	// pass empty basictl.JSONWriteContext{} if you do not know which options you need
	WriteJSONGeneral(tctx *basictl.JSONWriteContext, w []byte) ([]byte, error)
}

We can create only types which have zero type arguments and zero nat arguments

type TLItem

type TLItem struct {
	// contains filtered or unexported fields
}

func FactoryItemByTLName

func FactoryItemByTLName(name string) *TLItem

func FactoryItemByTLTag

func FactoryItemByTLTag(tag uint32) *TLItem

func GetAllTLItems

func GetAllTLItems() []*TLItem

func (TLItem) AnnotationAny

func (item TLItem) AnnotationAny() bool

Annotations

func (TLItem) AnnotationInternal

func (item TLItem) AnnotationInternal() bool

func (TLItem) AnnotationKphp

func (item TLItem) AnnotationKphp() bool

func (TLItem) AnnotationRead

func (item TLItem) AnnotationRead() bool

func (TLItem) AnnotationReadwrite

func (item TLItem) AnnotationReadwrite() bool

func (TLItem) AnnotationWrite

func (item TLItem) AnnotationWrite() bool

func (TLItem) CreateFunction

func (item TLItem) CreateFunction() Function

func (TLItem) CreateFunctionBytes

func (item TLItem) CreateFunctionBytes() Function

used in TL generator tests only, do not use in product code

func (TLItem) CreateFunctionLong

func (item TLItem) CreateFunctionLong() Function

func (TLItem) CreateObject

func (item TLItem) CreateObject() Object

func (TLItem) CreateObjectBytes

func (item TLItem) CreateObjectBytes() Object

used in TL generator tests only, do not use in product code

func (TLItem) HasFunctionLong

func (item TLItem) HasFunctionLong() bool

For transcoding short-long version during Long ID transition

func (TLItem) HasTL1

func (item TLItem) HasTL1() bool

true for TL1-originated types

func (TLItem) HasTL2

func (item TLItem) HasTL2() bool

true for TL2-originated types and for TL1-originated types if in TL2 generation whitelist

func (TLItem) HasUnionTypesInArguments

func (item TLItem) HasUnionTypesInArguments() bool

func (TLItem) HasUnionTypesInResult

func (item TLItem) HasUnionTypesInResult() bool

func (TLItem) IsFunction

func (item TLItem) IsFunction() bool

func (*TLItem) MarshalJSON

func (item *TLItem) MarshalJSON() ([]byte, error)

func (*TLItem) Read

func (item *TLItem) Read(w []byte) ([]byte, error)

func (*TLItem) ReadBoxed

func (item *TLItem) ReadBoxed(w []byte) ([]byte, error)

func (*TLItem) ReadJSON

func (item *TLItem) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error

func (*TLItem) ReadTL1

func (item *TLItem) ReadTL1(w []byte) ([]byte, error)

func (*TLItem) ReadTL1Boxed

func (item *TLItem) ReadTL1Boxed(w []byte) ([]byte, error)

func (*TLItem) Reset

func (item *TLItem) Reset()

TLItem serves as a single type for all TL1 enum values

func (TLItem) String

func (item TLItem) String() string

func (TLItem) TLName

func (item TLItem) TLName() string

func (TLItem) TLTag

func (item TLItem) TLTag() uint32

func (*TLItem) UnmarshalJSON

func (item *TLItem) UnmarshalJSON(b []byte) error

func (*TLItem) WriteBoxedGeneral

func (item *TLItem) WriteBoxedGeneral(w []byte) ([]byte, error)

func (*TLItem) WriteGeneral

func (item *TLItem) WriteGeneral(w []byte) ([]byte, error)

func (*TLItem) WriteJSON

func (item *TLItem) WriteJSON(w []byte) []byte

func (*TLItem) WriteJSONGeneral

func (item *TLItem) WriteJSONGeneral(tctx *basictl.JSONWriteContext, w []byte) (_ []byte, err error)

func (*TLItem) WriteTL1BoxedGeneral

func (item *TLItem) WriteTL1BoxedGeneral(w []byte) ([]byte, error)

func (*TLItem) WriteTL1General

func (item *TLItem) WriteTL1General(w []byte) ([]byte, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL