protoc-gen-go-micro/examples/single-package-mode/templates/{{.File.Name|dir}}/service.go.tmpl
Manfred Touron 4e25b6e83a
Improve imports support (imports lookup)
* Add `--single-package-mode option`
    * Add `getMessageType` helper
    * Add `getProtoFile` helper
    * Add `examples/single-package-mode` example
2017-05-19 09:33:03 +02:00

27 lines
656 B
Cheetah

// file generated with protoc-gen-gotemplate
package {{.File.Name | dir}}
{{- $file := .File}}
{{- $currentFile := $file.Name | getProtoFile}}
import (
"fmt"
"golang.org/x/net/context"
{{- range .File.Dependency}}
{{- $dependency := . | getProtoFile}}
{{$dependency.GoPkg}}
{{end}}
)
type Service struct {}
{{- range .Service.Method}}
{{- $in := .InputType | getMessageType $file}}
{{- $out := .OutputType | getMessageType $file}}
func (service Service) {{.Name}}(ctx context.Context, input *{{$in.GoType $currentFile.GoPkg.Path}}) (*{{$out.GoType $currentFile.GoPkg.Path}}, error) {
return nil, fmt.Errorf("method not implemented")
}
{{end}}