github.com/mattn/anko@v0.1.10/packages/net.http.go (about) 1 // +build !appengine 2 3 package packages 4 5 import ( 6 "net/http" 7 "reflect" 8 9 "github.com/mattn/anko/env" 10 ) 11 12 func init() { 13 env.Packages["net/http"] = map[string]reflect.Value{ 14 "DefaultClient": reflect.ValueOf(http.DefaultClient), 15 "DefaultServeMux": reflect.ValueOf(http.DefaultServeMux), 16 "DefaultTransport": reflect.ValueOf(http.DefaultTransport), 17 "Handle": reflect.ValueOf(http.Handle), 18 "HandleFunc": reflect.ValueOf(http.HandleFunc), 19 "ListenAndServe": reflect.ValueOf(http.ListenAndServe), 20 "ListenAndServeTLS": reflect.ValueOf(http.ListenAndServeTLS), 21 "NewRequest": reflect.ValueOf(http.NewRequest), 22 "NewServeMux": reflect.ValueOf(http.NewServeMux), 23 "Serve": reflect.ValueOf(http.Serve), 24 "SetCookie": reflect.ValueOf(http.SetCookie), 25 } 26 env.PackageTypes["net/http"] = map[string]reflect.Type{ 27 "Client": reflect.TypeOf(http.Client{}), 28 "Cookie": reflect.TypeOf(http.Cookie{}), 29 "Request": reflect.TypeOf(http.Request{}), 30 "Response": reflect.TypeOf(http.Response{}), 31 } 32 }