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 ¶
- func GetTLName(tag uint32, notFoundName string) string
- func SchemaCommit() string
- func SchemaGenerator() string
- func SchemaTimestamp() uint32
- func SchemaURL() string
- func SetGlobalFactoryCreateForEnumElement(name string)
- func SetGlobalFactoryCreateForFunction(name string, createFunction func() Function, ...)
- func SetGlobalFactoryCreateForFunctionBytes(name string, createFunctionBytes func() Function, ...)
- func SetGlobalFactoryCreateForObject(name string, createObject func() Object)
- func SetGlobalFactoryCreateForObjectBytes(name string, createObjectBytes func() Object)
- type Function
- type Object
- type TLItem
- func (item TLItem) AnnotationAny() bool
- func (item TLItem) AnnotationInternal() bool
- func (item TLItem) AnnotationKphp() bool
- func (item TLItem) AnnotationRead() bool
- func (item TLItem) AnnotationReadwrite() bool
- func (item TLItem) AnnotationWrite() bool
- func (item TLItem) CreateFunction() Function
- func (item TLItem) CreateFunctionBytes() Function
- func (item TLItem) CreateFunctionLong() Function
- func (item TLItem) CreateObject() Object
- func (item TLItem) CreateObjectBytes() Object
- func (item TLItem) HasFunctionLong() bool
- func (item TLItem) HasTL1() bool
- func (item TLItem) HasTL2() bool
- func (item TLItem) HasUnionTypesInArguments() bool
- func (item TLItem) HasUnionTypesInResult() bool
- func (item TLItem) IsFunction() bool
- func (item *TLItem) MarshalJSON() ([]byte, error)
- func (item *TLItem) Read(w []byte) ([]byte, error)
- func (item *TLItem) ReadBoxed(w []byte) ([]byte, error)
- func (item *TLItem) ReadJSON(legacyTypeNames bool, in *basictl.JsonLexer) error
- func (item *TLItem) ReadTL1(w []byte) ([]byte, error)
- func (item *TLItem) ReadTL1Boxed(w []byte) ([]byte, error)
- func (item *TLItem) Reset()
- func (item TLItem) String() string
- func (item TLItem) TLName() string
- func (item TLItem) TLTag() uint32
- func (item *TLItem) UnmarshalJSON(b []byte) error
- func (item *TLItem) WriteBoxedGeneral(w []byte) ([]byte, error)
- func (item *TLItem) WriteGeneral(w []byte) ([]byte, error)
- func (item *TLItem) WriteJSON(w []byte) []byte
- func (item *TLItem) WriteJSONGeneral(tctx *basictl.JSONWriteContext, w []byte) (_ []byte, err error)
- func (item *TLItem) WriteTL1BoxedGeneral(w []byte) ([]byte, error)
- func (item *TLItem) WriteTL1General(w []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SchemaCommit ¶
func SchemaCommit() string
func SchemaGenerator ¶
func SchemaGenerator() string
func SchemaTimestamp ¶
func SchemaTimestamp() uint32
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 ¶
Do not call directly, called by factory init code
func SetGlobalFactoryCreateForObjectBytes ¶
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 FactoryItemByTLTag ¶
func GetAllTLItems ¶
func GetAllTLItems() []*TLItem
func (TLItem) AnnotationInternal ¶
func (TLItem) AnnotationKphp ¶
func (TLItem) AnnotationRead ¶
func (TLItem) AnnotationReadwrite ¶
func (TLItem) AnnotationWrite ¶
func (TLItem) CreateFunction ¶
func (TLItem) CreateFunctionBytes ¶
used in TL generator tests only, do not use in product code
func (TLItem) CreateFunctionLong ¶
func (TLItem) CreateObject ¶
func (TLItem) CreateObjectBytes ¶
used in TL generator tests only, do not use in product code
func (TLItem) HasFunctionLong ¶
For transcoding short-long version during Long ID transition
func (TLItem) HasTL2 ¶
true for TL2-originated types and for TL1-originated types if in TL2 generation whitelist
func (TLItem) HasUnionTypesInArguments ¶
func (TLItem) HasUnionTypesInResult ¶
func (TLItem) IsFunction ¶
func (*TLItem) MarshalJSON ¶
func (*TLItem) Reset ¶
func (item *TLItem) Reset()
TLItem serves as a single type for all TL1 enum values