github.com/nyan233/littlerpc@v0.4.6-0.20230316182519-0c8d5c48abaf/cmd/pxtor/test/proxy_1.go (about) 1 package test 2 3 import ( 4 "github.com/nyan233/littlerpc/core/server" 5 ) 6 7 type Test struct { 8 Name string 9 Key string 10 Uid uint64 11 server.RpcServer 12 } 13 14 func (p *Test) Setup() { 15 err := p.HijackProcess("Foo", func(stub *server.Stub) { 16 return 17 }) 18 if err != nil { 19 panic(err) 20 } 21 } 22 23 func (p *Test) Foo(s1 string) (int, error) { 24 return 1 << 20, nil 25 } 26 27 func (p *Test) Bar(s1 string) (int, error) { 28 return 1 << 30, nil 29 } 30 31 func (p *Test) NoReturnValue(i int) error { 32 return nil 33 }