gen

package
v1.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2022 License: MPL-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Code generated by vktl/cmd/tlgen2; 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

Types

type Function

type Function interface {
	Object

	ReadResultWriteResultJSON(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResult(r) + WriteResultJSON(w). Returns new r, new w, plus error
	ReadResultJSONWriteResult(r []byte, w []byte) ([]byte, []byte, error) // combination of ReadResultJSON(r) + WriteResult(w). Returns new r, new w, plus error
}

func CreateFunction

func CreateFunction(tag uint32) Function

func CreateFunctionFromName

func CreateFunctionFromName(name string) Function

name can be in any of 3 forms "ch_proxy.insert#7cf362ba", "ch_proxy.insert" or "#7cf362ba"

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)

	Read(w []byte) ([]byte, error)       // reads type's bare TL representation by consuming bytes from the start of w and returns remaining bytes, plus error
	Write(w []byte) ([]byte, error)      // appends bytes of type's bare TL representation to the end of w and returns it, plus error
	ReadBoxed(w []byte) ([]byte, error)  // same as Read, but reads/checks TLTag first
	WriteBoxed(w []byte) ([]byte, error) // same as Write, but writes TLTag first

	MarshalJSON() ([]byte, error)       // returns type's JSON representation, plus error
	UnmarshalJSON([]byte) error         // reads type's JSON representation
	WriteJSON(w []byte) ([]byte, error) // like MarshalJSON, but appends to w and returns it
}

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

func CreateObject

func CreateObject(tag uint32) Object

func CreateObjectFromName

func CreateObjectFromName(name string) Object

name can be in any of 3 forms "ch_proxy.insert#7cf362ba", "ch_proxy.insert" or "#7cf362ba"

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 (TLItem) CreateFunction

func (item TLItem) CreateFunction() Function

func (TLItem) CreateObject

func (item TLItem) CreateObject() Object

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) Reset

func (item *TLItem) Reset()

TLItem serves as a single type for all 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) Write

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

func (*TLItem) WriteBoxed

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

func (*TLItem) WriteJSON

func (item *TLItem) WriteJSON(w []byte) (_ []byte, err error)

Directories

Path Synopsis
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.
Code generated by vktl/cmd/tlgen2; DO NOT EDIT.

Jump to

Keyboard shortcuts

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