github.com/nyan233/littlerpc@v0.4.6-0.20230316182519-0c8d5c48abaf/test/alloc_proxy_def_test.go (about) 1 package main 2 3 /* 4 @Generator : pxtor 5 @CreateTime : 2023-02-19 21:39:25.4989228 +0800 CST m=+0.006712601 6 @Author : NoAuthor 7 @Comment : code is auto generate do not edit 8 */ 9 10 import ( 11 "github.com/nyan233/littlerpc/core/client" 12 ) 13 14 var ( 15 _ binder17453d6adffa3730418d963e8284a517 = new(client.Client) 16 _ caller17453d6adffa3730418d963e8284a517 = new(client.Client) 17 _ BenchAllocProxy = new(benchAllocImpl) 18 ) 19 20 type binder17453d6adffa3730418d963e8284a517 interface { 21 BindFunc(source string, proxy interface{}) error 22 } 23 24 type caller17453d6adffa3730418d963e8284a517 interface { 25 Call(service string, opts []client.CallOption, args ...interface{}) (reps []interface{}, err error) 26 } 27 28 type BenchAllocProxy interface { 29 AllocBigBytes(size int, opts ...client.CallOption) ([]byte, error) 30 AllocLittleNBytesInit(n int, size int, opts ...client.CallOption) ([][]byte, error) 31 AllocLittleNBytesNoInit(n int, size int, opts ...client.CallOption) ([][]byte, error) 32 } 33 34 type benchAllocImpl struct { 35 caller17453d6adffa3730418d963e8284a517 36 } 37 38 func NewBenchAlloc(b binder17453d6adffa3730418d963e8284a517) BenchAllocProxy { 39 proxy := new(benchAllocImpl) 40 err := b.BindFunc("BenchAlloc", proxy) 41 if err != nil { 42 panic(err) 43 } 44 c, ok := b.(caller17453d6adffa3730418d963e8284a517) 45 if !ok { 46 panic("the argument is not implemented caller") 47 } 48 proxy.caller17453d6adffa3730418d963e8284a517 = c 49 return proxy 50 } 51 52 func (p benchAllocImpl) AllocBigBytes(size int, opts ...client.CallOption) ([]byte, error) { 53 reps, err := p.Call("BenchAlloc.AllocBigBytes", opts, size) 54 r0, _ := reps[0].([]byte) 55 return r0, err 56 } 57 58 func (p benchAllocImpl) AllocLittleNBytesInit(n int, size int, opts ...client.CallOption) ([][]byte, error) { 59 reps, err := p.Call("BenchAlloc.AllocLittleNBytesInit", opts, n, size) 60 r0, _ := reps[0].([][]byte) 61 return r0, err 62 } 63 64 func (p benchAllocImpl) AllocLittleNBytesNoInit(n int, size int, opts ...client.CallOption) ([][]byte, error) { 65 reps, err := p.Call("BenchAlloc.AllocLittleNBytesNoInit", opts, n, size) 66 r0, _ := reps[0].([][]byte) 67 return r0, err 68 }