trpc.group/trpc-go/trpc-go@v1.0.3/testdata/fbstest/HelloReq.go (about) 1 // 2 // 3 // Tencent is pleased to support the open source community by making tRPC available. 4 // 5 // Copyright (C) 2023 THL A29 Limited, a Tencent company. 6 // All rights reserved. 7 // 8 // If you have downloaded a copy of the tRPC source code from Tencent, 9 // please note that tRPC source code is licensed under the Apache 2.0 License, 10 // A copy of the Apache 2.0 License is included in this file. 11 // 12 // 13 14 // Code generated by the FlatBuffers compiler. DO NOT EDIT. 15 16 package fbstest 17 18 import ( 19 flatbuffers "github.com/google/flatbuffers/go" 20 ) 21 22 type HelloReq struct { 23 _tab flatbuffers.Table 24 } 25 26 func GetRootAsHelloReq(buf []byte, offset flatbuffers.UOffsetT) *HelloReq { 27 n := flatbuffers.GetUOffsetT(buf[offset:]) 28 x := &HelloReq{} 29 x.Init(buf, n+offset) 30 return x 31 } 32 33 func GetSizePrefixedRootAsHelloReq(buf []byte, offset flatbuffers.UOffsetT) *HelloReq { 34 n := flatbuffers.GetUOffsetT(buf[offset+flatbuffers.SizeUint32:]) 35 x := &HelloReq{} 36 x.Init(buf, n+offset+flatbuffers.SizeUint32) 37 return x 38 } 39 40 func (rcv *HelloReq) Init(buf []byte, i flatbuffers.UOffsetT) { 41 rcv._tab.Bytes = buf 42 rcv._tab.Pos = i 43 } 44 45 func (rcv *HelloReq) Table() flatbuffers.Table { 46 return rcv._tab 47 } 48 49 func (rcv *HelloReq) Message() []byte { 50 o := flatbuffers.UOffsetT(rcv._tab.Offset(4)) 51 if o != 0 { 52 return rcv._tab.ByteVector(o + rcv._tab.Pos) 53 } 54 return nil 55 } 56 57 func HelloReqStart(builder *flatbuffers.Builder) { 58 builder.StartObject(1) 59 } 60 func HelloReqAddMessage(builder *flatbuffers.Builder, message flatbuffers.UOffsetT) { 61 builder.PrependUOffsetTSlot(0, flatbuffers.UOffsetT(message), 0) 62 } 63 func HelloReqEnd(builder *flatbuffers.Builder) flatbuffers.UOffsetT { 64 return builder.EndObject() 65 }