github.com/vcilabs/webrpc@v0.5.2-0.20201116131534-162e27b1b33b/gen/golang/templates/proto.gen.go.tmpl (about) 1 {{- define "proto" -}} 2 // {{.Name}} {{.SchemaVersion}} {{.SchemaHash}} 3 // -- 4 // This file has been generated by https://github.com/webrpc/webrpc using gen/golang 5 // Do not edit by hand. Update your webrpc schema and re-generate. 6 package {{.TargetOpts.PkgName}} 7 8 import ( 9 "context" 10 "encoding/json" 11 "fmt" 12 "io/ioutil" 13 "net/http" 14 "time" 15 "strings" 16 "bytes" 17 "errors" 18 "io" 19 "net/url" 20 {{range .Imports}} 21 {{.Path}}{{end}} 22 ) 23 {{ if .WebRPCVersion}} 24 // WebRPC description and code-gen version 25 func WebRPCVersion() string { 26 return "{{.WebRPCVersion}}" 27 }{{end}} 28 {{if .SchemaVersion}} 29 // Schema version of your schema 30 func WebRPCSchemaVersion() string { 31 return "{{.SchemaVersion}}" 32 }{{end}} 33 {{if .SchemaHash}} 34 // Schema hash generated from your schema 35 func WebRPCSchemaHash() string { 36 return "{{.SchemaHash}}" 37 }{{end}} 38 39 {{template "types" .}} 40 41 {{if .TargetOpts.Server}} 42 {{template "server" .}} 43 {{end}} 44 45 {{if .TargetOpts.Client}} 46 {{template "client" .}} 47 {{end}} 48 49 {{template "helpers" .}} 50 51 {{- end}}