github.com/goplus/yap@v0.8.1/ytest/demo/match/hello/gop_autogen.go (about) 1 // Code generated by gop (Go+); DO NOT EDIT. 2 3 package main 4 5 import ( 6 "fmt" 7 "github.com/goplus/yap" 8 "github.com/goplus/yap/ytest" 9 "github.com/qiniu/x/stringutil" 10 ) 11 12 const _ = true 13 14 type get_p_id struct { 15 yap.Handler 16 *AppV2 17 } 18 type hello struct { 19 ytest.Case 20 *App 21 } 22 type AppV2 struct { 23 yap.AppV2 24 } 25 //line ytest/demo/match/hello/get_p_#id.yap:1 26 func (this *get_p_id) Main(_gop_arg0 *yap.Context) { 27 this.Handler.Main(_gop_arg0) 28 //line ytest/demo/match/hello/get_p_#id.yap:1:1 29 this.Json__1(map[string]string{"id": this.Gop_Env("id")}) 30 } 31 func (this *get_p_id) Classfname() string { 32 return "get_p_#id" 33 } 34 35 type App struct { 36 ytest.App 37 } 38 //line ytest/demo/match/hello/hello_yapt.gox:1 39 func (this *hello) Main() { 40 //line ytest/demo/match/hello/hello_yapt.gox:1:1 41 this.Mock("foo.com", new(AppV2)) 42 //line ytest/demo/match/hello/hello_yapt.gox:3:1 43 id := "123" 44 //line ytest/demo/match/hello/hello_yapt.gox:4:1 45 this.Get(stringutil.Concat("http://foo.com/p/", id)) 46 //line ytest/demo/match/hello/hello_yapt.gox:6:1 47 this.RetWith(200) 48 //line ytest/demo/match/hello/hello_yapt.gox:7:1 49 this.Json(map[string]string{"id": id}) 50 //line ytest/demo/match/hello/hello_yapt.gox:11:1 51 fmt.Println("OK") 52 } 53 func (this *hello) Classfname() string { 54 return "hello" 55 } 56 func (this *AppV2) Main() { 57 yap.Gopt_AppV2_Main(this, new(get_p_id)) 58 } 59 func (this *App) Main() { 60 ytest.Gopt_App_Main(this, new(hello)) 61 } 62 func main() { 63 new(App).Main() 64 }