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