Merge pull request #80 from hasLeland/svcdef-weave
Migrate gengokit to svcdef
This commit is contained in:
Коммит
460bbf0789
|
@ -22,6 +22,24 @@ import (
|
|||
"strconv"
|
||||
)
|
||||
|
||||
type optionParseErr struct {
|
||||
err error
|
||||
}
|
||||
|
||||
func (o optionParseErr) Optional() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func (o optionParseErr) Error() string {
|
||||
return o.err.Error()
|
||||
}
|
||||
|
||||
func optionalParseErr(expected string, line int, val string) error {
|
||||
return optionParseErr{
|
||||
err: fmt.Errorf("parser expected %v in line '%v', instead found '%v'", expected, line, val),
|
||||
}
|
||||
}
|
||||
|
||||
func parseErr(expected string, line int, val string) error {
|
||||
err := fmt.Errorf("parser expected %v in line '%v', instead found '%v'", expected, line, val)
|
||||
return err
|
||||
|
@ -302,7 +320,9 @@ func ParseHttpBindings(lex *SvcLexer) ([]*HTTPBinding, error) {
|
|||
return append(rv, new_opt), nil
|
||||
}
|
||||
|
||||
return nil, parseErr("'option' or 'additional_bindings' while parsing options", lex.GetLineNumber(), val)
|
||||
opt := optionalParseErr("'option' or 'additional_bindings' while parsing options", lex.GetLineNumber(), val)
|
||||
|
||||
return nil, opt
|
||||
}
|
||||
|
||||
func ParseBindingFields(lex *SvcLexer) ([]*Field, error) {
|
||||
|
|
|
@ -9,10 +9,10 @@ import (
|
|||
"fmt"
|
||||
"html/template"
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/TuneLab/go-truss/deftree"
|
||||
generatego "github.com/golang/protobuf/protoc-gen-go/generator"
|
||||
"github.com/TuneLab/go-truss/svcdef"
|
||||
gogen "github.com/golang/protobuf/protoc-gen-go/generator"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
@ -54,12 +54,6 @@ type ClientArg struct {
|
|||
// from FlagArg or the invocation of a json unmarshal function.
|
||||
GoConvertInvoc string
|
||||
|
||||
// ProtobufType contains the raw value of the type of the original protobuf
|
||||
// field corresponding to this arg, as provided by the protocol buffer
|
||||
// compiler. For a list of these basic types and their corresponding Go
|
||||
// types, see the ProtoToGoTypeMap map in this file.
|
||||
ProtbufType string
|
||||
|
||||
// IsBaseType is true if this arg corresponds to a protobuf field which is
|
||||
// any of the basic types, or a basic type but repeated. If this the field
|
||||
// was a nested message or a map, IsBaseType is false.
|
||||
|
@ -161,54 +155,50 @@ var ProtoToGoTypeMap = map[string]string{
|
|||
|
||||
// New creates a ClientServiceArgs struct containing all the arguments for all
|
||||
// the methods of a given RPC.
|
||||
func New(svc *deftree.ProtoService) *ClientServiceArgs {
|
||||
func New(svc *svcdef.Service) *ClientServiceArgs {
|
||||
svcArgs := ClientServiceArgs{
|
||||
MethArgs: make(map[string]*MethodArgs),
|
||||
}
|
||||
for _, meth := range svc.Methods {
|
||||
m := MethodArgs{}
|
||||
for _, field := range meth.RequestType.Fields {
|
||||
// Skip map fields, as they're currently incorrectly implemented by
|
||||
// deftree
|
||||
// TODO implement correct map support in client argument generation
|
||||
if field.IsMap {
|
||||
// TODO implement correct map support in client argument generation
|
||||
for _, field := range meth.RequestType.Message.Fields {
|
||||
if field.Type.Map != nil {
|
||||
continue
|
||||
}
|
||||
newArg := newClientArg(meth.GetName(), field)
|
||||
newArg := newClientArg(meth.Name, field)
|
||||
m.Args = append(m.Args, newArg)
|
||||
}
|
||||
svcArgs.MethArgs[meth.GetName()] = &m
|
||||
svcArgs.MethArgs[meth.Name] = &m
|
||||
}
|
||||
|
||||
return &svcArgs
|
||||
}
|
||||
|
||||
// newClientArg returns a ClientArg generated from the provided method name and MessageField
|
||||
func newClientArg(methName string, field *deftree.MessageField) *ClientArg {
|
||||
func newClientArg(methName string, field *svcdef.Field) *ClientArg {
|
||||
newArg := ClientArg{}
|
||||
newArg.Name = field.GetName()
|
||||
newArg.Name = lowCamelName(field.Name)
|
||||
|
||||
if field.Label == "LABEL_REPEATED" {
|
||||
if field.Type.ArrayType {
|
||||
newArg.Repeated = true
|
||||
}
|
||||
newArg.ProtbufType = field.Type.GetName()
|
||||
|
||||
newArg.FlagName = fmt.Sprintf("%s.%s", strings.ToLower(methName), strings.ToLower(field.GetName()))
|
||||
newArg.FlagArg = fmt.Sprintf("flag%s%s", generatego.CamelCase(newArg.Name), generatego.CamelCase(methName))
|
||||
newArg.FlagName = fmt.Sprintf("%s.%s", strings.ToLower(methName), strings.ToLower(field.Name))
|
||||
newArg.FlagArg = fmt.Sprintf("flag%s%s", gogen.CamelCase(field.Name), gogen.CamelCase(methName))
|
||||
|
||||
if field.Type.Enum != nil {
|
||||
newArg.Enum = true
|
||||
log.WithField("Method", methName).WithField("Arg", newArg.Name).Debugf("type: %s", field.Type.GetName())
|
||||
}
|
||||
// Determine the FlagType and flag invocation
|
||||
var ft string
|
||||
var ok bool
|
||||
log.WithField("Method", methName).WithField("Arg", newArg.Name).Debugf("type: %s", field.Type.GetName())
|
||||
// For types outside the base types, have flag treat them as strings
|
||||
if ft, ok = ProtoToGoTypeMap[field.Type.GetName()]; !ok {
|
||||
if field.Type.Message == nil && field.Type.Enum == nil && field.Type.Map == nil {
|
||||
ft = field.Type.Name
|
||||
newArg.IsBaseType = true
|
||||
} else {
|
||||
// For types outside the base types, have flag treat them as strings
|
||||
ft = "string"
|
||||
newArg.IsBaseType = false
|
||||
} else {
|
||||
newArg.IsBaseType = true
|
||||
}
|
||||
if newArg.Repeated {
|
||||
ft = "string"
|
||||
|
@ -216,19 +206,13 @@ func newClientArg(methName string, field *deftree.MessageField) *ClientArg {
|
|||
newArg.FlagType = ft
|
||||
newArg.FlagConvertFunc = createFlagConvertFunc(newArg)
|
||||
|
||||
newArg.GoArg = fmt.Sprintf("%s%s", generatego.CamelCase(newArg.Name), generatego.CamelCase(methName))
|
||||
newArg.GoArg = fmt.Sprintf("%s%s", gogen.CamelCase(newArg.Name), gogen.CamelCase(methName))
|
||||
// For types outside the base types, treat them as strings
|
||||
if newArg.IsBaseType {
|
||||
newArg.GoType = ProtoToGoTypeMap[field.Type.GetName()]
|
||||
//newArg.GoType = ProtoToGoTypeMap[field.Type.GetName()]
|
||||
newArg.GoType = field.Type.Name
|
||||
} else {
|
||||
// TODO: Have GoType derivation respect nested definitions
|
||||
tn := field.Type.GetName()
|
||||
sections := strings.Split(tn, ".")
|
||||
// Extract everything after the package name
|
||||
remaining := sections[2:]
|
||||
tn = generatego.CamelCaseSlice(remaining)
|
||||
//log.WithField("Method", methName).WithField("Arg", newArg.Name).Warnf("type: %v, %v", sections[2:], generatego.CamelCaseSlice(sections[2:]))
|
||||
newArg.GoType = "pb." + tn
|
||||
newArg.GoType = "pb." + field.Type.Name
|
||||
}
|
||||
// The GoType is a slice of the GoType if it's a repeated field
|
||||
if newArg.Repeated {
|
||||
|
@ -257,7 +241,7 @@ if {{.FlagArg}} != nil && len(*{{.FlagArg}}) > 0 {
|
|||
}
|
||||
`
|
||||
if a.Repeated || !a.IsBaseType {
|
||||
code, err := ApplyTemplate("UnmarshalCliArgs", jsonConvTmpl, a, nil)
|
||||
code, err := applyTemplate("UnmarshalCliArgs", jsonConvTmpl, a, nil)
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Couldn't apply template: %v", err))
|
||||
}
|
||||
|
@ -312,10 +296,10 @@ func flagTypeConversion(a ClientArg) string {
|
|||
return fmt.Sprintf(fType, a.FlagArg)
|
||||
}
|
||||
|
||||
// ApplyTemplate applies a template with a given name, executor context, and
|
||||
// applyTemplate applies a template with a given name, executor context, and
|
||||
// function map. Returns the output of the template on success, returns an
|
||||
// error if template failed to execute.
|
||||
func ApplyTemplate(name string, tmpl string, executor interface{}, fncs template.FuncMap) (string, error) {
|
||||
func applyTemplate(name string, tmpl string, executor interface{}, fncs template.FuncMap) (string, error) {
|
||||
codeTemplate := template.Must(template.New(name).Funcs(fncs).Parse(tmpl))
|
||||
|
||||
code := bytes.NewBuffer(nil)
|
||||
|
@ -325,3 +309,17 @@ func ApplyTemplate(name string, tmpl string, executor interface{}, fncs template
|
|||
}
|
||||
return code.String(), nil
|
||||
}
|
||||
|
||||
// lowCamelName returns a CamelCased string, but with the first letter
|
||||
// lowercased. "package_name" becomes "packageName".
|
||||
func lowCamelName(s string) string {
|
||||
s = gogen.CamelCase(s)
|
||||
new := []rune(s)
|
||||
if len(new) < 1 {
|
||||
return s
|
||||
}
|
||||
rv := []rune{}
|
||||
rv = append(rv, unicode.ToLower(new[0]))
|
||||
rv = append(rv, new[1:]...)
|
||||
return string(rv)
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ import (
|
|||
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
|
||||
"github.com/TuneLab/go-truss/deftree"
|
||||
"github.com/TuneLab/go-truss/gengokit/gentesthelper"
|
||||
"github.com/TuneLab/go-truss/svcdef"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -17,57 +17,37 @@ var (
|
|||
)
|
||||
|
||||
func TestNewClientServiceArgs(t *testing.T) {
|
||||
svc := deftree.ProtoService{
|
||||
Name: "AddSvc",
|
||||
Methods: []*deftree.ServiceMethod{
|
||||
&deftree.ServiceMethod{
|
||||
Name: "Sum",
|
||||
RequestType: &deftree.ProtoMessage{
|
||||
Name: "SumRequest",
|
||||
Fields: []*deftree.MessageField{
|
||||
&deftree.MessageField{
|
||||
Name: "a",
|
||||
Number: 1,
|
||||
Label: "LABEL_REPEATED",
|
||||
Type: deftree.FieldType{
|
||||
Name: "TYPE_INT64",
|
||||
},
|
||||
},
|
||||
&deftree.MessageField{
|
||||
Name: "b",
|
||||
Number: 2,
|
||||
Label: "LABEL_OPTIONAL",
|
||||
Type: deftree.FieldType{
|
||||
Name: "TYPE_INT64",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ResponseType: &deftree.ProtoMessage{
|
||||
Name: "SumReply",
|
||||
Fields: []*deftree.MessageField{
|
||||
&deftree.MessageField{
|
||||
Name: "v",
|
||||
Number: 1,
|
||||
Label: "LABEL_OPTIONAL",
|
||||
Type: deftree.FieldType{
|
||||
Name: "TYPE_INT64",
|
||||
},
|
||||
},
|
||||
&deftree.MessageField{
|
||||
Name: "err",
|
||||
Number: 2,
|
||||
Label: "LABEL_OPTIONAL",
|
||||
Type: deftree.FieldType{
|
||||
Name: "TYPE_STRING",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
defStr := `
|
||||
syntax = "proto3";
|
||||
|
||||
// General package
|
||||
package general;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
message SumRequest {
|
||||
repeated int64 a = 1;
|
||||
int64 b = 2;
|
||||
}
|
||||
|
||||
message SumReply {
|
||||
int64 v = 1;
|
||||
string err = 2;
|
||||
}
|
||||
|
||||
service SumSvc {
|
||||
rpc Sum(SumRequest) returns (SumReply) {
|
||||
option (google.api.http) = {
|
||||
get: "/sum/{a}"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
sd, err := svcdef.NewFromString(defStr)
|
||||
if err != nil {
|
||||
t.Fatal(err, "Failed to create a service from the definition string")
|
||||
}
|
||||
csa := New(&svc)
|
||||
csa := New(sd.Service)
|
||||
|
||||
expected := &ClientServiceArgs{
|
||||
MethArgs: map[string]*MethodArgs{
|
||||
|
@ -82,7 +62,6 @@ func TestNewClientServiceArgs(t *testing.T) {
|
|||
GoArg: "ASum",
|
||||
GoType: "[]int64",
|
||||
GoConvertInvoc: "\nvar ASum []int64\nif flagASum != nil && len(*flagASum) > 0 {\n\terr = json.Unmarshal([]byte(*flagASum), &ASum)\n\tif err != nil {\n\t\tpanic(errors.Wrapf(err, \"unmarshalling ASum from %v:\", flagASum))\n\t}\n}\n",
|
||||
ProtbufType: "TYPE_INT64",
|
||||
IsBaseType: true,
|
||||
Repeated: true,
|
||||
},
|
||||
|
@ -96,7 +75,6 @@ func TestNewClientServiceArgs(t *testing.T) {
|
|||
GoArg: "BSum",
|
||||
GoType: "int64",
|
||||
GoConvertInvoc: "BSum := *flagBSum",
|
||||
ProtbufType: "TYPE_INT64",
|
||||
IsBaseType: true,
|
||||
Repeated: false,
|
||||
},
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
package config
|
||||
|
||||
import "github.com/TuneLab/go-truss/truss/truss"
|
||||
|
||||
type Config struct {
|
||||
GoPackage string
|
||||
PBPackage string
|
||||
|
||||
PreviousFiles []truss.NamedReadWriter
|
||||
}
|
|
@ -16,10 +16,11 @@ import (
|
|||
|
||||
"github.com/TuneLab/go-truss/gengokit/astmodifier"
|
||||
"github.com/TuneLab/go-truss/gengokit/clientarggen"
|
||||
"github.com/TuneLab/go-truss/gengokit/config"
|
||||
"github.com/TuneLab/go-truss/gengokit/httptransport"
|
||||
templateFileAssets "github.com/TuneLab/go-truss/gengokit/template"
|
||||
|
||||
"github.com/TuneLab/go-truss/deftree"
|
||||
"github.com/TuneLab/go-truss/svcdef"
|
||||
"github.com/TuneLab/go-truss/truss/truss"
|
||||
)
|
||||
|
||||
|
@ -41,18 +42,14 @@ type templateExecutor struct {
|
|||
// PackageName is the name of the package containing the service definition
|
||||
PackageName string
|
||||
// GRPC/Protobuff service, with all parameters and return values accessible
|
||||
Service *deftree.ProtoService
|
||||
Service *svcdef.Service
|
||||
ClientArgs *clientarggen.ClientServiceArgs
|
||||
// A helper struct for generating http transport functionality.
|
||||
HTTPHelper *httptransport.Helper
|
||||
funcMap template.FuncMap
|
||||
}
|
||||
|
||||
func newTemplateExecutor(dt deftree.Deftree, goPackage, goPBPackage string) (*templateExecutor, error) {
|
||||
service, err := getProtoService(dt)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "no service found; aborting generating gokit service")
|
||||
}
|
||||
func newTemplateExecutor(sd *svcdef.Svcdef, conf config.Config) (*templateExecutor, error) {
|
||||
|
||||
funcMap := template.FuncMap{
|
||||
"ToLower": strings.ToLower,
|
||||
|
@ -61,27 +58,27 @@ func newTemplateExecutor(dt deftree.Deftree, goPackage, goPBPackage string) (*te
|
|||
"TrimPrefix": strings.TrimPrefix,
|
||||
}
|
||||
return &templateExecutor{
|
||||
ImportPath: goPackage,
|
||||
PBImportPath: goPBPackage,
|
||||
PackageName: dt.GetName(),
|
||||
Service: service,
|
||||
ClientArgs: clientarggen.New(service),
|
||||
HTTPHelper: httptransport.NewHelper(service),
|
||||
ImportPath: conf.GoPackage,
|
||||
PBImportPath: conf.PBPackage,
|
||||
PackageName: sd.PkgName,
|
||||
Service: sd.Service,
|
||||
ClientArgs: clientarggen.New(sd.Service),
|
||||
HTTPHelper: httptransport.NewHelper(sd.Service),
|
||||
funcMap: funcMap,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GenerateGokit returns a gokit service generated from a service definition (deftree),
|
||||
// GenerateGokit returns a gokit service generated from a service definition (svcdef),
|
||||
// the package to the root of the generated service goPackage, the package
|
||||
// to the .pb.go service struct files (goPBPackage) and any prevously generated files.
|
||||
func GenerateGokit(dt deftree.Deftree, goPackage, goPBPackage string, previousFiles []truss.NamedReadWriter) ([]truss.NamedReadWriter, error) {
|
||||
te, err := newTemplateExecutor(dt, goPackage, goPBPackage)
|
||||
func GenerateGokit(sd *svcdef.Svcdef, conf config.Config) ([]truss.NamedReadWriter, error) {
|
||||
te, err := newTemplateExecutor(sd, conf)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not create template executor")
|
||||
}
|
||||
|
||||
fpm := make(map[string]io.Reader, len(previousFiles))
|
||||
for _, f := range previousFiles {
|
||||
fpm := make(map[string]io.Reader, len(conf.PreviousFiles))
|
||||
for _, f := range conf.PreviousFiles {
|
||||
fpm[f.Name()] = f
|
||||
}
|
||||
|
||||
|
@ -102,24 +99,6 @@ func GenerateGokit(dt deftree.Deftree, goPackage, goPBPackage string, previousFi
|
|||
return codeGenFiles, nil
|
||||
}
|
||||
|
||||
// getProtoService finds returns the service within a deftree.Deftree
|
||||
func getProtoService(dt deftree.Deftree) (*deftree.ProtoService, error) {
|
||||
md := dt.(*deftree.MicroserviceDefinition)
|
||||
files := md.Files
|
||||
var service *deftree.ProtoService
|
||||
|
||||
for _, file := range files {
|
||||
if len(file.Services) > 0 {
|
||||
service = file.Services[0]
|
||||
}
|
||||
}
|
||||
|
||||
if service == nil {
|
||||
return nil, errors.New("no service found")
|
||||
}
|
||||
return service, nil
|
||||
}
|
||||
|
||||
// generateResponseFile contains logic to choose how to render a template file
|
||||
// based on path and if that file was generated previously. It accepts a
|
||||
// template path to render, a templateExecutor to apply to the template, and a
|
||||
|
@ -274,10 +253,10 @@ func updateClientMethods(clientHandler io.Reader, te *templateExecutor) (outCode
|
|||
// serviceFunctionNames returns a slice of function names which are in the
|
||||
// definition files plus the function "NewService". Used for inserting and
|
||||
// removing functions from previously generated handler files
|
||||
func serviceFunctionsNames(methods []*deftree.ServiceMethod) []string {
|
||||
func serviceFunctionsNames(methods []*svcdef.ServiceMethod) []string {
|
||||
var svcFuncs []string
|
||||
for _, m := range methods {
|
||||
svcFuncs = append(svcFuncs, m.GetName())
|
||||
svcFuncs = append(svcFuncs, m.Name)
|
||||
}
|
||||
svcFuncs = append(svcFuncs, "NewService")
|
||||
|
||||
|
@ -287,10 +266,10 @@ func serviceFunctionsNames(methods []*deftree.ServiceMethod) []string {
|
|||
// trimServiceFuncs removes functions in funcsInFile from the
|
||||
// templateExecutor and returns a pointer to a new templateExecutor
|
||||
func (te templateExecutor) trimServiceFuncs(funcsInFile map[string]bool) *templateExecutor {
|
||||
var methodsToTemplate []*deftree.ServiceMethod
|
||||
var methodsToTemplate []*svcdef.ServiceMethod
|
||||
|
||||
for _, m := range te.Service.Methods {
|
||||
mName := m.GetName()
|
||||
mName := m.Name
|
||||
|
||||
if funcsInFile[mName] {
|
||||
log.WithField("Method", mName).Info("Handler method already exists")
|
||||
|
|
|
@ -8,8 +8,9 @@ import (
|
|||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/TuneLab/go-truss/deftree"
|
||||
"github.com/TuneLab/go-truss/svcdef"
|
||||
|
||||
"github.com/TuneLab/go-truss/gengokit/config"
|
||||
templateFileAssets "github.com/TuneLab/go-truss/gengokit/template"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
|
@ -45,92 +46,45 @@ func TestNewTemplateExecutor(t *testing.T) {
|
|||
|
||||
// RequestMessage is so foo
|
||||
message RequestMessage {
|
||||
string input = 1;
|
||||
string input = 1;
|
||||
}
|
||||
|
||||
// ResponseMessage is so bar
|
||||
message ResponseMessage {
|
||||
string output = 1;
|
||||
string output = 1;
|
||||
}
|
||||
|
||||
// ProtoService is a service
|
||||
service ProtoService {
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
dt, err := deftree.NewFromString(def)
|
||||
sd, err := svcdef.NewFromString(def)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
const goPackage = "github.com/TuneLab/go-truss/gengokit/general-service"
|
||||
const goPBPackage = "github.com/TuneLab/go-truss/gengokit/general-service"
|
||||
conf := config.Config{
|
||||
GoPackage: "github.com/TuneLab/go-truss/gengokit/general-service",
|
||||
PBPackage: "github.com/TuneLab/go-truss/gengokit/general-service",
|
||||
}
|
||||
|
||||
te, err := newTemplateExecutor(dt, goPackage, goPBPackage)
|
||||
te, err := newTemplateExecutor(sd, conf)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if got, want := te.PackageName, dt.GetName(); got != want {
|
||||
if got, want := te.PackageName, sd.PkgName; got != want {
|
||||
t.Fatalf("\n`%v` was PackageName\n`%v` was wanted", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetProtoService(t *testing.T) {
|
||||
const def = `
|
||||
syntax = "proto3";
|
||||
|
||||
// General package
|
||||
package general;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
// RequestMessage is so foo
|
||||
message RequestMessage {
|
||||
string input = 1;
|
||||
}
|
||||
|
||||
// ResponseMessage is so bar
|
||||
message ResponseMessage {
|
||||
string output = 1;
|
||||
}
|
||||
|
||||
// ProtoService is a service
|
||||
service ProtoService {
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
dt, err := deftree.NewFromString(def)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
svc, err := getProtoService(dt)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if got, want := svc.GetName(), "ProtoService"; got != want {
|
||||
t.Fatalf("\n`%v` was service name\n`%v` was wanted", got, want)
|
||||
}
|
||||
|
||||
if got, want := svc.Methods[0].GetName(), "ProtoMethod"; got != want {
|
||||
t.Fatalf("\n`%v` was rpc in service\n`%v` was wanted", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyTemplateFromPath(t *testing.T) {
|
||||
const def = `
|
||||
syntax = "proto3";
|
||||
|
@ -142,35 +96,36 @@ func TestApplyTemplateFromPath(t *testing.T) {
|
|||
|
||||
// RequestMessage is so foo
|
||||
message RequestMessage {
|
||||
string input = 1;
|
||||
string input = 1;
|
||||
}
|
||||
|
||||
// ResponseMessage is so bar
|
||||
message ResponseMessage {
|
||||
string output = 1;
|
||||
string output = 1;
|
||||
}
|
||||
|
||||
// ProtoService is a service
|
||||
service ProtoService {
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const goPackage = "github.com/TuneLab/go-truss/gengokit"
|
||||
const goPBPackage = "github.com/TuneLab/go-truss/gengokit/general-service"
|
||||
|
||||
dt, err := deftree.NewFromString(def)
|
||||
sd, err := svcdef.NewFromString(def)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
te, err := newTemplateExecutor(dt, goPackage, goPBPackage)
|
||||
conf := config.Config{
|
||||
GoPackage: "github.com/TuneLab/go-truss",
|
||||
PBPackage: "github.com/TuneLab/go-truss/gengokit/general-service",
|
||||
}
|
||||
|
||||
te, err := newTemplateExecutor(sd, conf)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -205,37 +160,37 @@ func TestTrimTemplateExecutorServiceFuncs(t *testing.T) {
|
|||
|
||||
// RequestMessage is so foo
|
||||
message RequestMessage {
|
||||
string input = 1;
|
||||
string input = 1;
|
||||
}
|
||||
|
||||
// ResponseMessage is so bar
|
||||
message ResponseMessage {
|
||||
string output = 1;
|
||||
string output = 1;
|
||||
}
|
||||
|
||||
// ProtoService is a service
|
||||
service ProtoService {
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
// ProtoMethodAgain is simple. Like a gopher again.
|
||||
rpc ProtoMethodAgain (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route2"
|
||||
};
|
||||
}
|
||||
// ProtoMethodAgain is simple. Like a gopher again.
|
||||
rpc ProtoMethodAgainAgain (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route3"
|
||||
};
|
||||
}
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
// ProtoMethodAgain is simple. Like a gopher again.
|
||||
rpc ProtoMethodAgain (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route2"
|
||||
};
|
||||
}
|
||||
// ProtoMethodAgain is simple. Like a gopher again.
|
||||
rpc ProtoMethodAgainAgain (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route3"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
|
@ -280,22 +235,27 @@ func TestTrimTemplateExecutorServiceFuncs(t *testing.T) {
|
|||
|
||||
}
|
||||
|
||||
func svcMethodsNames(methods []*deftree.ServiceMethod) []string {
|
||||
func svcMethodsNames(methods []*svcdef.ServiceMethod) []string {
|
||||
var mNames []string
|
||||
for _, m := range methods {
|
||||
mNames = append(mNames, m.GetName())
|
||||
mNames = append(mNames, m.Name)
|
||||
}
|
||||
|
||||
return mNames
|
||||
}
|
||||
|
||||
func stringToTemplateExector(def, importPath string) (*templateExecutor, error) {
|
||||
dt, err := deftree.NewFromString(def)
|
||||
sd, err := svcdef.NewFromString(def)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
te, err := newTemplateExecutor(dt, importPath, importPath)
|
||||
conf := config.Config{
|
||||
GoPackage: importPath,
|
||||
PBPackage: importPath,
|
||||
}
|
||||
|
||||
te, err := newTemplateExecutor(sd, conf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -315,35 +275,37 @@ func TestUpdateServerMethods(t *testing.T) {
|
|||
|
||||
// RequestMessage is so foo
|
||||
message RequestMessage {
|
||||
string input = 1;
|
||||
string input = 1;
|
||||
}
|
||||
|
||||
// ResponseMessage is so bar
|
||||
message ResponseMessage {
|
||||
string output = 1;
|
||||
string output = 1;
|
||||
}
|
||||
|
||||
// ProtoService is a service
|
||||
service ProtoService {
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
const goPackage = "github.com/TuneLab/go-truss/gengokit"
|
||||
const goPBPackage = "github.com/TuneLab/go-truss/gengokit/general-service"
|
||||
|
||||
dt, err := deftree.NewFromString(def)
|
||||
sd, err := svcdef.NewFromString(def)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
te, err := newTemplateExecutor(dt, goPackage, goPBPackage)
|
||||
conf := config.Config{
|
||||
GoPackage: "github.com/TuneLab/go-truss/gengokit",
|
||||
PBPackage: "github.com/TuneLab/go-truss/gengokit/general-service",
|
||||
}
|
||||
|
||||
te, err := newTemplateExecutor(sd, conf)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
@ -405,23 +367,23 @@ func TestAllTemplates(t *testing.T) {
|
|||
|
||||
// RequestMessage is so foo
|
||||
message RequestMessage {
|
||||
string input = 1;
|
||||
string input = 1;
|
||||
}
|
||||
|
||||
// ResponseMessage is so bar
|
||||
message ResponseMessage {
|
||||
string output = 1;
|
||||
string output = 1;
|
||||
}
|
||||
|
||||
// ProtoService is a service
|
||||
service ProtoService {
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
|
@ -435,49 +397,54 @@ func TestAllTemplates(t *testing.T) {
|
|||
|
||||
// RequestMessage is so foo
|
||||
message RequestMessage {
|
||||
string input = 1;
|
||||
string input = 1;
|
||||
}
|
||||
|
||||
// ResponseMessage is so bar
|
||||
message ResponseMessage {
|
||||
string output = 1;
|
||||
string output = 1;
|
||||
}
|
||||
|
||||
// ProtoService is a service
|
||||
service ProtoService {
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
// ProtoMethodAgain is simple. Like a gopher again.
|
||||
rpc ProtoMethodAgain (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route2"
|
||||
};
|
||||
}
|
||||
// ProtoMethod is simple. Like a gopher.
|
||||
rpc ProtoMethod (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route"
|
||||
};
|
||||
}
|
||||
// ProtoMethodAgain is simple. Like a gopher again.
|
||||
rpc ProtoMethodAgain (RequestMessage) returns (ResponseMessage) {
|
||||
// No {} in path and no body, everything is in the query
|
||||
option (google.api.http) = {
|
||||
get: "/route2"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
dt, err := deftree.NewFromString(def)
|
||||
sd, err := svcdef.NewFromString(def)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
te, err := newTemplateExecutor(dt, goPackage, goPBPackage)
|
||||
conf := config.Config{
|
||||
GoPackage: "github.com/TuneLab/go-truss/gengokit",
|
||||
PBPackage: "github.com/TuneLab/go-truss/gengokit/general-service",
|
||||
}
|
||||
|
||||
te, err := newTemplateExecutor(sd, conf)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
dt2, err := deftree.NewFromString(def2)
|
||||
sd2, err := svcdef.NewFromString(def)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
te2, err := newTemplateExecutor(dt2, goPackage, goPBPackage)
|
||||
te2, err := newTemplateExecutor(sd2, conf)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// Package httptransport provides functions and template helpers for templating
|
||||
// the http-transport of a go-kit based microservice.
|
||||
// the http-transport of a go-kit based service.
|
||||
package httptransport
|
||||
|
||||
import (
|
||||
|
@ -12,15 +12,14 @@ import (
|
|||
"unicode"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/TuneLab/go-truss/deftree"
|
||||
"github.com/TuneLab/go-truss/gengokit/clientarggen"
|
||||
"github.com/TuneLab/go-truss/svcdef"
|
||||
gogen "github.com/golang/protobuf/protoc-gen-go/generator"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Helper is the base struct for the data structure containing all the
|
||||
// information necessary to correctly template the HTTP transport functionality
|
||||
// of a microservice. Helper must be built from a deftree.
|
||||
// of a service. Helper must be built from a Svcdef.
|
||||
type Helper struct {
|
||||
Methods []*Method
|
||||
PathParamsBuilder string
|
||||
|
@ -31,7 +30,7 @@ type Helper struct {
|
|||
// NewHelper builds a helper struct from a service declaration. The other
|
||||
// "New*" functions in this file are there to make this function smaller and
|
||||
// more testable.
|
||||
func NewHelper(svc *deftree.ProtoService) *Helper {
|
||||
func NewHelper(svc *svcdef.Service) *Helper {
|
||||
// The HTTPAssistFuncs global is a group of function literals defined
|
||||
// within templates.go
|
||||
pp := FormatCode(HTTPAssistFuncs)
|
||||
|
@ -41,7 +40,7 @@ func NewHelper(svc *deftree.ProtoService) *Helper {
|
|||
ClientTemplate: GenClientTemplate,
|
||||
}
|
||||
for _, meth := range svc.Methods {
|
||||
if len(meth.HttpBindings) > 0 {
|
||||
if len(meth.Bindings) > 0 {
|
||||
nMeth := NewMethod(meth)
|
||||
rv.Methods = append(rv.Methods, nMeth)
|
||||
}
|
||||
|
@ -49,14 +48,15 @@ func NewHelper(svc *deftree.ProtoService) *Helper {
|
|||
return &rv
|
||||
}
|
||||
|
||||
// NewMethod builds a Method struct from a deftree.ServiceMethod.
|
||||
func NewMethod(meth *deftree.ServiceMethod) *Method {
|
||||
// NewMethod builds a Method struct from a svcdef.ServiceMethod.
|
||||
func NewMethod(meth *svcdef.ServiceMethod) *Method {
|
||||
nMeth := Method{
|
||||
Name: meth.GetName(),
|
||||
RequestType: meth.RequestType.GetName(),
|
||||
ResponseType: meth.ResponseType.GetName(),
|
||||
Name: meth.Name,
|
||||
RequestType: meth.RequestType.Name,
|
||||
ResponseType: meth.ResponseType.Name,
|
||||
}
|
||||
for i := range meth.HttpBindings {
|
||||
//for i := range meth.HttpBindings {
|
||||
for i := range meth.Bindings {
|
||||
nBinding := NewBinding(i, meth)
|
||||
nBinding.Parent = &nMeth
|
||||
nMeth.Bindings = append(nMeth.Bindings, nBinding)
|
||||
|
@ -64,89 +64,65 @@ func NewMethod(meth *deftree.ServiceMethod) *Method {
|
|||
return &nMeth
|
||||
}
|
||||
|
||||
// NewBinding creates a Binding struct based on a deftree.HttpBinding. Because
|
||||
// NewBinding creates a Binding struct based on a svcdef.HTTPBinding. Because
|
||||
// NewBinding requires access to some of it's parent method's fields, instead
|
||||
// of passing a deftree.HttpBinding directly, you instead pass a
|
||||
// deftree.ServiceMethod and the index of the HttpBinding within that methods
|
||||
// "HttpBindings" slice.
|
||||
func NewBinding(i int, meth *deftree.ServiceMethod) *Binding {
|
||||
binding := meth.HttpBindings[i]
|
||||
// of passing a svcdef.HttpBinding directly, you instead pass a
|
||||
// svcdef.ServiceMethod and the index of the HTTPBinding within that methods
|
||||
// "HTTPBinding" slice.
|
||||
func NewBinding(i int, meth *svcdef.ServiceMethod) *Binding {
|
||||
binding := meth.Bindings[i]
|
||||
nBinding := Binding{
|
||||
Label: meth.GetName() + EnglishNumber(i),
|
||||
Label: meth.Name + EnglishNumber(i),
|
||||
PathTemplate: binding.Path,
|
||||
BasePath: basePath(binding.Path),
|
||||
Verb: binding.Verb,
|
||||
}
|
||||
for _, field := range meth.RequestType.Fields {
|
||||
// Skip map fields, as they're currently incorrectly implemented by
|
||||
// deftree
|
||||
// TODO implement correct map support in http transport
|
||||
if field.IsMap {
|
||||
continue
|
||||
}
|
||||
// Param is specifically an http parameter, while field is a
|
||||
// field in a protobuf msg. nField is a distillation of the
|
||||
// relevant information to translate the http parameter into a
|
||||
// field on a protobuf msg.
|
||||
param := getParam(field.GetName(), binding.Params)
|
||||
// TODO add handling for non-found params here
|
||||
nField := Field{
|
||||
Name: field.GetName(),
|
||||
Location: param.Location,
|
||||
ProtobufType: param.Type,
|
||||
ProtobufLabel: field.Label,
|
||||
LocalName: fmt.Sprintf("%s%s", gogen.CamelCase(field.GetName()), gogen.CamelCase(meth.GetName())),
|
||||
for _, param := range binding.Params {
|
||||
// The 'Field' attr of each HTTPParameter always point to it's bound
|
||||
// Methods RequestType
|
||||
field := param.Field
|
||||
newField := Field{
|
||||
Name: field.Name,
|
||||
CamelName: gogen.CamelCase(field.Name),
|
||||
LowCamelName: LowCamelName(field.Name),
|
||||
Location: param.Location,
|
||||
Repeated: field.Type.ArrayType,
|
||||
GoType: field.Type.Name,
|
||||
LocalName: fmt.Sprintf("%s%s", gogen.CamelCase(field.Name), gogen.CamelCase(meth.Name)),
|
||||
}
|
||||
|
||||
if field.Label == "LABEL_REPEATED" {
|
||||
nField.Repeated = true
|
||||
}
|
||||
var gt string
|
||||
var ok bool
|
||||
tmap := clientarggen.ProtoToGoTypeMap
|
||||
if gt, ok = tmap[nField.ProtobufType]; !ok {
|
||||
nField.IsBaseType = false
|
||||
tn := field.Type.GetName()
|
||||
sections := strings.Split(tn, ".")
|
||||
tn = sections[len(sections)-1]
|
||||
gt = "pb." + tn
|
||||
} else {
|
||||
nField.IsBaseType = true
|
||||
if field.Type.Message == nil && field.Type.Enum == nil && field.Type.Map == nil {
|
||||
newField.IsBaseType = true
|
||||
}
|
||||
|
||||
nField.GoType = gt
|
||||
if nField.Repeated {
|
||||
if nField.IsBaseType {
|
||||
nField.GoType = "[]" + nField.GoType
|
||||
} else {
|
||||
nField.GoType = "[]*" + nField.GoType
|
||||
}
|
||||
// Modify GoType to reflect pointer or repeated status
|
||||
if field.Type.StarExpr && field.Type.ArrayType {
|
||||
newField.GoType = "[]*" + newField.GoType
|
||||
} else if field.Type.ArrayType {
|
||||
newField.GoType = "[]" + newField.GoType
|
||||
}
|
||||
|
||||
nField.ConvertFunc = createDecodeConvertFunc(nField)
|
||||
nField.TypeConversion = createDecodeTypeConversion(nField)
|
||||
newField.ConvertFunc = createDecodeConvertFunc(newField)
|
||||
newField.TypeConversion = createDecodeTypeConversion(newField)
|
||||
|
||||
nField.CamelName = gogen.CamelCase(nField.Name)
|
||||
nField.LowCamelName = LowCamelName(nField.Name)
|
||||
|
||||
nBinding.Fields = append(nBinding.Fields, &nField)
|
||||
nBinding.Fields = append(nBinding.Fields, &newField)
|
||||
|
||||
// Emit warnings for certain cases
|
||||
if !nField.IsBaseType && nField.Location != "body" {
|
||||
if !newField.IsBaseType && newField.Location != "body" {
|
||||
log.Warnf(
|
||||
"%s.%s is a non-base type specified to be located outside of "+
|
||||
"the body. Non-base types outside the body may result in "+
|
||||
"generated code which fails to compile.",
|
||||
meth.GetName(),
|
||||
nField.Name)
|
||||
meth.Name,
|
||||
newField.Name)
|
||||
}
|
||||
if nField.Repeated && nField.Location == "path" {
|
||||
if newField.Repeated && newField.Location == "path" {
|
||||
log.Warnf(
|
||||
"%s.%s is a repeated field specified to be in the path. "+
|
||||
"Repeated fields are not supported in the path and may"+
|
||||
"result in generated code which fails to compile.",
|
||||
meth.GetName(),
|
||||
nField.Name)
|
||||
meth.Name,
|
||||
newField.Name)
|
||||
}
|
||||
}
|
||||
return &nBinding
|
||||
|
@ -330,17 +306,6 @@ func basePath(path string) string {
|
|||
return parts[0]
|
||||
}
|
||||
|
||||
// getParam searches the slice of params for one named `name`, returning the
|
||||
// first it finds. If no params have the given name, returns nil.
|
||||
func getParam(name string, params []*deftree.HttpParameter) *deftree.HttpParameter {
|
||||
for _, p := range params {
|
||||
if p.GetName() == name {
|
||||
return p
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// DigitEnglish is a map of runes of digits zero to nine to their lowercase
|
||||
// english language spellings.
|
||||
var DigitEnglish = map[rune]string{
|
||||
|
|
|
@ -4,7 +4,8 @@ import (
|
|||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/TuneLab/go-truss/deftree"
|
||||
"github.com/TuneLab/go-truss/gengokit/gentesthelper"
|
||||
"github.com/TuneLab/go-truss/svcdef"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
)
|
||||
|
||||
|
@ -13,76 +14,35 @@ var (
|
|||
)
|
||||
|
||||
func TestNewMethod(t *testing.T) {
|
||||
dmeth := deftree.ServiceMethod{
|
||||
Name: "Sum",
|
||||
RequestType: &deftree.ProtoMessage{
|
||||
Name: "SumRequest",
|
||||
//Description: "The sum request contains two parameters.",
|
||||
Fields: []*deftree.MessageField{
|
||||
&deftree.MessageField{
|
||||
Name: "a",
|
||||
Number: 1,
|
||||
Label: "LABEL_OPTIONAL",
|
||||
Type: deftree.FieldType{
|
||||
Name: "TYPE_INT64",
|
||||
},
|
||||
},
|
||||
&deftree.MessageField{
|
||||
Name: "b",
|
||||
Number: 2,
|
||||
Label: "LABEL_OPTIONAL",
|
||||
Type: deftree.FieldType{
|
||||
Name: "TYPE_INT64",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
ResponseType: &deftree.ProtoMessage{
|
||||
Name: "SumReply",
|
||||
Fields: []*deftree.MessageField{
|
||||
&deftree.MessageField{
|
||||
Name: "v",
|
||||
Number: 1,
|
||||
Label: "LABEL_OPTIONAL",
|
||||
Type: deftree.FieldType{
|
||||
Name: "TYPE_INT64",
|
||||
},
|
||||
},
|
||||
&deftree.MessageField{
|
||||
Name: "err",
|
||||
Number: 2,
|
||||
Label: "LABEL_OPTIONAL",
|
||||
Type: deftree.FieldType{
|
||||
Name: "TYPE_STRING",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
HttpBindings: []*deftree.MethodHttpBinding{
|
||||
&deftree.MethodHttpBinding{
|
||||
Verb: "get",
|
||||
Path: "/sum/{a}",
|
||||
Fields: []*deftree.BindingField{
|
||||
&deftree.BindingField{
|
||||
Name: "get",
|
||||
Kind: "get",
|
||||
Value: "/sum/{a}",
|
||||
},
|
||||
},
|
||||
Params: []*deftree.HttpParameter{
|
||||
&deftree.HttpParameter{
|
||||
Name: "a",
|
||||
Location: "path",
|
||||
Type: "TYPE_INT64",
|
||||
},
|
||||
&deftree.HttpParameter{
|
||||
Name: "b",
|
||||
Location: "query",
|
||||
Type: "TYPE_INT64",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
defStr := `
|
||||
syntax = "proto3";
|
||||
|
||||
// General package
|
||||
package general;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
message SumRequest {
|
||||
int64 a = 1;
|
||||
int64 b = 2;
|
||||
}
|
||||
|
||||
message SumReply {
|
||||
int64 v = 1;
|
||||
string err = 2;
|
||||
}
|
||||
|
||||
service SumSvc {
|
||||
rpc Sum(SumRequest) returns (SumReply) {
|
||||
option (google.api.http) = {
|
||||
get: "/sum/{a}"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
sd, err := svcdef.NewFromString(defStr)
|
||||
if err != nil {
|
||||
t.Fatal(err, "Failed to create a service from the definition string")
|
||||
}
|
||||
binding := &Binding{
|
||||
Label: "SumZero",
|
||||
|
@ -91,27 +51,23 @@ func TestNewMethod(t *testing.T) {
|
|||
Verb: "get",
|
||||
Fields: []*Field{
|
||||
&Field{
|
||||
Name: "a",
|
||||
Name: "A",
|
||||
CamelName: "A",
|
||||
LowCamelName: "a",
|
||||
LocalName: "ASum",
|
||||
Location: "path",
|
||||
ProtobufType: "TYPE_INT64",
|
||||
GoType: "int64",
|
||||
ProtobufLabel: "LABEL_OPTIONAL",
|
||||
ConvertFunc: "ASum, err := strconv.ParseInt(ASumStr, 10, 64)",
|
||||
TypeConversion: "ASum",
|
||||
IsBaseType: true,
|
||||
},
|
||||
&Field{
|
||||
Name: "b",
|
||||
Name: "B",
|
||||
CamelName: "B",
|
||||
LowCamelName: "b",
|
||||
LocalName: "BSum",
|
||||
Location: "query",
|
||||
ProtobufType: "TYPE_INT64",
|
||||
GoType: "int64",
|
||||
ProtobufLabel: "LABEL_OPTIONAL",
|
||||
ConvertFunc: "BSum, err := strconv.ParseInt(BSumStr, 10, 64)",
|
||||
TypeConversion: "BSum",
|
||||
IsBaseType: true,
|
||||
|
@ -128,9 +84,10 @@ func TestNewMethod(t *testing.T) {
|
|||
}
|
||||
binding.Parent = meth
|
||||
|
||||
newMeth := NewMethod(&dmeth)
|
||||
newMeth := NewMethod(sd.Service.Methods[0])
|
||||
if got, want := newMeth, meth; !reflect.DeepEqual(got, want) {
|
||||
t.Errorf("methods differ;\ngot = %+v\nwant = %+v\n", got, want)
|
||||
diff := gentesthelper.DiffStrings(spew.Sdump(got), spew.Sdump(want))
|
||||
t.Errorf("got != want; methods differ: %v\n", diff)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -185,7 +185,7 @@ func QueryParams(vals url.Values) (map[string]string, error) {
|
|||
|
||||
// HTTPAssistFuncs is a source code literal of all the helper functions used
|
||||
// for encoding and decoding http request to and from generated protobuf
|
||||
// structs, and is used within the generated code of each microservice.
|
||||
// structs, and is used within the generated code of each service.
|
||||
var HTTPAssistFuncs = PathParamsTemplate + BuildParamMapTemplate + RemoveBracesTemplate + QueryParamsTemplate
|
||||
|
||||
var serverTemplate = `
|
||||
|
@ -221,7 +221,7 @@ var (
|
|||
_ = strconv.Atoi
|
||||
_ = httptransport.NewServer
|
||||
_ = ioutil.NopCloser
|
||||
_ = pb.Register{{.Service.GetName}}Server
|
||||
_ = pb.Register{{.Service.Name}}Server
|
||||
_ = io.Copy
|
||||
)
|
||||
|
||||
|
@ -334,7 +334,7 @@ func headersToContext(ctx context.Context, r *http.Request) context.Context {
|
|||
`
|
||||
|
||||
var clientTemplate = `
|
||||
// Package http provides an HTTP client for the {{.Service.GetName}} service.
|
||||
// Package http provides an HTTP client for the {{.Service.Name}} service.
|
||||
package http
|
||||
|
||||
import (
|
||||
|
|
|
@ -15,28 +15,24 @@ func TestGenClientEncode(t *testing.T) {
|
|||
Verb: "get",
|
||||
Fields: []*Field{
|
||||
&Field{
|
||||
Name: "a",
|
||||
CamelName: "A",
|
||||
LowCamelName: "a",
|
||||
LocalName: "ASum",
|
||||
Location: "path",
|
||||
ProtobufType: "TYPE_INT64",
|
||||
GoType: "int64",
|
||||
ProtobufLabel: "LABEL_OPTIONAL",
|
||||
ConvertFunc: "ASum, err := strconv.ParseInt(ASumStr, 10, 64)",
|
||||
IsBaseType: true,
|
||||
Name: "a",
|
||||
CamelName: "A",
|
||||
LowCamelName: "a",
|
||||
LocalName: "ASum",
|
||||
Location: "path",
|
||||
GoType: "int64",
|
||||
ConvertFunc: "ASum, err := strconv.ParseInt(ASumStr, 10, 64)",
|
||||
IsBaseType: true,
|
||||
},
|
||||
&Field{
|
||||
Name: "b",
|
||||
CamelName: "B",
|
||||
LowCamelName: "b",
|
||||
LocalName: "BSum",
|
||||
Location: "query",
|
||||
ProtobufType: "TYPE_INT64",
|
||||
GoType: "int64",
|
||||
ProtobufLabel: "LABEL_OPTIONAL",
|
||||
ConvertFunc: "BSum, err := strconv.ParseInt(BSumStr, 10, 64)",
|
||||
IsBaseType: true,
|
||||
Name: "b",
|
||||
CamelName: "B",
|
||||
LowCamelName: "b",
|
||||
LocalName: "BSum",
|
||||
Location: "query",
|
||||
GoType: "int64",
|
||||
ConvertFunc: "BSum, err := strconv.ParseInt(BSumStr, 10, 64)",
|
||||
IsBaseType: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -117,9 +113,7 @@ func TestGenServerDecode(t *testing.T) {
|
|||
LowCamelName: "a",
|
||||
LocalName: "ASum",
|
||||
Location: "path",
|
||||
ProtobufType: "TYPE_INT64",
|
||||
GoType: "int64",
|
||||
ProtobufLabel: "LABEL_OPTIONAL",
|
||||
ConvertFunc: "ASum, err := strconv.ParseInt(ASumStr, 10, 64)",
|
||||
TypeConversion: "ASum",
|
||||
IsBaseType: true,
|
||||
|
@ -130,9 +124,7 @@ func TestGenServerDecode(t *testing.T) {
|
|||
LowCamelName: "b",
|
||||
LocalName: "BSum",
|
||||
Location: "query",
|
||||
ProtobufType: "TYPE_INT64",
|
||||
GoType: "int64",
|
||||
ProtobufLabel: "LABEL_OPTIONAL",
|
||||
ConvertFunc: "BSum, err := strconv.ParseInt(BSumStr, 10, 64)",
|
||||
TypeConversion: "BSum",
|
||||
IsBaseType: true,
|
||||
|
|
|
@ -1,16 +1,17 @@
|
|||
package httptransport
|
||||
|
||||
// Method contains the distillation of information within an
|
||||
// deftree.ServiceMethod that's useful for templating http transport.
|
||||
// svcdef.ServiceMethod that's useful for templating http transport.
|
||||
type Method struct {
|
||||
Name string
|
||||
Name string
|
||||
// RequestType is the name of type of the Request, e.g. *EchoRequest
|
||||
RequestType string
|
||||
ResponseType string
|
||||
Bindings []*Binding
|
||||
}
|
||||
|
||||
// Binding contains the distillation of information within an
|
||||
// deftree.HttpBinding that's useful for templating http transport.
|
||||
// svcdef.HTTPBinding that's useful for templating http transport.
|
||||
type Binding struct {
|
||||
// Label is the name of this method, plus the english word for the index of
|
||||
// this binding in this methods slice of bindings. So if this binding where
|
||||
|
@ -31,8 +32,8 @@ type Binding struct {
|
|||
Parent *Method
|
||||
}
|
||||
|
||||
// Field contains the distillation of information within an
|
||||
// deftree.MessageField that's useful for templating http transport.
|
||||
// Field contains the distillation of information within an svcdef.Field that's
|
||||
// useful for templating http transport.
|
||||
type Field struct {
|
||||
Name string
|
||||
// The name of this field, but passed through the CamelCase function.
|
||||
|
@ -48,14 +49,9 @@ type Field struct {
|
|||
LocalName string
|
||||
// The location within the the http request that this field is to be found.
|
||||
Location string
|
||||
// The protobuf type that this field is of.
|
||||
ProtobufType string
|
||||
// The type within the Go language that's used to represent the original
|
||||
// field that this field refers to.
|
||||
GoType string
|
||||
// The protobuf label for the original field that this field refers to. Is
|
||||
// probably "OPTIONAL", though may be "REPEATED".
|
||||
ProtobufLabel string
|
||||
// The string form of the function to be used to convert the incoming
|
||||
// string msg from a string into it's intended type.
|
||||
ConvertFunc string
|
||||
|
|
|
@ -27,7 +27,7 @@ var (
|
|||
_ = strings.Split
|
||||
_ = json.Compact
|
||||
_ = errors.Wrapf
|
||||
_ = pb.Register{{.Service.GetName}}Server
|
||||
_ = pb.Register{{.Service.Name}}Server
|
||||
)
|
||||
|
||||
|
||||
|
@ -40,7 +40,7 @@ func main() {
|
|||
var (
|
||||
httpAddr = flag.String("http.addr", "", "HTTP address of addsvc")
|
||||
grpcAddr = flag.String("grpc.addr", ":5040", "gRPC (HTTP) address of addsvc")
|
||||
method = flag.String("method", "{{range $index, $i := .Service.Methods}}{{if $index}}{{else}}{{ToLower $i.GetName}}{{end}}{{end}}", "{{range $index, $i := .Service.Methods}}{{if $index}},{{end}}{{ToLower $i.GetName}}{{end}}")
|
||||
method = flag.String("method", "{{range $index, $i := .Service.Methods}}{{if $index}}{{else}}{{ToLower $i.Name}}{{end}}{{end}}", "{{range $index, $i := .Service.Methods}}{{if $index}},{{end}}{{ToLower $i.Name}}{{end}}")
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -75,24 +75,24 @@ func main() {
|
|||
switch *method {
|
||||
{{ with $tE := .}}
|
||||
{{range $i := $tE.Service.Methods}}
|
||||
case "{{ToLower $i.GetName}}":
|
||||
{{- with index $tE.ClientArgs.MethArgs $i.GetName -}}
|
||||
case "{{ToLower $i.Name}}":
|
||||
{{- with index $tE.ClientArgs.MethArgs $i.Name -}}
|
||||
var err error
|
||||
{{.MarshalFlags}}
|
||||
{{- end}}
|
||||
request, err := clientHandler.{{$i.GetName}}({{with index $tE.ClientArgs.MethArgs $i.GetName}}{{.CallArgs}}{{end}})
|
||||
request, err := clientHandler.{{$i.Name}}({{with index $tE.ClientArgs.MethArgs $i.Name}}{{.CallArgs}}{{end}})
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error calling clientHandler.{{$i.GetName}}: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Error calling clientHandler.{{$i.Name}}: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
v, err := service.{{$i.GetName}}(context.Background(), request)
|
||||
v, err := service.{{$i.Name}}(context.Background(), request)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error calling service.{{$i.GetName}}: %v\n", err)
|
||||
fmt.Fprintf(os.Stderr, "Error calling service.{{$i.Name}}: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
fmt.Println("Client Requested with:")
|
||||
fmt.Println({{with index $tE.ClientArgs.MethArgs $i.GetName}}{{.CallArgs}}{{end}})
|
||||
fmt.Println({{with index $tE.ClientArgs.MethArgs $i.Name}}{{.CallArgs}}{{end}})
|
||||
fmt.Println("Server Responded with:")
|
||||
fmt.Println(v)
|
||||
{{- end}}
|
||||
|
|
|
@ -52,15 +52,15 @@ func main() {
|
|||
|
||||
// Endpoint domain.
|
||||
{{range $i := .Service.Methods}}
|
||||
var {{ToLower $i.GetName}}Endpoint endpoint.Endpoint
|
||||
var {{ToLower $i.Name}}Endpoint endpoint.Endpoint
|
||||
{
|
||||
{{ToLower $i.GetName}}Endpoint = svc.Make{{$i.GetName}}Endpoint(service)
|
||||
{{ToLower $i.Name}}Endpoint = svc.Make{{$i.Name}}Endpoint(service)
|
||||
// Add endpoint tracing, instrumentation and logging here
|
||||
}
|
||||
{{end}}
|
||||
endpoints := svc.Endpoints{
|
||||
{{range $i := .Service.Methods -}}
|
||||
{{$i.GetName}}Endpoint: {{ToLower $i.GetName}}Endpoint,
|
||||
{{$i.Name}}Endpoint: {{ToLower $i.Name}}Endpoint,
|
||||
{{end}}
|
||||
}
|
||||
|
||||
|
@ -110,7 +110,7 @@ func main() {
|
|||
|
||||
srv := svc.MakeGRPCServer(ctx, endpoints)
|
||||
s := grpc.NewServer()
|
||||
pb.Register{{.Service.GetName}}Server(s, srv)
|
||||
pb.Register{{.Service.Name}}Server(s, srv)
|
||||
|
||||
logger.Log("addr", *grpcAddr)
|
||||
errc <- s.Serve(ln)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Package grpc provides a gRPC client for the {{.Service.GetName}} service.
|
||||
// Package grpc provides a gRPC client for the {{.Service.Name}} service.
|
||||
package grpc
|
||||
|
||||
import (
|
||||
|
@ -17,7 +17,7 @@ import (
|
|||
)
|
||||
|
||||
// New returns an service backed by a gRPC client connection. It is the
|
||||
// responsibility of the caller to dial, and later close, the connection.
|
||||
// responsibility of the caller to dial, and later close, the connection.
|
||||
func New(conn *grpc.ClientConn, options ...ClientOption) (handler.Service, error) {
|
||||
var cc clientConfig
|
||||
|
||||
|
@ -34,25 +34,27 @@ func New(conn *grpc.ClientConn, options ...ClientOption) (handler.Service, error
|
|||
}
|
||||
|
||||
{{- with $tE := .}}
|
||||
{{- range $i := $tE.Service.Methods}}
|
||||
var {{ToLower $i.GetName}}Endpoint endpoint.Endpoint
|
||||
{
|
||||
{{ToLower $i.GetName}}Endpoint = grpctransport.NewClient(
|
||||
conn,
|
||||
"{{TrimPrefix $tE.Service.FullyQualifiedName "."}}",
|
||||
"{{$i.GetName}}",
|
||||
svc.EncodeGRPC{{$i.GetName}}Request,
|
||||
svc.DecodeGRPC{{$i.GetName}}Response,
|
||||
pb.{{GoName $i.ResponseType.GetName}}{},
|
||||
clientOptions...,
|
||||
).Endpoint()
|
||||
}
|
||||
{{- with $pkgName := $tE.PackageName}}
|
||||
{{- range $i := $tE.Service.Methods}}
|
||||
var {{ToLower $i.Name}}Endpoint endpoint.Endpoint
|
||||
{
|
||||
{{ToLower $i.Name}}Endpoint = grpctransport.NewClient(
|
||||
conn,
|
||||
"{{$pkgName}}.{{$tE.Service.Name}}",
|
||||
"{{$i.Name}}",
|
||||
svc.EncodeGRPC{{$i.Name}}Request,
|
||||
svc.DecodeGRPC{{$i.Name}}Response,
|
||||
pb.{{GoName $i.ResponseType.Name}}{},
|
||||
clientOptions...,
|
||||
).Endpoint()
|
||||
}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
return svc.Endpoints{
|
||||
{{range $i := .Service.Methods -}}
|
||||
{{$i.GetName}}Endpoint: {{ToLower $i.GetName}}Endpoint,
|
||||
{{$i.Name}}Endpoint: {{ToLower $i.Name}}Endpoint,
|
||||
{{end}}
|
||||
}, nil
|
||||
}
|
||||
|
|
|
@ -30,27 +30,27 @@ import (
|
|||
// into an Endpoints, and return it to the caller as a Service.
|
||||
type Endpoints struct {
|
||||
{{range $i := .Service.Methods}}
|
||||
{{$i.GetName}}Endpoint endpoint.Endpoint
|
||||
{{$i.Name}}Endpoint endpoint.Endpoint
|
||||
{{- end}}
|
||||
}
|
||||
|
||||
// Endpoints
|
||||
{{range $i := .Service.Methods}}
|
||||
func (e Endpoints) {{$i.GetName}}(ctx context.Context, in *pb.{{GoName $i.RequestType.GetName}}) (*pb.{{GoName $i.ResponseType.GetName}}, error) {
|
||||
response, err := e.{{$i.GetName}}Endpoint(ctx, in)
|
||||
func (e Endpoints) {{$i.Name}}(ctx context.Context, in *pb.{{GoName $i.RequestType.Name}}) (*pb.{{GoName $i.ResponseType.Name}}, error) {
|
||||
response, err := e.{{$i.Name}}Endpoint(ctx, in)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return response.(*pb.{{GoName $i.ResponseType.GetName}}), nil
|
||||
return response.(*pb.{{GoName $i.ResponseType.Name}}), nil
|
||||
}
|
||||
{{end}}
|
||||
|
||||
// Make Endpoints
|
||||
{{range $i := .Service.Methods}}
|
||||
func Make{{$i.GetName}}Endpoint(s handler.Service) endpoint.Endpoint {
|
||||
func Make{{$i.Name}}Endpoint(s handler.Service) endpoint.Endpoint {
|
||||
return func(ctx context.Context, request interface{}) (response interface{}, err error) {
|
||||
req := request.(*pb.{{GoName $i.RequestType.GetName}})
|
||||
v, err := s.{{$i.GetName}}(ctx, req)
|
||||
req := request.(*pb.{{GoName $i.RequestType.Name}})
|
||||
v, err := s.{{$i.Name}}(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -16,49 +16,49 @@ import (
|
|||
)
|
||||
|
||||
|
||||
// MakeGRPCServer makes a set of endpoints available as a gRPC {{GoName .Service.GetName}}Server.
|
||||
func MakeGRPCServer(ctx context.Context, endpoints Endpoints) pb.{{GoName .Service.GetName}}Server {
|
||||
// MakeGRPCServer makes a set of endpoints available as a gRPC {{GoName .Service.Name}}Server.
|
||||
func MakeGRPCServer(ctx context.Context, endpoints Endpoints) pb.{{GoName .Service.Name}}Server {
|
||||
serverOptions := []grpctransport.ServerOption{
|
||||
grpctransport.ServerBefore(metadataToContext),
|
||||
}
|
||||
return &grpcServer{
|
||||
// {{ ToLower .Service.GetName }}
|
||||
// {{ ToLower .Service.Name }}
|
||||
{{range $i := .Service.Methods}}
|
||||
{{ToLower $i.GetName}}: grpctransport.NewServer(
|
||||
{{ToLower $i.Name}}: grpctransport.NewServer(
|
||||
ctx,
|
||||
endpoints.{{$i.GetName}}Endpoint,
|
||||
DecodeGRPC{{$i.GetName}}Request,
|
||||
EncodeGRPC{{$i.GetName}}Response,
|
||||
endpoints.{{$i.Name}}Endpoint,
|
||||
DecodeGRPC{{$i.Name}}Request,
|
||||
EncodeGRPC{{$i.Name}}Response,
|
||||
serverOptions...,
|
||||
),
|
||||
{{- end}}
|
||||
}
|
||||
}
|
||||
|
||||
// grpcServer implements the {{GoName .Service.GetName}}Server interface
|
||||
// grpcServer implements the {{GoName .Service.Name}}Server interface
|
||||
type grpcServer struct {
|
||||
{{range $i := .Service.Methods}}
|
||||
{{ToLower $i.GetName}} grpctransport.Handler
|
||||
{{ToLower $i.Name}} grpctransport.Handler
|
||||
{{- end}}
|
||||
}
|
||||
|
||||
// Methods for grpcServer to implement {{GoName .Service.GetName}}Server interface
|
||||
// Methods for grpcServer to implement {{GoName .Service.Name}}Server interface
|
||||
{{range $i := .Service.Methods}}
|
||||
func (s *grpcServer) {{GoName $i.GetName}}(ctx context.Context, req *pb.{{GoName $i.RequestType.GetName}}) (*pb.{{GoName $i.ResponseType.GetName}}, error) {
|
||||
_, rep, err := s.{{ToLower $i.GetName}}.ServeGRPC(ctx, req)
|
||||
func (s *grpcServer) {{GoName $i.Name}}(ctx context.Context, req *pb.{{GoName $i.RequestType.Name}}) (*pb.{{GoName $i.ResponseType.Name}}, error) {
|
||||
_, rep, err := s.{{ToLower $i.Name}}.ServeGRPC(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return rep.(*pb.{{GoName $i.ResponseType.GetName}}), nil
|
||||
return rep.(*pb.{{GoName $i.ResponseType.Name}}), nil
|
||||
}
|
||||
{{end}}
|
||||
|
||||
// Server Decode
|
||||
{{range $i := .Service.Methods}}
|
||||
// DecodeGRPC{{$i.GetName}}Request is a transport/grpc.DecodeRequestFunc that converts a
|
||||
// gRPC {{ToLower $i.GetName}} request to a user-domain {{ToLower $i.GetName}} request. Primarily useful in a server.
|
||||
func DecodeGRPC{{$i.GetName}}Request(_ context.Context, grpcReq interface{}) (interface{}, error) {
|
||||
req := grpcReq.(*pb.{{GoName $i.RequestType.GetName}})
|
||||
// DecodeGRPC{{$i.Name}}Request is a transport/grpc.DecodeRequestFunc that converts a
|
||||
// gRPC {{ToLower $i.Name}} request to a user-domain {{ToLower $i.Name}} request. Primarily useful in a server.
|
||||
func DecodeGRPC{{$i.Name}}Request(_ context.Context, grpcReq interface{}) (interface{}, error) {
|
||||
req := grpcReq.(*pb.{{GoName $i.RequestType.Name}})
|
||||
return req, nil
|
||||
}
|
||||
{{end}}
|
||||
|
@ -66,20 +66,20 @@ func DecodeGRPC{{$i.GetName}}Request(_ context.Context, grpcReq interface{}) (in
|
|||
|
||||
// Client Decode
|
||||
{{range $i := .Service.Methods}}
|
||||
// DecodeGRPC{{$i.GetName}}Response is a transport/grpc.DecodeResponseFunc that converts a
|
||||
// gRPC {{ToLower $i.GetName}} reply to a user-domain {{ToLower $i.GetName}} response. Primarily useful in a client.
|
||||
func DecodeGRPC{{$i.GetName}}Response(_ context.Context, grpcReply interface{}) (interface{}, error) {
|
||||
reply := grpcReply.(*pb.{{GoName $i.ResponseType.GetName}})
|
||||
// DecodeGRPC{{$i.Name}}Response is a transport/grpc.DecodeResponseFunc that converts a
|
||||
// gRPC {{ToLower $i.Name}} reply to a user-domain {{ToLower $i.Name}} response. Primarily useful in a client.
|
||||
func DecodeGRPC{{$i.Name}}Response(_ context.Context, grpcReply interface{}) (interface{}, error) {
|
||||
reply := grpcReply.(*pb.{{GoName $i.ResponseType.Name}})
|
||||
return reply, nil
|
||||
}
|
||||
{{end}}
|
||||
|
||||
// Server Encode
|
||||
{{range $i := .Service.Methods}}
|
||||
// EncodeGRPC{{$i.GetName}}Response is a transport/grpc.EncodeResponseFunc that converts a
|
||||
// user-domain {{ToLower $i.GetName}} response to a gRPC {{ToLower $i.GetName}} reply. Primarily useful in a server.
|
||||
func EncodeGRPC{{$i.GetName}}Response(_ context.Context, response interface{}) (interface{}, error) {
|
||||
resp := response.(*pb.{{GoName $i.ResponseType.GetName}})
|
||||
// EncodeGRPC{{$i.Name}}Response is a transport/grpc.EncodeResponseFunc that converts a
|
||||
// user-domain {{ToLower $i.Name}} response to a gRPC {{ToLower $i.Name}} reply. Primarily useful in a server.
|
||||
func EncodeGRPC{{$i.Name}}Response(_ context.Context, response interface{}) (interface{}, error) {
|
||||
resp := response.(*pb.{{GoName $i.ResponseType.Name}})
|
||||
return resp, nil
|
||||
}
|
||||
{{end}}
|
||||
|
@ -87,10 +87,10 @@ func EncodeGRPC{{$i.GetName}}Response(_ context.Context, response interface{}) (
|
|||
|
||||
// Client Encode
|
||||
{{range $i := .Service.Methods}}
|
||||
// EncodeGRPC{{$i.GetName}}Request is a transport/grpc.EncodeRequestFunc that converts a
|
||||
// user-domain {{ToLower $i.GetName}} request to a gRPC {{ToLower $i.GetName}} request. Primarily useful in a client.
|
||||
func EncodeGRPC{{$i.GetName}}Request(_ context.Context, request interface{}) (interface{}, error) {
|
||||
req := request.(*pb.{{GoName $i.RequestType.GetName}})
|
||||
// EncodeGRPC{{$i.Name}}Request is a transport/grpc.EncodeRequestFunc that converts a
|
||||
// user-domain {{ToLower $i.Name}} request to a gRPC {{ToLower $i.Name}} request. Primarily useful in a client.
|
||||
func EncodeGRPC{{$i.Name}}Request(_ context.Context, request interface{}) (interface{}, error) {
|
||||
req := request.(*pb.{{GoName $i.RequestType.Name}})
|
||||
return req, nil
|
||||
}
|
||||
{{end}}
|
||||
|
|
|
@ -7,10 +7,10 @@ import (
|
|||
|
||||
|
||||
{{range $i := $templateExecutor.Service.Methods}}
|
||||
// {{$i.GetName}} implements Service.
|
||||
func {{$i.GetName}}({{with index $templateExecutor.ClientArgs.MethArgs $i.GetName}}{{GoName .FunctionArgs}}{{end}}) (*pb.{{GoName $i.RequestType.GetName}}, error){
|
||||
// {{$i.Name}} implements Service.
|
||||
func {{$i.Name}}({{with index $templateExecutor.ClientArgs.MethArgs $i.Name}}{{GoName .FunctionArgs}}{{end}}) (*pb.{{GoName $i.RequestType.Name}}, error){
|
||||
{{/*
|
||||
{{- with $meth := index $templateExecutor.ClientArgs.MethArgs $i.GetName -}}
|
||||
{{- with $meth := index $templateExecutor.ClientArgs.MethArgs $i.Name -}}
|
||||
{{- range $param := $meth.Args -}}
|
||||
{{- if not $param.IsBaseType -}}
|
||||
// Add custom business logic for interpreting {{$param.FlagArg}},
|
||||
|
@ -18,8 +18,8 @@ func {{$i.GetName}}({{with index $templateExecutor.ClientArgs.MethArgs $i.GetNam
|
|||
{{- end -}}
|
||||
{{- end}}
|
||||
*/}}
|
||||
request := pb.{{GoName $i.RequestType.GetName}}{
|
||||
{{- with $meth := index $templateExecutor.ClientArgs.MethArgs $i.GetName -}}
|
||||
request := pb.{{GoName $i.RequestType.Name}}{
|
||||
{{- with $meth := index $templateExecutor.ClientArgs.MethArgs $i.Name -}}
|
||||
{{range $param := $meth.Args -}}
|
||||
{{- if and (and (not $param.IsBaseType) (not $param.Repeated)) (not $param.Enum)}}
|
||||
{{GoName $param.Name}} : &{{GoName $param.GoArg}},
|
||||
|
|
|
@ -28,13 +28,13 @@ type {{.PackageName}}Service struct{}
|
|||
{{with $PackageName := $Executor.PackageName}}
|
||||
|
||||
{{range $i := $Executor.Service.Methods}}
|
||||
// {{$i.GetName}} implements Service.
|
||||
func (s {{$PackageName}}Service) {{$i.GetName}}(ctx context.Context, in *pb.{{GoName $i.RequestType.GetName}}) (*pb.{{GoName $i.ResponseType.GetName}}, error){
|
||||
// {{$i.Name}} implements Service.
|
||||
func (s {{$PackageName}}Service) {{$i.Name}}(ctx context.Context, in *pb.{{GoName $i.RequestType.Name}}) (*pb.{{GoName $i.ResponseType.Name}}, error){
|
||||
_ = ctx
|
||||
_ = in
|
||||
response := pb.{{GoName $i.ResponseType.GetName}}{
|
||||
{{range $j := $i.ResponseType.Fields -}}
|
||||
// {{GoName $j.GetName }}:
|
||||
response := pb.{{GoName $i.ResponseType.Name}}{
|
||||
{{range $j := $i.ResponseType.Message.Fields -}}
|
||||
// {{GoName $j.Name }}:
|
||||
{{end -}}
|
||||
}
|
||||
return &response, nil
|
||||
|
@ -45,6 +45,6 @@ func (s {{$PackageName}}Service) {{$i.GetName}}(ctx context.Context, in *pb.{{Go
|
|||
|
||||
type Service interface {
|
||||
{{range $i := .Service.Methods}}
|
||||
{{$i.GetName}}(ctx context.Context, in *pb.{{GoName $i.RequestType.GetName}}) (*pb.{{GoName $i.ResponseType.GetName}}, error)
|
||||
{{$i.Name}}(ctx context.Context, in *pb.{{GoName $i.RequestType.Name}}) (*pb.{{GoName $i.ResponseType.Name}}, error)
|
||||
{{- end}}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
{{ with $templateExecutor := .}}
|
||||
|
||||
{{range $i := $templateExecutor.Service.Methods}}
|
||||
// {{$i.GetName}} implements Service.
|
||||
func {{$i.GetName}}({{with index $templateExecutor.ClientArgs.MethArgs $i.GetName}}{{GoName .FunctionArgs}}{{end}}) (*pb.{{GoName $i.RequestType.GetName}}, error){
|
||||
{{- with $meth := index $templateExecutor.ClientArgs.MethArgs $i.GetName -}}
|
||||
// {{$i.Name}} implements Service.
|
||||
func {{$i.Name}}({{with index $templateExecutor.ClientArgs.MethArgs $i.Name}}{{GoName .FunctionArgs}}{{end}}) (*pb.{{GoName $i.RequestType.Name}}, error){
|
||||
{{- with $meth := index $templateExecutor.ClientArgs.MethArgs $i.Name -}}
|
||||
{{- range $param := $meth.Args -}}
|
||||
{{- if not $param.IsBaseType -}}
|
||||
// Add custom business logic for interpreting {{$param.FlagArg}},
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
request := pb.{{GoName $i.RequestType.GetName}}{
|
||||
{{- with $meth := index $templateExecutor.ClientArgs.MethArgs $i.GetName -}}
|
||||
request := pb.{{GoName $i.RequestType.Name}}{
|
||||
{{- with $meth := index $templateExecutor.ClientArgs.MethArgs $i.Name -}}
|
||||
{{range $param := $meth.Args -}}
|
||||
{{- if $param.IsBaseType}}
|
||||
{{GoName $param.Name}} : {{GoName $param.FlagArg}},
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
type Service interface {
|
||||
{{range $i := .Service.Methods}}
|
||||
{{$i.GetName}}(ctx context.Context, in *pb.{{GoName $i.RequestType.GetName}}) (*pb.{{GoName $i.ResponseType.GetName}}, error)
|
||||
{{$i.Name}}(ctx context.Context, in *pb.{{GoName $i.RequestType.Name}}) (*pb.{{GoName $i.ResponseType.Name}}, error)
|
||||
{{- end}}
|
||||
}
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
{{ with $PackageName := $templateExecutor.PackageName}}
|
||||
|
||||
{{range $i := $templateExecutor.Service.Methods}}
|
||||
// {{.GetName}} implements Service.
|
||||
func (s {{$PackageName}}Service) {{.GetName}}(ctx context.Context, in *pb.{{GoName .RequestType.GetName}}) (*pb.{{GoName .ResponseType.GetName}}, error){
|
||||
// {{.Name}} implements Service.
|
||||
func (s {{$PackageName}}Service) {{.Name}}(ctx context.Context, in *pb.{{GoName .RequestType.Name}}) (*pb.{{GoName .ResponseType.Name}}, error){
|
||||
_ = ctx
|
||||
_ = in
|
||||
response := pb.{{GoName .ResponseType.GetName}}{
|
||||
response := pb.{{GoName .ResponseType.Name}}{
|
||||
{{range $j := $i.ResponseType.Fields -}}
|
||||
// {{GoName $j.GetName }}:
|
||||
// {{GoName $j.Name }}:
|
||||
{{end -}}
|
||||
}
|
||||
return &response, nil
|
||||
|
|
|
@ -79,7 +79,7 @@ func (fi bindataFileInfo) Sys() interface{} {
|
|||
return nil
|
||||
}
|
||||
|
||||
var _nameServiceNameClientClient_mainGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x56\xd1\x6f\xdb\xb6\x13\x7e\x16\xff\x8a\xab\x90\x02\x72\xe1\xd2\xfd\x01\xbf\xbd\x18\xf0\x43\x9b\xa5\x6b\x80\xb5\x30\xe2\x00\x7d\x29\x30\x30\xe4\x49\xe2\x22\x91\x2a\x49\x2b\x09\x04\xfd\xef\xc3\x51\xb2\x6c\x27\x4e\xb3\x6e\x2b\xd0\x48\x3c\xde\x7d\x77\xbc\xfb\x3e\xca\x8d\x90\xb7\xa2\x40\xa8\x85\x36\x8c\xe9\xba\xb1\x2e\x40\xc6\x92\x14\x8d\xb4\x4a\x9b\x62\xf1\xa7\xb7\x26\x65\x49\x9a\x57\xa2\x88\xcf\x3a\xd0\xc3\x7a\xfa\xeb\x83\x93\xd6\xb4\xe3\xab\x36\x45\xb4\x06\x5d\x63\xca\x58\x92\x16\xb6\x12\xa6\xe0\xd6\x15\x8b\xfb\x85\xc1\xb0\x90\xd6\x04\xbc\x8f\x00\x85\xb5\x45\x85\xfc\xc0\xa5\x70\x8d\x1c\xc2\x74\x28\xb7\x37\x5c\xda\x7a\xd1\xdc\x16\x0b\x74\xce\x3a\x4f\x3b\x8b\x05\x5c\x97\xda\xc3\x06\x5d\xab\x25\xb2\xa4\x14\x46\x55\xe8\x20\xed\x3a\x7e\x19\x8b\x5f\x8b\x50\xc2\xdb\xbe\x87\xc5\xb8\xe7\x17\x1e\x5d\x8b\x2e\x65\x89\xac\x34\x9a\xf0\xe9\xef\xc4\x0c\xae\x29\x4b\xa8\xa8\x61\x71\x32\xa0\x40\x83\x4e\x04\x54\x63\xc4\x78\x88\xa4\x0c\xa1\xf9\x99\x30\xf2\x4f\x59\xd2\xdc\x44\xf7\xf5\x87\xe3\x80\x94\xcd\x18\x6b\x85\xa3\xc9\xfc\x01\x2b\x18\xdb\xce\xd7\xc2\x79\xbc\x34\x61\xb2\xd2\x04\xf8\xa6\xa9\xf4\x68\xa2\xe1\xf1\x73\x5b\x37\x42\x8e\x96\xa1\x99\xfc\xab\x13\x4d\x3e\x58\x9a\x1b\x7e\x85\x85\xf6\x01\x5d\xd7\xf1\xb1\xb5\xfc\x37\x0c\x5f\x44\x8d\x7d\xbf\x89\xdd\xa3\x02\x58\xbe\x35\x32\x32\x25\x9b\x41\x37\x4e\x03\x41\x28\x25\x2b\x0d\x8d\x43\xbf\xad\xd1\x83\xb1\xe0\x07\x10\x50\xda\x4b\xdb\xa2\x7b\x00\xff\xe0\x03\xd6\x73\x10\x46\x01\xde\x37\x28\x83\x87\xad\x47\xe7\x21\xd8\x88\xd4\x38\xdb\x6a\x85\x10\x4a\x0a\x73\x28\x03\x01\x3b\xf4\x1e\x6c\x0e\xc2\xec\x30\xf9\xc0\x80\x21\x5b\x13\xb4\x35\xa0\x3d\x38\xcc\x2b\x94\x01\x15\x68\x13\xe1\x08\x86\xaa\xba\xd1\x46\xb8\x87\x98\x96\x4c\xa3\x99\xc6\x32\x32\xdf\x2f\xa3\xf1\x6d\x70\xc2\x78\xea\x39\xa7\xb4\x40\x6c\xf7\x11\x89\x42\x5b\xe1\xb4\xdd\xfa\x5d\xa8\xb4\xc6\x07\xb7\x95\xc1\x3a\x0f\x37\x36\x94\xe3\x91\xa0\xb4\x3e\x2c\xa3\x84\x76\xb3\x60\x2c\x19\xe7\x16\x29\xf1\x9e\xb0\x87\x7f\xab\x98\x83\x6f\xa2\x63\x96\xd2\x6e\x4c\x9d\xce\x21\xa5\xff\x9f\xae\xaf\xd7\x47\x2d\x50\xca\xb7\x32\x9d\xb1\x24\x72\xf2\x79\x24\xda\x9d\x90\x96\xbf\xbc\xfb\xff\x3b\x7a\x29\xae\xd6\xe7\x90\x11\xe8\xec\x19\xd4\x1a\x43\x69\x15\xc0\x69\xd4\x61\x97\x90\xba\xce\x09\x53\x20\x9c\x69\xa3\xf0\x7e\x0e\x67\x1a\x96\x2b\x98\x88\xf3\x39\x3a\xfa\xbe\xef\x3a\x9d\x8f\x4e\xb4\xc0\xca\x23\x3d\xaf\xed\xef\xf6\x0e\x1d\x9c\xe9\x3d\xc7\xba\x0e\x8d\x9a\x1e\xe9\x3c\xf9\x67\x49\xe6\x13\xce\x0f\x92\xd0\x59\x67\x07\x63\xe9\x3a\x7e\x1e\xc7\xfa\xde\x15\x9e\xbf\xaf\xaa\x8f\x34\xfa\xbe\x27\xaf\x24\xb6\x20\xaa\x2c\x23\x01\x4c\x41\x3b\x82\x8f\xf7\x05\x9f\x2e\xa4\x04\xdd\x30\x96\xa8\xb3\x88\xa1\x73\x78\x33\xcd\xfe\xd5\x0a\xd2\x94\xc4\xb3\x83\x98\x93\x27\xac\x60\x7f\x61\xf0\x2f\x78\x97\x4d\x11\x33\x96\xf4\x40\xbd\x03\xc2\x99\x26\xbf\xc7\x91\xd6\x98\x01\x64\xb9\x82\x38\xfb\x5f\xb5\xa8\xb2\xc9\x75\x3e\x18\xbf\xea\x50\x5e\x1a\x8f\x72\xeb\x30\x9b\x1d\x18\xaf\x75\x8d\x76\x1b\x32\xba\xb4\xf9\x06\xa5\x35\x6a\x46\x74\xd0\x79\x04\x7d\xb5\x02\xa3\xab\x98\x29\xc9\xeb\xc0\x3f\x36\x4e\x9b\x90\x67\xd6\xf3\x4d\x50\xe8\xdc\x1c\xd2\x0b\x3a\x2b\xdc\x95\xba\x22\xed\x8a\x4a\x9b\x22\xe2\x93\x50\x0c\x4a\x12\xe9\x12\x5e\xb7\x69\x2c\x93\xb0\x13\xeb\xf9\xc5\xbd\x0e\xd9\xff\x68\xd5\xb3\x24\x51\x98\xa3\x8b\xfe\xfc\xbc\xb2\xb1\xdd\x4f\x5a\xb4\xbf\x8a\x63\x8b\xc8\x79\xdf\x1d\x2a\xf0\xb9\xfa\xe2\x2c\x96\x74\x31\x39\xac\x6d\xc0\x49\x00\xbe\x41\xa9\x73\x8d\xea\x9b\x89\x12\x38\x2c\xab\x67\x27\x5a\xf0\x42\x86\xd7\xed\x37\xb3\x3f\xe5\x31\x1a\x4b\xfc\x9d\x0e\xb2\x84\x37\xa3\xd0\x3a\xd6\x75\x70\xa7\x43\x09\x67\xe1\x22\xb2\x9b\x48\xb7\x27\x3e\x99\xce\xc2\xc5\x53\xce\xd3\xd0\x85\x47\x52\xe2\x29\x9e\xa7\x4b\xea\x70\xd7\xbd\x1d\xc0\xa3\x36\x22\xd0\x01\xcd\x09\x8b\x5e\x0e\x02\xe9\x3b\x43\x81\x91\xe3\x74\xec\x91\xc1\x11\x8b\x7f\x16\xce\x97\x62\xaf\x8d\x21\x41\x14\x14\x2d\x1c\x7e\xdf\xa2\x0f\x13\x0f\x8f\xbe\xb4\xbc\xeb\x0e\xeb\xcb\xba\xee\xa7\x0a\x23\xe5\xf2\x73\x51\x55\x64\x9f\x64\x1c\x69\x74\x82\xa3\x2f\x90\x54\x8a\x2a\xd2\xf3\x47\x05\x3e\x9e\xe3\x23\xba\xc6\x59\x26\x49\x3b\x1d\x76\xf7\x65\x7a\x74\xcc\xf1\xb7\x0e\xff\x20\xe4\x6d\xe1\xec\xd6\x28\xd2\xdd\xd8\xa9\x7f\x59\xfe\xe9\x94\x2f\x17\x3e\x26\x58\x13\x7e\x65\xb2\x74\xe8\x3c\x5c\x0d\x45\xa1\x8a\x94\x59\x46\x2d\x1c\x39\xfe\x77\x23\x3b\x4a\x3f\xfc\xb6\x80\x2b\xf4\x8d\x35\xea\xf9\xf4\xed\x8c\x1d\xf0\xed\x80\x79\x0a\x73\xb1\xad\xc2\xf2\x65\x69\x6a\xd3\x8a\x4a\x2b\x18\xc5\xf7\xfa\x7b\x6c\xd4\xb0\x7a\x2a\xd6\x9e\xb1\xbf\x02\x00\x00\xff\xff\xf6\xa8\x3c\xa8\x1a\x0b\x00\x00")
|
||||
var _nameServiceNameClientClient_mainGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x56\xdf\x6f\xdb\x36\x10\x7e\xb6\xfe\x8a\x9b\x90\x00\x72\xe1\xd0\x1d\xb0\xbd\x18\xc8\x43\x9a\xa5\x68\x80\xb5\x30\x92\x00\x7d\x19\x30\x30\x12\x2d\x71\x95\x48\x95\xa4\x9c\x14\x82\xff\xf7\xdd\x9d\x68\xd9\x6e\x6c\xa4\xfb\x51\xa0\x91\x44\xdd\x7d\x77\xfc\xbe\xef\x28\xb7\x32\xff\x22\x4b\x05\x8d\xd4\x26\x49\x74\xd3\x5a\x17\x20\x4b\x26\xa9\x32\xb9\x2d\xb4\x29\xe7\x7f\x79\x6b\x52\x5c\x58\xd5\xb2\xe4\x6b\x13\xe8\x62\x3d\xfd\xf5\xc1\xe5\xd6\xac\xe3\x2d\x86\xf3\x6a\xd0\x8d\x4a\x13\xbc\x29\x6d\x2d\x4d\x29\xac\x2b\xe7\xcf\x73\xa3\xc2\x1c\x83\x83\x7a\x66\x80\xd2\xda\xb2\x56\x62\x2f\xa4\x74\x6d\x3e\xa4\xe9\x50\x75\x8f\x22\xb7\xcd\xbc\xfd\x52\xce\x95\x73\xd6\x79\x7a\x33\x9f\xc3\x43\xa5\x3d\xdc\x2b\xb7\xd6\xb9\x4a\x26\x95\x34\x45\xad\x1c\xa4\x7d\x2f\x6e\xb9\xf9\xa5\x0c\x15\x5c\x6c\x36\x30\x8f\xef\xfc\xdc\x63\xb4\x72\x58\x33\xaf\xb5\x32\xe1\xc3\x8f\xe4\x0c\xa1\x98\x43\x4d\x0d\x0f\x47\x13\x4a\x65\x94\x93\x41\x15\x31\x23\x6e\x62\x52\x85\xd0\xfe\x93\x34\x8a\xc7\xb4\xf6\x91\xc3\x97\xef\x0e\x13\xd2\x64\x9a\x24\x6b\xe9\x48\x99\x3f\xe1\x12\x22\xed\x62\x29\x9d\x57\xb7\x26\x8c\xab\xa4\x80\xb8\x6f\x6b\x1d\x97\x48\x3c\x71\x6d\x1b\x94\x39\xae\x0c\x64\x8a\xcf\x4e\xb6\xab\x61\xa5\x7d\x14\x77\xaa\xd4\x3e\x28\x87\xa5\x23\xb5\xe2\x93\x6c\xd4\x66\x73\xcf\xd4\x51\xf5\x64\xd5\x99\x9c\x6d\x92\x4d\xa1\x8f\x52\x28\x90\x45\x81\x3b\x80\xd6\x29\xdf\x35\xca\x83\xb1\xe0\x07\x04\x28\xb4\xcf\x2d\x66\x7f\x03\xff\x0d\xc1\x9b\x19\x20\xb9\xa0\x9e\x5b\x95\x07\x0f\x1d\x86\x79\x08\x96\x91\x5a\x67\xd7\xba\x50\x10\x2a\x4a\x73\x18\x40\xc0\x88\xe9\xc1\xae\x30\x6d\x8b\x29\x06\xf9\x87\x6a\x6d\xd0\xd6\x00\x3e\x3a\xb5\xaa\x31\x45\x15\x80\x1e\x26\x38\x82\xa1\xae\x1e\xb5\x91\x58\x9e\xca\xd2\x52\x5c\x26\x4d\xa2\xed\xfd\x82\x17\x2f\x82\x93\xc6\x13\xe1\x82\xca\x02\x59\xdd\x33\x12\xa5\x22\xef\xda\x76\x7e\x9b\x8a\xc4\x23\xd1\x5d\x1e\x90\x46\x78\xb4\x28\xd0\xb0\x25\xa8\xac\x0f\x0b\x9e\x9f\xad\x10\xe8\xd8\x28\x1a\xfb\xe1\x8a\xb0\x87\x7f\x97\x5c\x43\xdc\x73\x60\x96\xd2\x5b\x2e\x9d\xce\x20\xa5\xff\x1f\x1e\x1e\x96\x07\x14\x14\x85\x5f\xe7\xe9\x14\x91\xc8\x60\xa7\x91\xe8\xed\x88\xb4\xf8\xf5\xed\x2f\x6f\xe9\xa6\xbc\x5b\x5e\x43\x46\xa0\xd3\x13\xa8\x8d\x0a\x95\x2d\x00\x8e\xa3\x0e\x6f\x09\xa9\xef\x91\x2a\x3c\x2f\xce\xb4\x29\xd4\xf3\x0c\xaf\xb0\xb8\x84\xd1\x35\x1f\x39\xd0\x6f\x36\x7d\xaf\x57\x31\x88\x1e\x54\xed\x15\x5d\x1f\xec\xef\xf6\x09\x67\xef\x4c\x47\x83\xe1\x2b\x53\x8c\x97\x74\x36\xf9\x77\x15\x66\x23\xce\xa9\x0a\xb4\xcb\xe9\x9e\x20\x68\xf5\x6b\x16\xf4\xca\xa1\x52\x57\x75\xfd\x9e\x44\xdf\x6c\x28\x6a\xc2\x9b\xe7\xe1\xca\xc8\xfa\x63\xd2\xd6\xda\xf1\x98\x10\xe3\x39\x34\xc1\xb1\x62\xe2\x78\xbc\x18\x03\xbb\x7b\x33\xaa\xfe\xd3\x25\xea\x4a\x63\xb3\x85\x98\x51\x24\xd2\xbc\x3b\x27\xc4\x27\xf5\x94\x8d\x19\x08\xb0\x01\x62\x0d\x08\x67\xd4\x7c\x87\x83\x36\x34\x03\x08\xb2\xc3\xaa\xff\xa6\x65\x9d\x8d\xa1\xb3\x61\xf1\x33\x1e\xa5\xb7\xc6\xab\xbc\x73\xb8\x97\xbd\xc5\x07\x3c\xa3\x6d\x17\x32\x3a\xab\x71\x1f\x08\x57\x4c\xc9\x08\x58\x8e\x40\xb1\x90\xd1\x35\x57\x9a\xe0\x89\x2f\xde\xb7\xe8\x84\xb0\xca\x2c\x1e\x2f\xa1\xc0\x08\xf4\xc2\x0d\xed\x15\x9e\x2a\x5d\xd3\xd4\xca\x1a\xad\xc2\xf8\x34\x22\x06\x27\x02\xc7\x73\x01\xe7\xeb\x94\xdb\x24\xec\x09\x66\xdf\x3c\xeb\x90\xfd\x4c\x4f\x48\xf5\xa4\x50\x2b\xd4\x8a\xe2\x51\x0d\xcb\x74\xbf\xa0\x68\x77\x02\x33\x45\x14\xbc\x63\x87\x1a\x3c\xd5\x1f\x6b\xb1\xa0\x23\xc9\xa9\xc6\x06\x35\x5a\xdf\xe3\xbc\xea\x95\x56\xc5\x1f\x86\xcd\xbf\xdf\xd6\x26\x39\x42\xc1\x2b\x15\xce\xd7\x08\x34\xee\xf2\x10\x2d\x99\xf8\x27\x1d\xf2\x0a\xde\xc4\x11\xeb\x93\xbe\x07\x5c\xaa\xe0\x2c\xdc\xb0\xb5\xc9\x74\x3b\xd7\xd3\x12\xbe\x79\x69\x78\x12\x5d\xe2\x96\xd3\x23\x26\x4f\x17\x44\x6f\xdf\x5f\x0c\xc8\x3c\x15\x8c\xb2\xe7\x71\x02\xa2\x9b\x6d\x16\x7d\x58\x28\x8b\xdd\x4d\x1b\x8e\xde\x65\x20\xf1\x11\xdd\x5f\xc9\xdd\x54\x0c\xe8\x3c\x4a\xf4\xe0\xd4\xd7\x4e\xf9\x30\x3a\xf0\xe0\xd3\x2a\xfa\x7e\xec\x2c\xeb\xfb\x1f\x6f\x89\xa6\x55\x5c\xcb\xba\xa6\xc5\x71\x74\xd9\x3a\x47\x7c\xf9\x8a\x31\x73\xc4\x21\x4b\x9e\x6c\xed\x7b\xe1\xbe\xf3\x27\x8b\x87\xec\x8c\x7b\xdc\x7e\x84\xf6\x77\x17\x7f\xd0\x88\x77\xf8\x41\x29\x9d\xed\x4c\x41\x53\x16\xd9\xf9\x8f\x8d\x1f\xa9\xf7\x7a\xcb\x11\x7d\x49\xe0\xb5\xc9\xd2\x81\x6d\xb8\x1b\x3a\xc2\x6f\x24\xa9\xb1\x60\xdb\x1f\x04\xfe\x4f\x32\x1d\xd4\x1e\x7e\x3d\x60\x6d\xfc\xb6\x22\xee\xc9\xda\xeb\x69\xb2\xe7\xae\x3d\x9f\xe1\xf1\x20\xbb\x3a\x2c\x5e\x1f\x41\x6d\xd6\x78\x00\x15\x10\x87\xec\xfc\x2b\xb3\x34\x3c\xbd\x1c\x4a\x54\xf6\xef\x00\x00\x00\xff\xff\xe6\x1b\x01\x58\xf9\x0a\x00\x00")
|
||||
|
||||
func nameServiceNameClientClient_mainGotemplateBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -94,12 +94,12 @@ func nameServiceNameClientClient_mainGotemplate() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/NAME-client/client_main.gotemplate", size: 2842, mode: os.FileMode(436), modTime: time.Unix(1477698725, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/NAME-client/client_main.gotemplate", size: 2809, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServiceNameServerServer_mainGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x56\x4d\x6f\xe3\x36\x10\x3d\x8b\xbf\x82\x2b\x6c\x01\xa9\x50\xa8\x2d\xda\xed\x21\x58\x1f\x12\x6f\x9a\x0d\x9a\x04\x46\xe2\xa2\x67\x5a\x1a\xd3\x44\x24\x52\x20\x29\xc7\x81\xe0\xff\x5e\x0c\x45\x29\x72\xe0\x38\x3d\xec\x02\x6b\x49\x9c\xc7\xc7\x79\xc3\xf9\x48\xc3\x8b\x27\x2e\x80\xd6\x5c\x2a\x42\x64\xdd\x68\xe3\x68\x42\xa2\x78\x5d\x71\x11\xe3\xb3\x76\xf8\x50\x30\x3c\xf2\x8d\x73\xcd\xf4\x3d\x6f\x1a\xa3\xd7\xb8\xa2\x6d\xff\x9b\x5b\x29\x14\xaf\xf0\xc3\xbe\xd8\x82\x57\x55\x4c\x48\x94\xe7\xf4\xf7\x92\x2e\xb8\x71\x2f\x24\x8a\x85\xae\xb8\x12\x4c\x1b\x91\xef\x72\xa4\x2a\xb4\x72\xb0\xf3\xa7\x08\xad\x45\x05\x6c\x02\x11\xa6\x29\x02\xc7\xb5\xa6\x7f\x4b\x87\x28\xe9\x36\xed\x8a\x15\xba\xce\x85\x3e\x7b\x92\x2e\xc7\xff\xa0\xca\x46\x4b\xd5\xf3\x1c\x45\x54\x5a\x04\xaa\xe5\x46\x5a\xfa\x08\x66\x2b\x0b\x20\xd1\x86\xab\xb2\x02\x43\xe3\xae\x63\x37\x3e\x10\x0b\xee\x36\xf4\x6c\xbf\xa7\x79\xb0\xd9\xdc\x82\xd9\x82\x89\x49\x64\xb7\xc5\x51\xa4\x00\x05\x86\x3b\x28\x63\x12\x35\x2b\x0f\x59\x5c\x1e\x82\x62\x42\x52\x42\xd6\xad\x2a\x7c\xd8\x93\x94\x76\x24\xda\x72\x83\x71\x8f\x4a\x58\xb5\xe2\xa2\x2c\x0d\xf5\xff\x66\x14\x2f\x82\x3d\x3a\x23\x95\x48\x62\x6f\x65\xbc\x2c\x4d\x9c\xd1\xf8\xfc\xeb\x97\x3f\xbf\xe0\xcb\x77\x5c\xa6\x5c\x95\xb4\x06\x67\x64\x61\x69\x25\xad\x03\x45\x11\x09\xd6\xc6\x29\x89\x22\xbc\xab\x57\xe2\xb7\xcc\x68\x9d\x12\x7f\xf5\xc4\x3f\x96\xcb\xc5\x31\x2e\xbc\x8f\xf7\xb9\xd0\x3a\xe5\xfa\xc3\x73\x89\x87\xc5\x9c\x26\xc8\x98\x1e\xa1\x4c\x49\xe4\x39\x16\xdc\x58\x48\xd2\xfe\x82\x6e\xb5\x10\x52\x09\x5a\x6a\x0c\x14\xeb\xa3\x54\x69\x21\xc0\x3f\xd8\xad\x7f\x25\x51\x47\xa2\x28\x2c\xcf\xbc\xe1\x1e\x9e\x6f\xb5\x58\xd7\xae\x47\x24\xda\xb2\x47\x57\xea\xd6\xa5\x47\x90\xf3\x3e\xf3\x92\x7e\x3d\x65\xff\x4a\xb7\x49\x62\x67\xe3\xcc\x23\xbe\xc3\x9a\xb7\x95\x5b\xca\x1a\xac\xe3\x75\xf3\xcf\x72\xfe\xff\x59\x30\xf9\xc1\x1c\x32\xcd\xfd\x5a\x4a\xa2\x3d\x09\x2c\x28\x24\x89\x6b\x2b\x30\x4e\x1b\xa8\x2a\x8d\x21\x29\x61\x0d\x83\xdc\x03\x84\xd0\xba\x5c\xbd\x40\x1c\xa2\x74\xd9\x5a\xa9\xc0\xda\xc3\x30\xd9\x3e\xaf\x69\x48\x5d\x36\xe6\x39\x06\x6b\x30\xce\x46\xf3\x3d\x3c\x07\x44\x82\xea\xf2\x1c\x2f\x67\x24\xa9\xc2\x45\x4c\x53\x6c\x03\x06\x50\x83\xf7\xe1\x2a\x94\xdd\xab\x0f\x5d\x67\xb8\x12\x40\x3f\x4b\x7a\x3e\xa3\xc3\xf1\xec\x0e\xdc\x46\x97\x76\xbf\xef\xbd\xec\xba\xa5\xbe\xd5\xcf\x60\xe8\x67\xc9\xae\xc1\xdd\xf3\x1a\xf6\xfb\x91\x6d\xa8\x66\x36\xac\xf4\xee\x7f\xb0\x6b\x46\xed\xb6\x60\x77\xfc\x09\xba\xee\x18\x20\x09\xb2\x82\xd0\x8b\xb2\x1c\x0f\xa2\xce\xf0\x42\x2a\x91\x51\xa9\xac\x33\x6d\x0d\xca\x71\x27\xb5\xf2\xd2\x87\x30\x0c\xd2\xa3\xae\x03\x55\xa2\x96\x61\xbf\x45\xb1\x78\xfa\x70\x96\xed\x3e\x0a\x05\xb6\x04\xaf\xe9\x98\xab\xe7\x58\x5e\xa7\xe5\x66\x13\x37\xc2\x6d\xdc\x41\xb1\xe1\x4a\x16\xbc\x7a\xbd\x0f\x30\xa6\xc0\xe3\x6b\xfe\x04\x09\x9a\x29\x18\xa3\x31\x0d\x0b\xb7\x43\x43\x68\xc0\xec\x92\x17\x4f\xc2\xe8\x56\x95\x43\x19\xde\x28\x07\xc6\xb4\x8d\x1b\xb3\x85\x44\x42\x53\xec\x60\x7d\xf3\x8a\xde\x30\x63\xb9\xf9\x11\x90\xd1\xdf\x30\xc8\xfd\x3c\x60\xf7\xda\xc9\xf5\x4b\x52\x64\x34\x8c\x05\xf6\x78\x73\x7d\x73\xbf\x3c\xf8\x5e\x5e\x3d\xdc\xe1\x1e\xef\xef\xb7\x33\xba\xae\x1d\xbb\x42\x4f\xd7\x49\xfc\x0b\xd6\xe4\xb7\xb3\x02\x6b\x67\x70\xae\xef\x7d\x7d\x43\x39\xe2\x59\x28\xd3\xf3\x8f\xaa\xdd\x70\x65\xb1\x49\x63\x7d\xf9\x2e\xeb\xab\x2b\xaa\x71\xa7\xef\x8d\xa1\x40\xe0\xae\xdd\xf9\x0a\xa9\xd9\x0f\x1f\x8c\x24\xce\x3d\xbe\x1f\x83\x79\x9c\xf5\xf0\xde\x68\xfe\x42\x4f\xbc\x85\xdd\xa8\x12\x76\xe9\x89\xad\x45\x5d\x56\x52\xc1\xfb\x0c\xf3\x1e\x70\x8a\x03\x7f\x64\x75\x82\x63\xd1\x03\x4e\x71\xd8\x97\x7a\xa5\xab\xf7\x29\x1e\xbd\xfd\x14\x03\x16\xd1\x09\x1f\x96\x68\x4e\x7d\x7c\xa7\xdd\x2d\x4c\x8c\x5f\xc7\x11\x38\x4d\x03\x4f\x75\xeb\x6f\xf9\x42\x95\xfe\x26\x92\x57\x64\x46\xeb\x69\x4e\xf8\xb1\x35\x5e\xe9\x4f\xc9\x09\xa4\xec\xc7\xe8\x50\xe1\xd8\x5f\x70\x35\xe8\x4b\x0a\xb7\xcb\xc6\x3e\x62\xb3\xd0\xb8\xd3\x77\x44\x0e\xd3\xf8\x43\x8d\x03\x30\xa3\x9b\xa9\x44\x3f\x4d\x7f\xae\x44\xa4\xec\xb3\xbe\x52\x19\x76\x07\xdc\xae\xc0\x05\x97\x92\xd8\x15\x0d\xba\x3e\x0c\x7f\x74\x5d\xae\x3d\xf0\xd3\x8c\x2a\x59\xf9\x93\x47\x35\x60\x0c\x7e\x1a\x70\xad\x51\x24\xf2\xbd\x29\xb2\x66\x3b\x8d\xdf\xf5\xc3\x62\xee\x75\xbe\x0d\x9f\xef\x1a\x88\xf4\x7f\x4b\x0c\xb5\x67\x7c\xe5\x35\x2b\xf6\x00\x02\x7d\x32\x5d\x37\x76\xd3\xb1\x2f\x06\xa4\xcd\xa8\x35\xdb\x77\x93\x6c\x2a\x62\xf0\xd8\xb2\x3e\xe6\x95\x9a\x46\xfa\xa1\x55\x9f\x0e\x07\x35\xec\xa4\xf3\x8d\x08\x37\xa6\x64\x4f\xfe\x0b\x00\x00\xff\xff\x27\x08\x21\xb1\x46\x0b\x00\x00")
|
||||
var _nameServiceNameServerServer_mainGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x56\x5d\x6f\xdb\x36\x14\x7d\x96\x7e\x05\x2b\x74\x80\x34\x38\x54\x87\xad\x7b\x08\x9a\x87\x36\xcd\xd2\x60\x49\x60\x24\x1e\xf6\x2c\x4b\x34\x4d\x44\x22\x05\x92\x4a\x6d\x08\xfe\xef\xbb\x97\xa4\x14\x39\xb5\x9d\x3d\xb4\x68\x2c\x99\xf7\xf0\xf0\x9e\xfb\x45\xb7\x45\xf9\x54\x70\x46\x9a\x42\xc8\x38\x16\x4d\xab\xb4\x25\x69\x1c\x25\xab\xba\xe0\x09\x3e\x1b\x8b\x0f\xc9\x86\x47\xbe\xb6\xb6\x9d\xbe\xe7\x6d\xab\xd5\x0a\x57\x94\xf1\x9f\xb9\x11\x5c\x16\x35\x7e\x31\x5b\x53\x16\x35\xbc\xc6\x51\x9e\x93\xdf\x2b\x32\x2f\xb4\xdd\x82\x81\xab\xba\x90\x9c\x2a\xcd\xf3\x4d\x8e\x54\xa5\x92\x96\x6d\xdc\x29\x5c\x29\x5e\x33\x3a\x81\x70\xdd\x96\x81\xe3\x5a\x91\xbf\x85\x45\x94\xb0\xeb\x6e\x49\x4b\xd5\xe4\x5c\x9d\x3d\x09\x9b\xe3\x1f\x93\x55\xab\x84\xf4\x3c\x07\x11\xb5\xe2\x81\x6a\xb1\x16\x86\x3c\x32\xfd\x2c\x4a\x16\x47\xeb\x42\x56\x35\xd3\x24\xe9\x7b\x7a\xe3\x02\x31\x2f\xec\x9a\x9c\xed\x76\x24\x0f\x36\x50\x06\x68\xa6\x81\xdc\x3c\x97\x07\x91\x9c\x49\xa6\x0b\xcb\x2a\xc0\xb4\x4b\x07\x99\x7f\xd9\x07\xc1\xe9\x59\x1c\xaf\x3a\x59\xba\xb0\xa7\x19\xe9\xe3\xe8\xb9\xd0\x18\xf7\xa8\x62\xcb\x8e\x7f\xae\x2a\x4d\xdc\xbf\x0b\x82\x89\xa0\x8f\x56\x0b\xc9\xd3\xc4\x59\x69\x01\xe6\x64\x46\x92\xf3\x8f\x1f\xfe\xfc\x80\x2f\x5f\x71\x99\x80\x8f\xa4\x61\x80\x2c\x0d\xa9\x85\xb1\x4c\x12\x44\x32\x63\x92\x0c\x98\x31\x57\x2f\xc4\xaf\x99\xd1\x3a\x25\xfe\xe8\x88\xbf\x2d\x16\xf3\x43\x5c\x98\x8f\xe3\x5c\x68\x9d\x72\xfd\xe1\xb8\xf8\xc3\xfc\x92\xa4\xc8\x98\x1d\xa0\x84\xff\x8e\x03\xea\xc3\xb0\x34\xf3\x09\xba\x55\x9c\x03\x23\xa9\x14\x06\x8a\xfa\x28\x41\xfe\x38\x73\x0f\x7a\xeb\x5e\xe3\x08\xe2\x17\x85\xe5\x0b\x67\xb8\x67\xdf\xc1\x06\xb5\xeb\x11\xa9\x32\xe0\x5c\xa5\x3a\x9b\x1d\x40\x5e\xfa\xca\x4b\xfd\x7a\x46\xff\x85\xb2\x49\x13\x6b\xc0\x69\x44\x7c\x65\xab\xa2\xab\xed\x42\x34\xcc\xd8\xa2\x69\xff\x59\x5c\xfe\x7f\x16\x2c\x7e\xa6\xf7\x99\x2e\xdd\x1a\x70\xec\xe2\xc0\x82\x42\xd2\xa4\x31\x1c\xe3\xb4\x66\x75\xad\x30\x24\x15\x5b\xb1\x41\xee\x1e\x02\xfa\xa3\x5a\x6e\x59\x12\xa2\xf4\xa5\x33\x42\x42\x18\xf7\xc3\x64\x7c\x5d\x93\x50\xba\x74\xac\x73\x0c\xd6\x60\xbc\x18\xcd\xa0\x20\x20\x52\x54\x07\xb4\x90\x9c\x91\xa4\x0e\x89\x98\x96\xd8\x9a\x69\x86\x1a\x9c\x0f\x57\xa1\xed\x5e\x7c\xe8\x7b\x0d\xdd\xcb\xc8\x7b\x41\xce\x2f\xc8\x70\x3c\xbd\x63\x76\xad\x2a\xb3\xdb\x79\x2f\xfb\x7e\xa1\x6e\xd5\x77\xd0\xf9\x5e\xd0\xfb\xa2\x61\xbb\xdd\x48\x35\xb4\x32\x1d\x56\xbc\xef\xa7\xb6\x5c\x10\xe8\x4b\x7a\x57\x3c\xb1\xbe\xff\xc1\x9a\x06\x35\x41\x1f\xd4\xef\x78\x04\xb1\xba\x28\x41\xe0\x8c\x08\x69\xac\xee\x1a\x26\x6d\x61\x85\x92\x4e\xf1\xa0\x7e\x50\x0c\x2e\xc0\x46\x94\x30\xec\x37\xa8\x11\x8f\x1e\xce\x32\xfd\x5b\x11\xc0\x49\xe0\xd4\xfc\xe0\xe7\x39\xb6\xd4\x09\x95\xb3\x89\x03\x21\xfc\x77\xac\x84\x44\x0a\xa8\xb6\x97\x04\x30\xad\x4b\x3c\xb8\x81\x68\xa4\x68\x26\xb0\xa2\xb0\xee\x4a\xbb\x41\x43\x98\xb8\xf4\x0b\xdc\x01\x5c\xab\x4e\x56\x43\xdf\xdd\x80\x41\xeb\xae\xb5\x63\x79\xc4\x11\x57\x04\x47\x96\x9f\x56\xd1\x2b\x66\xec\x2f\x37\xf3\x67\xe4\x37\x0c\xaf\xbf\x00\xe8\xbd\xb2\x62\xb5\x4d\xcb\x19\x09\xf7\x00\x7d\xbc\xb9\xbe\xb9\x5f\xec\x7d\x5f\x5c\x3d\xdc\xe1\x1e\xe7\xef\xa7\x33\x02\x5d\x4b\xaf\xd0\xd3\x55\x9a\xfc\x82\x4d\xf8\xe9\xac\xc4\x66\x19\x9c\xf3\xc3\xce\x4f\x90\x03\x9e\x85\xbe\x3c\x7f\xab\xbd\x21\x37\x06\xa7\x32\x36\x94\x1b\xab\xae\x9d\xa2\x06\x77\xba\x61\x18\x3a\x82\xdd\x75\x1b\xd7\x12\x0d\xfd\xe6\x82\x91\x26\xb9\xc3\xfb\x7b\x2f\x87\xfd\x0e\xee\x8d\xfa\x2f\xf4\xc4\x59\xe8\x8d\xac\xd8\x26\x3b\xb1\xb5\x6c\xaa\x1a\x3a\xf7\x38\xc3\xa5\x07\x9c\xe2\xc0\x0f\x51\x9f\xe0\x98\x7b\xc0\x29\x0e\xb3\x6d\x96\xaa\x3e\x4e\xf1\xe8\xec\xa7\x18\xb0\x7d\x4e\xf8\xb0\x40\x73\xe6\xe2\x3b\x1d\x67\xe1\x8a\xf8\x75\xbc\xf3\xa6\x65\xe0\xa8\x6e\x5d\x96\x3f\xcb\xca\x65\x22\x7d\x41\xce\x48\x33\xad\x09\x77\x4f\x8d\x29\xfd\x29\x35\x81\x94\xfe\xde\x1c\x7a\x1b\xc7\x0a\xae\x06\x7d\x29\xb4\xd1\x6c\x9c\x20\x66\x16\x26\x75\x76\x44\xe4\x70\xfd\xbe\xa9\x71\x00\x42\x34\xa7\x12\xdd\xf5\xf9\x73\x25\x22\xa5\xaf\xfa\x5a\xce\x70\x3a\xe0\x76\xf8\x2d\x16\x5c\x02\x74\xd9\xa2\xeb\xc3\x6d\x8f\xae\x8b\x95\x03\xbe\x03\xa0\xa8\xdd\xc9\xa3\x1a\x78\xe2\x57\xcd\x6c\xa7\x25\xbc\xe1\x6c\x8a\x8c\x7e\x9e\xc6\xef\x1a\x8e\x74\x3a\x5f\x87\xcf\x4d\x0d\x44\xba\x1f\x0f\x43\xef\x69\xd7\x79\xed\x92\x3e\x30\x8e\x3e\x69\xf8\x39\x35\xcc\x51\x3f\x14\x03\x0c\xc2\x0f\x27\x1d\xad\xb0\xa9\x82\xc1\x5d\x43\x7d\xc0\x6b\x39\x0d\xf3\x43\x27\xdf\xed\x5f\xcb\x6c\x23\xac\x9b\x42\xb8\x31\x8b\x77\xf1\x7f\x01\x00\x00\xff\xff\xb0\x25\xb3\x85\x34\x0b\x00\x00")
|
||||
|
||||
func nameServiceNameServerServer_mainGotemplateBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -114,12 +114,12 @@ func nameServiceNameServerServer_mainGotemplate() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/NAME-server/server_main.gotemplate", size: 2886, mode: os.FileMode(436), modTime: time.Unix(1477333032, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/NAME-server/server_main.gotemplate", size: 2868, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServiceGeneratedClientGrpcClientGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\x55\xdf\x6f\xdb\x36\x10\x7e\x16\xff\x8a\x9b\x10\x0c\x52\xa0\x50\xef\x1d\xfc\x52\x37\x0d\x3a\x2c\x99\x97\x06\xdb\x43\x51\x0c\x34\x75\x92\x09\xcb\xa4\x46\xd2\x8e\x0d\x41\xff\xfb\x70\x94\x64\x4b\x46\xd2\x3e\x14\xb5\xee\x3e\x7e\xf7\xf3\xbb\xe4\x39\xac\x84\xdc\x8a\x0a\xa1\xb2\x8d\x84\xc6\x9a\x83\x2a\xd0\x81\x80\xea\x79\xb5\x04\x59\x2b\xd4\x1e\x4a\x63\xc1\x6f\x10\xda\x96\x7f\x45\x7b\x50\x12\xf9\x03\xfa\x27\xb1\xc3\xae\x03\x37\x58\x58\x33\x61\x62\x4c\xed\x1a\x63\x3d\x24\x2c\x8a\x2b\x53\x0b\x5d\x71\x63\xab\xfc\x98\x6b\xf4\xb9\x34\xda\xe3\xd1\xc7\xc1\x67\xaa\x1a\xf9\x04\x42\xcf\xdf\xf7\xe4\x3b\xf4\xa2\x10\x5e\x04\x88\xf2\x9b\xfd\x9a\x4b\xb3\xcb\x9b\x6d\x95\xa3\xb5\xc6\xba\x98\xcd\x3d\x95\xb9\xdb\x2a\x9f\xd3\x3f\xd4\x45\x63\x94\xa6\xc0\xc4\xe5\xad\xd0\x2e\x64\xf9\x0e\xfe\x0c\x18\x92\x62\x51\x9e\xc3\xcb\x46\x39\x18\xda\xc0\xa2\x8d\xd0\x45\x8d\x16\xe2\xb6\xe5\x5f\x42\xc9\x2b\xe1\x37\x70\xd7\x75\x90\x0f\x3e\x97\x53\x8b\xd0\xc6\x2c\x72\x07\xf9\x26\xb2\x42\x8d\x56\x78\x2c\x62\x16\x35\xeb\x00\x59\x7d\x9c\x83\x62\x96\x32\x96\xe7\xf0\x84\xaf\x60\xd1\xef\xad\x76\x20\xf4\xd8\x7d\x58\x0b\xb9\xc5\x02\xd6\xa7\xab\xd1\x49\xa3\x35\x4a\xaf\x8c\xe6\xf0\xc5\x83\x72\x34\x48\xe2\xb1\xe8\x1a\xa3\x9d\x5a\xab\x5a\xf9\x13\x98\x32\x4c\x58\x8a\x9a\xaa\xf1\x06\x0a\x25\xea\x0c\x84\x2e\xa0\x16\x1e\x2d\xc8\xda\x38\xcc\x7a\xd0\x84\x13\x58\xb9\xd7\x92\xb2\x4a\xc8\x0c\xb7\xd4\x29\xbe\x0c\xc1\x97\x46\xeb\x0c\x4c\x43\x48\x07\x9c\x0f\xe6\x3f\x83\x21\x85\x64\xe8\xcf\xb8\x53\x19\x84\x01\xa6\xd0\xb2\xe8\x20\x2c\x48\x39\x14\xb1\x34\xba\x54\x15\x63\x11\xed\xe1\xbf\x19\x94\xf0\x61\x01\x56\xe8\x0a\xcf\xe4\x2d\x8b\x22\xb4\x96\x1c\x65\xf2\xab\x94\x29\x8b\x22\x55\x12\x21\xfc\xb2\x00\xad\xea\x80\x88\xfa\xc6\xd1\xf7\x10\xcc\xf1\x7f\xac\x68\x12\xb4\x36\x83\x58\x0a\xad\x8d\x07\xd1\x34\xf5\x69\x60\x8e\x89\xa8\x63\x51\xc7\x58\x24\x27\xd9\x3b\x8a\xf4\xed\xfb\x6c\x8b\x66\xe5\x51\xb8\xb7\xbc\x1f\xb1\x34\x16\x13\x4a\x66\x50\xc1\xdf\xa2\xde\xa3\x7b\x31\x0f\xcf\xab\xe5\xe3\xb0\xdc\x89\x94\x7c\x83\xa2\x40\xeb\xd2\x34\xeb\xc3\xb7\xed\x1d\xbc\x2a\xbf\x81\x1b\x7f\x4f\xd1\x79\xd7\xb1\x28\x58\xfb\x56\xdc\x28\xb2\xde\xf8\xfb\xb3\x46\x1f\xd1\x6f\x4c\xe1\x02\x2e\x74\xb4\x6d\x5f\xcc\x1f\xe6\x15\x2d\xdc\xa8\x8b\x82\xef\x07\x55\xc0\x28\x0f\x3e\x5a\xe8\x5d\xe8\x5b\xf4\x93\x97\x0b\x98\xd7\xfa\x84\xaf\x7d\xb9\xa1\xd0\x50\xaa\xce\xfa\x9f\x71\xdb\xbe\x58\xb5\x5b\x59\x2c\xd5\x71\x96\xee\xe7\x7d\x5d\x9f\xfe\xda\x8b\x5a\x95\x0a\x0b\x8a\x00\x31\x8f\xbb\x2e\xbe\xbc\x9c\x06\x1f\xcd\xee\x20\xf9\xbd\x96\xa6\x40\xea\xe0\x1c\xf3\x8c\xff\xed\xd1\xf9\x09\xf2\x13\xbe\x87\x0c\x72\xc0\x01\xda\xac\x79\xdb\x3e\x98\x90\xc4\x8d\xe2\xa3\xf7\xe5\xd4\x4c\x4e\x5f\xdb\x0d\xe8\xd9\x66\x70\xce\x7b\x73\x7a\xee\x63\x42\x5b\x14\xf5\xe3\x42\x5d\xd0\x40\xc6\x1f\x6c\xdc\xc9\xbe\x8c\x1e\xef\x5a\x02\x4c\xc7\x7a\x3d\x53\xba\x08\x81\xee\xad\x71\x7c\x00\x80\x9f\xcc\x3a\xbb\x64\x10\x75\x19\x09\x82\x75\x8c\xf9\x53\x83\x33\xcd\x81\xf3\x76\x2f\x3d\x89\x67\x58\x47\xf8\xf6\xdd\x79\xab\x74\x45\xf8\x3c\x87\xe9\xce\xd3\x75\x11\x40\xf7\x20\x7c\xf9\x8d\xf0\xb0\x33\x05\x8d\xd3\xf5\x87\xe3\x7c\x93\x48\xcf\x21\xda\xec\x3d\x3d\x4d\x6e\xa7\x09\xa4\xbd\x4c\x59\x7f\x65\x96\xfe\x38\xaa\xe5\x2b\xea\x22\xd9\xe2\x29\xdc\x95\x3e\xa3\x74\x4e\xd6\x9e\x5b\x1b\x68\x0d\xbc\x45\x1c\xce\x82\x19\xb5\x06\x0b\x20\x4a\x36\x3d\x14\x24\xbe\x6e\x88\xff\x23\xc5\x86\x5c\xc6\xe6\xa4\x57\x7a\x18\xf6\xf0\x33\x91\x5c\xe5\x25\xfd\x71\xe4\xe5\xcb\xfe\xff\x0c\x76\x05\xdc\x8e\x7f\xe8\xf8\xe3\xa7\xf4\x1a\x11\xd2\x26\x45\x37\x42\x4d\x67\x12\x8d\x27\x72\x7b\x39\x91\x21\xb1\xa0\x62\x55\xc2\x21\x03\x13\x7c\xd2\x1f\x79\xa8\x23\xd9\xa6\x3c\x19\xb2\xfe\x8d\x9c\xbd\xe0\x7b\xe2\x05\x1d\x43\xea\x74\xf8\xcc\x60\x9b\xc1\xe1\xbc\xcb\xb4\xbc\xc4\xd9\x43\xa7\x67\xf6\x76\x57\xc0\x02\xce\x05\xfc\x6e\x94\x4e\x6e\x77\x45\x76\x31\xad\xe8\x4d\xcf\xca\x39\x4f\xd3\x91\x6e\xe8\x8c\xf4\xc7\xbe\xef\xff\x07\x00\x00\xff\xff\x98\xe6\x41\x14\xa1\x08\x00\x00")
|
||||
var _nameServiceGeneratedClientGrpcClientGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x7c\x55\xdd\x8e\xdb\x36\x13\xbd\xb6\x9e\x62\x3e\x63\xf1\x41\x5a\x68\xa9\xfb\x14\xbe\x89\x93\x06\x29\x9a\xd4\x48\x16\xed\x45\x51\x14\x34\x45\xcb\x84\x65\x52\xa5\x68\xef\x1a\x82\xde\xbd\x33\xfc\xf1\x4a\xee\x6e\x82\x2c\x56\x1c\x1e\xce\xcf\x99\x39\xb3\x55\x05\x1b\x2e\x0e\xbc\x91\xd0\xd8\x4e\x40\x67\xcd\x59\xd5\xb2\x07\x0e\xcd\xb7\xcd\x1a\x44\xab\xa4\x76\xb0\x33\x16\xdc\x5e\xc2\x30\xb0\xef\xd2\x9e\x95\x90\xec\x2b\x3f\xca\x71\x84\x3e\x1e\xb3\x6e\xe2\x26\xcb\xd4\xb1\x33\xd6\x41\x9e\x2d\x96\x8d\x69\xb9\x6e\x98\xb1\x4d\xf5\x5c\x69\xe9\x2a\x61\xb4\x93\xcf\x6e\xe9\xef\x4c\xd3\x4a\x36\x81\xd0\xf3\xb7\x6f\xaa\xa3\x74\xbc\xe6\x8e\x7b\x88\x72\xfb\xd3\x96\x09\x73\xac\xba\x43\x53\x49\x6b\x8d\xed\x97\xd9\xfc\xa6\x31\x0f\x07\xe5\x2a\xfa\x91\xba\xee\x8c\xd2\x14\x98\x7c\x39\xcb\x75\xef\xb3\x7c\x03\x7f\x05\xc4\xa4\xb2\x05\xb2\xf5\xb8\x57\x3d\x44\x0e\xb2\xc5\x9e\xeb\xba\x95\x16\x96\x48\xcc\x67\x5f\xf2\x86\xbb\x3d\x3c\x20\x31\x55\xbc\xeb\x2b\xa2\x48\x5a\x8c\xda\x9f\xc5\xab\xc8\x46\x6a\x69\xb9\x93\x35\x62\xba\xad\x87\x6c\xde\xcf\x41\xcb\xac\xc8\x32\x0c\xff\x55\x3e\x81\x95\xee\x64\x35\xb6\x48\x27\xf6\x61\x8b\xe4\xcb\x1a\xb6\x97\x9b\xbe\x21\xd5\x5a\x0a\xa7\x8c\x66\xf0\xd9\x01\xa6\x8e\x5d\x24\x3f\x56\x62\x65\xba\x57\x5b\xd5\x2a\x77\x01\xb3\xf3\xed\x15\xbc\xa5\x6a\x9c\x81\x5a\xf1\xb6\xc4\x08\x35\xb4\x98\x98\x45\x7f\xa6\x97\x65\x00\xbd\xf8\xcc\x76\x27\x2d\x28\xa7\x9c\x8c\x70\x4f\x3c\xb1\xb5\x0f\xbd\x46\x43\x09\xa6\x23\x5c\x0f\x8c\x45\xf3\x6f\xde\x50\x40\x1e\xd9\x49\xe3\x54\x82\x6f\x5f\x01\x43\xb6\x38\x73\x8c\x27\x62\x09\xe8\x67\xa7\x1a\xe4\x9e\x46\xf0\xef\x12\x76\xf0\x6e\x05\xd8\x18\x9c\xb4\xe4\x1c\x9f\x2c\xf0\x35\x5d\xec\xf2\xff\x0b\x51\xe0\x59\xed\xc8\x21\xfc\x6f\x05\x5a\xb5\x1e\xb1\x08\xb4\xd1\x39\x06\xeb\xd9\x1f\x96\x77\x39\x7e\x97\xb0\x14\x5c\x6b\xe3\x80\x77\x5d\x7b\x89\x9e\x97\xe4\x68\xcc\xf0\x7f\xb6\x10\x93\xec\x7b\x8a\xf4\xe7\x5f\xb3\x19\x9a\x95\x47\xe1\x5e\xbb\x7d\x2f\xb1\x08\x99\x53\x32\x51\x03\xbf\xf3\xf6\x24\xfb\x47\xf3\x09\x7b\xf6\x25\x8e\x76\x2e\x04\xdb\x4b\x5e\xe3\xe8\x14\x45\x19\xc2\x0f\xc3\x03\x3c\xe1\x90\xc2\x9d\xfb\x48\xd1\xd9\x88\x79\x4d\xac\x38\xff\xa4\x47\xba\x42\x04\x8b\x92\x0e\x12\xa5\x70\x84\x0c\xa4\xdd\xa9\x04\x4a\x42\xc6\xb8\x7b\x53\xf7\x01\xe8\xc9\x1f\x86\x47\xf3\xab\x79\xc2\xb6\xdf\xa9\xa8\xf3\x8f\x51\x3b\x90\x44\xc4\x92\xc5\xbf\xf2\x04\x53\x98\xb7\x1f\xae\x60\x4e\x09\x4e\x4d\x60\x25\x0f\x6f\x89\x12\x5d\xc6\x6f\x94\x40\xaa\x69\x1c\x19\x1e\x26\xf9\x06\xe3\x72\x0a\x55\xb7\x46\x54\x1a\x26\x28\x4c\x2d\x89\xd9\x09\xe2\x9b\xfc\x07\x09\x77\x53\xdc\x07\xf9\x2a\xce\xeb\x43\x26\x60\xb7\xc5\x2c\x3e\x19\x4f\x32\x82\xd2\xf5\xe3\xa5\x4b\x09\x0d\x63\xc2\xce\x66\x05\x27\x3f\xda\x8b\x2b\x65\x79\xe1\x2d\xb1\x33\xc8\x68\xec\x66\xfc\x4a\x1f\x59\x1a\xd9\x50\x4d\x78\xdb\x0f\x04\x98\xf6\xf2\xb6\x91\xb4\x2e\xbc\xbb\xff\xf4\xe0\x1d\xe0\xbf\x1f\xf4\xa8\x7c\x89\xbd\x18\x4b\x52\x4a\x86\x59\x38\xac\x71\x26\x46\xe8\x9d\x3d\x09\x47\xaa\x8a\x73\x8a\x6a\x40\x9b\xd2\x0d\xe1\x71\xbb\x4c\xc5\x40\x4b\x87\x03\x2d\x0a\x7f\x72\x7b\xee\xe0\x68\x6a\xb5\x53\xb2\x0f\xfb\xe4\xba\xaa\x48\xe8\x3e\xda\xec\x3d\x3d\xcd\xef\xa7\x09\x14\x41\xbf\x59\x58\x3f\x6b\xf7\x9c\x64\xf4\x1d\x93\xcf\x0f\xf2\xe2\x17\x4e\xc8\xa8\x98\x3b\x1b\xae\xa4\x7a\xb7\x06\x5e\x73\xec\xf7\x85\x49\x22\xc4\xc9\x25\x97\xd9\x74\x83\x90\x2a\xc7\x18\xff\x47\x52\xf6\xb9\x24\x72\x8a\x1b\x05\xc4\x59\xfc\x99\x9c\xdc\xe4\x25\xdc\x73\xf2\xcb\xd6\xe1\x77\x09\xc7\x1a\xee\xd3\xdf\x3f\xf6\xe5\x43\x71\x8b\xf0\x69\x93\x7e\x3b\xae\xa6\x3d\x59\xa4\xdd\x79\x78\xd9\x9d\x3e\x31\xaf\x5a\xdc\x94\x67\x5c\xd4\xfe\x0e\xc3\x32\x5f\x47\x7e\x28\x58\x1e\xb3\xfe\x89\x2e\x83\xc0\x83\xe3\x15\x6d\x49\x62\xda\x1f\xd1\x6d\x09\x67\x3f\xd1\xa3\xdf\x97\x61\xfb\x06\xe8\x74\xff\xde\x63\xfe\x2b\xb8\x16\xf0\x0b\x4e\x5c\x8e\xb6\xf2\xc5\xb4\xa1\x37\xc1\x2b\xf6\xaf\x28\x92\xbb\xc8\x0c\x66\x17\x78\xff\x37\x00\x00\xff\xff\x4d\xae\x0e\xc1\xb5\x08\x00\x00")
|
||||
|
||||
func nameServiceGeneratedClientGrpcClientGotemplateBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -134,12 +134,12 @@ func nameServiceGeneratedClientGrpcClientGotemplate() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/generated/client/grpc/client.gotemplate", size: 2209, mode: os.FileMode(436), modTime: time.Unix(1477698951, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/generated/client/grpc/client.gotemplate", size: 2229, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServiceGeneratedClientHttpClientGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x2c\xcb\xb1\x0d\xc2\x30\x10\x05\xd0\x3e\x53\x5c\x1d\x09\xdf\x10\x34\x29\x91\xc8\x02\x56\xf8\x98\x88\xc3\x67\x9d\x3f\x95\xe5\xdd\x69\x18\xe0\x8d\xa1\xab\xdc\x01\x29\x7e\x61\x7c\x7b\xd7\x82\x5a\xfc\x7d\x52\x5f\x64\x63\xe4\xda\x9b\x07\x95\xf8\x34\xcb\x44\x2a\x2e\x4f\x0f\x39\xfc\x01\x59\x75\xce\x65\x8c\x23\x9b\x49\xda\xf6\xfd\xb6\xc1\x1a\x22\x5d\xed\x44\xe5\xfe\x27\x92\xe6\x5c\x7e\x01\x00\x00\xff\xff\x0b\x3c\x4c\x9e\x69\x00\x00\x00")
|
||||
var _nameServiceGeneratedClientHttpClientGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x2c\xcb\x31\x0e\xc2\x30\x0c\x05\xd0\x9d\x53\x78\xae\x44\x7c\x08\x96\x8e\x48\xe4\x02\x51\xf9\x84\x0a\x13\x47\xce\x67\x8a\x7a\x77\x18\xd8\xdf\x9b\x53\x17\xb9\x01\x52\xfd\xcc\xf8\x8c\xa1\x15\xad\xfa\x6b\xa7\x3e\xc9\xce\x28\x6d\x74\x0f\x2a\xf1\xee\x56\x88\x54\x5d\x1e\x1e\xb2\xf9\x1d\xb2\xe8\x71\x9c\xe6\xdc\x8a\x99\xa4\x35\xe7\xeb\x0a\xeb\x88\x74\xb1\x1d\x8d\xf9\x5f\x24\xfd\xd4\x37\x00\x00\xff\xff\x0b\x3c\x4c\x9e\x69\x00\x00\x00")
|
||||
|
||||
func nameServiceGeneratedClientHttpClientGotemplateBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -154,12 +154,12 @@ func nameServiceGeneratedClientHttpClientGotemplate() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/generated/client/http/client.gotemplate", size: 105, mode: os.FileMode(436), modTime: time.Unix(1477696627, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/generated/client/http/client.gotemplate", size: 105, mode: os.FileMode(436), modTime: time.Unix(1477930115, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServiceGeneratedEndpointsGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x94\x55\x4d\x8f\xdc\x36\x0c\x3d\x5b\xbf\x82\x5d\x04\xc8\x4c\xe1\x95\xef\x05\x72\x69\xd0\xa6\x7b\x48\x10\xb4\xf9\x03\x1a\x99\x33\x26\x56\x96\x14\x89\x9e\xdd\xad\xe1\xff\x5e\x50\xb6\xe7\x03\x33\xfd\x3a\x2c\xbc\x43\x53\x8f\x4f\xef\x91\x74\x34\xf6\xd9\x1c\x10\xf2\xd1\x2a\xd5\x34\xf0\xad\xa3\x0c\x7b\x72\x08\x36\x78\x36\xe4\x33\xf4\xc8\x5d\x68\x33\x70\x80\xde\x3c\x23\x90\x6f\xe9\x48\xed\x60\x1c\xa0\x6f\x63\x20\xcf\x19\xf6\x29\xf4\x90\x31\x1d\xc9\x62\xae\x05\x29\xe1\xf7\x01\x33\x83\xf1\x2d\x24\xcc\x31\xf8\x8c\xc0\x6f\x11\x0b\x92\xa4\x22\x70\x17\x32\x9e\x51\x6a\x30\x19\x5e\xd0\x39\x79\xa2\xb7\xa1\xc5\x94\x05\x40\xf0\x5a\x5c\x7e\xef\x43\x5a\x0e\x16\xb4\xba\x04\x8c\x73\x10\xf6\x10\x86\x04\x79\x88\x31\x24\xc6\x16\x38\x19\x9f\xe5\x7f\x29\x47\xc6\xd1\x9f\x86\x29\x78\x41\xdb\x87\xd4\x1b\xce\x1a\x9e\x18\x8c\xcb\x01\xc8\x5b\x37\xb4\x98\x4f\x6c\xa0\xa7\xb6\x75\xf8\x62\x12\x66\xad\x14\xf5\x05\x68\xa3\xaa\x87\x43\x70\xc6\x1f\x74\x48\x87\xe6\xb5\xf1\xc8\x8d\x48\x85\xaf\xfc\xa0\xe4\x25\x71\x37\xec\xb4\x0d\x7d\x73\x08\x8f\xcf\xc4\x8d\xfc\xad\xa0\x92\xd2\x19\xdf\x3a\x4c\xf0\x30\x8e\xfa\xa9\xa0\x7e\x35\xdc\xc1\xe3\x34\x41\xb3\xbc\xcb\x4d\xd1\x27\x3d\xa8\x2a\xee\x4a\xe2\xd7\x9f\xaf\x53\x1f\xd4\xb6\xf8\xf5\xcb\xc9\x01\x1b\x9c\x43\xcb\x79\x95\x82\xbb\x0b\x65\x81\x3b\xc3\x60\x43\x1f\x45\x37\xe3\xc1\xb4\xed\x6a\x97\x68\xf0\x3e\x0b\x58\x8f\xc6\xb3\xb8\xb3\x43\x18\x32\xb6\x62\x83\x81\x0e\x5d\xc4\x04\x99\xd3\x60\xb9\x96\xd7\x4b\xa9\xfb\x95\xc8\x73\x00\x23\x70\x99\xfc\xc1\x21\x44\x93\x4c\x8f\x8c\x49\xab\xa6\x91\xf8\x93\x07\x33\x37\x40\xaa\x81\xf8\x7d\x96\x62\xfb\xc1\x15\x23\xf7\x83\xb7\x62\xd2\x42\xd9\xa3\xf8\x18\x20\x44\x4c\x86\x11\x82\x9c\x8d\x98\x1e\xd7\x82\x02\xb8\x33\x99\xb2\x86\x5f\x43\x02\x7c\x35\x7d\x74\x58\xc3\x5b\x18\xa0\xa7\x43\xc7\x10\x4d\x96\x26\xba\x90\x4a\x08\x9e\x0a\xcd\x75\x62\x0a\xed\x60\xb1\xc8\x60\x3c\x74\xcc\x51\xff\x36\x9b\x51\xc3\x0b\x71\x07\x68\x6c\xb7\xcc\x02\x6c\xd6\xea\x5b\x78\xa1\x84\x2d\x0c\x71\x06\xcd\x11\x2d\xed\xc9\x42\x34\xdc\x69\xd8\x3c\x15\x7e\x94\x05\x7f\x67\x76\xee\x0d\x0c\xf4\x94\x79\x9e\x23\x68\x31\xd3\xc1\xcb\x51\xf2\xc7\xf0\x8c\x45\xca\x3f\x66\x5b\x4e\x73\x57\x28\xe2\xb5\xd9\xb3\x19\x02\xb1\x2a\xa9\xb7\x97\xea\x5a\x47\xe8\xf9\x5a\xdd\x0b\xe3\xce\x23\xec\xde\x64\xd0\x67\x38\x6c\xff\xc9\x46\x19\xb6\x59\x2b\x12\x85\x7b\x9c\xdb\xea\xcc\x97\x3c\x63\xda\x1b\x69\xa8\xfb\x4e\x08\xd8\xa9\xd8\xfd\x35\x32\x48\xb1\xf3\xdc\x36\xc5\x87\x2f\xf8\xf2\x71\xb9\x8f\x0d\xfd\x8e\x7c\xd1\xa9\x2f\xca\x16\x96\x17\xde\xd6\xcb\xbe\xe1\x21\x79\xa0\xd2\xcc\xc2\xd1\x1a\x27\x23\x57\xfa\x79\xe1\xab\x55\xb9\xd1\x8d\xa6\xa3\x1a\xc7\x64\xfc\x01\xe1\x1d\xc1\x4f\x1f\x40\xaf\xf9\x9f\x67\x3f\xa6\x49\x55\xe3\xf8\x8e\xf4\x27\xe4\x2f\xa6\xc7\x69\x5a\x21\x00\xe0\x74\x15\xbd\x06\xd5\x38\x3e\x4a\x74\x9a\xd4\x74\x3d\xb1\xff\x5e\x47\x5a\x14\x36\x17\x1c\xb7\x70\x5d\x79\x63\xf9\x15\x96\xed\xa3\x3f\xce\xcf\x5a\xba\xe2\xc7\xb8\xd3\xe3\xf8\x29\x48\x1a\xbc\x23\xfd\xfb\xbc\x8c\xbf\xbd\x45\x3c\x9f\xde\xc2\xe6\x36\x6f\x5e\xd4\xd7\x89\x35\x60\x4a\x21\x6d\x61\x54\xd5\xba\xca\x4b\x4c\x78\xa3\xbe\xaf\x86\x70\x13\x2e\x5b\x55\xd1\xbe\x24\xff\xf0\x01\x3c\x39\x01\xa9\x16\x83\x3c\xb9\x82\xa3\xaa\x49\xad\xb1\xb5\x80\xfe\x8f\xe4\xb6\xb5\xc0\xa8\x49\x8d\xe3\x2c\xb3\x88\xfc\x59\x06\xec\xff\x2a\x2d\x87\xfe\xe6\x2e\x19\x96\xcd\xbc\x9e\xdd\xde\x3a\x3d\xab\x53\xee\x20\x70\xf7\xbd\x59\xbf\x8a\xa7\x61\x19\xc5\x86\xd3\xf7\xf1\x22\x3c\x0b\x7c\x16\xbe\x4a\xf8\x5d\xd8\x2f\x08\xf7\xe4\xb9\xe7\xb1\xaa\xaa\xe3\xc9\xab\xac\x6f\xfb\xa7\x70\x92\xb4\x5b\x97\x6e\x6d\x12\x9f\xd6\xe8\x71\x16\xbe\x9a\x2e\xb4\xff\x2b\x00\x00\xff\xff\xb3\x34\xc1\x62\x4f\x08\x00\x00")
|
||||
var _nameServiceGeneratedEndpointsGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x94\x55\xdb\x6e\xe3\x36\x10\x7d\xb6\xbe\x62\x6a\x2c\x50\xbb\x50\xa8\xf7\x02\xfb\xd2\x45\x2f\x79\xd8\xc5\xa2\xdd\x1f\xa0\xa9\xb1\x44\x84\x22\x15\x92\x72\x92\x0a\xfa\xf7\xce\x90\x92\xac\xd4\x46\x2f\x01\x62\x4b\xe4\xcc\x99\x33\xe7\x0c\xe9\x5e\xaa\x27\xd9\x20\x84\x8b\x2a\x8a\xaa\x82\x6f\xad\x0e\x70\xd6\x06\x41\x39\x1b\xa5\xb6\x01\x3a\x8c\xad\xab\x03\x44\x07\x9d\x7c\x42\xd0\xb6\xd6\x17\x5d\x0f\xd2\x00\xda\xba\x77\xda\x46\x4a\xf1\xae\x83\x80\xfe\xa2\x15\x86\x92\x91\x3c\x3e\x0f\x18\x22\x48\x5b\xd3\x73\xe8\x9d\x0d\x08\xf1\xad\xc7\x84\xc4\xa1\xf4\xda\x3a\x5a\x5c\x51\x4a\x90\x01\x5e\xd0\x18\xfe\x46\xab\x5c\x8d\x3e\x30\x00\xe3\xd5\x38\xbf\x9f\x9d\x9f\x13\x13\x5a\x99\x16\x24\x25\xb9\x33\xb8\xc1\x43\x18\xfa\xde\xf9\x88\x35\x44\x2f\x6d\xe0\x67\x2e\xa7\xa5\xd1\x7f\xca\xa8\x9d\x65\x34\xca\xe9\x64\x0c\x02\x1e\x89\xa1\x09\x8e\xba\x52\x66\xa8\x31\xac\x6c\xa0\xd3\x75\x6d\xf0\x45\x12\x79\x51\x14\xba\x4b\x40\x87\x62\xb7\x6f\x9c\x91\xb6\x11\xce\x37\xd5\x6b\x65\x31\x56\x2c\x15\xbe\xc6\x7d\xc1\x9b\x3a\xb6\xc3\x49\x28\xd7\x55\x8d\x7b\x78\xd2\xb1\xe2\xff\x05\x94\x43\x5a\x6a\xc8\xa0\x87\xfd\x38\x8a\xc7\x84\xfa\x55\xc6\x16\x1e\xa6\x09\xaa\x79\x2f\x54\x49\x1f\xbf\x2f\x76\xfd\x29\x05\x7e\xfd\xe9\x7d\xe8\xbe\x38\x26\xbf\x7e\x5e\x1d\x50\xce\x18\x54\xf4\x30\x4b\x11\xdb\x8d\xb2\xf4\x26\x23\x85\x10\x06\xe9\x26\x2d\xc8\xba\x5e\xec\x62\x0d\xbe\x0f\x0c\xd6\xa1\xa4\xbe\xc9\x9d\x13\xc2\x10\x48\x40\xb2\x41\x42\x8b\xa6\x27\xba\x21\xfa\x41\xc5\x92\xb7\xe7\x52\xf7\x2b\xd1\x87\x03\xc9\x70\x41\xdb\x86\x06\xa9\x97\x5e\xd2\x0c\xa1\x17\xb4\xc8\xeb\x8f\x54\x3e\x0f\x80\x2f\x41\x53\x6d\x2e\x76\x1e\x4c\x32\xf2\x3c\x58\xc5\x26\xcd\x94\x2d\xb2\x8f\x0e\x1c\x51\x90\x11\xc1\x71\x2e\x3d\x3f\x2c\x05\x19\xf0\x24\x83\x26\x2b\x7f\xa1\x74\x7c\x95\x5d\x6f\xb0\x84\x37\x37\x90\x83\x4d\x1b\xa9\x7e\xe0\x21\xda\x48\xc5\x04\xd7\x42\xb9\x4e\xef\x5d\x3d\xd0\xe8\x32\x1c\xc5\xb6\x31\xf6\xe2\xb7\x6c\x46\x09\x2f\xe4\x29\xa0\x54\xed\x7c\x16\xe0\xb0\x54\x3f\xd2\x9e\x27\x86\x43\x9f\x41\x43\x8f\x4a\x9f\xb5\xa2\xa2\xb1\x15\x70\x78\x4c\xfc\xe8\x48\x11\xfe\x49\x9e\xcc\x1b\xc5\x74\x3a\xc4\x7c\x8e\x68\xa6\x83\x6e\x2c\xa7\x6a\x7b\x71\x4f\x98\xa4\xfc\x23\xdb\xb2\x9e\xbb\x44\x11\xdf\x9b\x9d\xcd\x60\x88\x45\x49\x71\xdc\xaa\xab\x8c\x46\x1b\xdf\xab\xbb\x31\xee\x7a\x84\x89\x11\x4d\x6f\x86\xa3\x3e\xfe\xc1\x46\x3e\x6c\x59\x2b\xcd\x0a\x77\x98\xc7\xea\xca\x97\x32\xd0\x9f\x25\x0f\xd4\x7d\x27\x18\x6c\x2d\x76\xff\x1a\x19\xb8\xd8\xf5\xdc\x56\xc9\x87\x2f\xf8\xf2\x69\xee\x87\x26\xf8\xa4\x6d\xd2\xa9\x4b\xca\x26\x96\x1b\x6f\xcb\xf9\xbe\x89\x83\xb7\xd4\x3d\x37\xcd\x1c\x15\x75\x4a\x33\x9c\xe6\x79\xe6\x2b\x8a\xd4\xd1\x8d\xa6\x63\x31\x8e\x54\x9f\xee\xc4\x0f\x1a\x7e\xfc\x08\x62\x89\xff\x9c\xfd\x98\xa6\x62\x37\x8e\x1f\xb4\xf8\x42\x53\x3d\x4d\x4b\x3e\xd0\xdf\xd2\x87\x58\x16\x09\xea\x81\x57\x29\x67\x7a\x7f\x5c\xff\xbd\x08\xcf\x27\x0d\xda\x35\xe5\x08\x9b\xb2\x07\x15\x5f\x61\xbe\x77\xc4\xa7\xfc\x5d\xf2\x3c\xfc\xd0\x9f\xc4\x38\xfe\xea\x38\x8c\xc0\xc5\xef\xf9\x1a\xfe\x46\xbd\xce\xa9\x47\x38\xdc\x06\xe5\xfb\x79\x13\x55\x02\x7a\xef\x3c\x15\x2d\x76\xcb\xf5\x9d\xd6\x98\x2e\x8a\x3b\x0a\x30\x25\xa6\x70\x2c\x76\xfa\x9c\x22\xbf\xfb\x08\x56\x1b\x46\xd8\xcd\x8e\xd0\x6b\x02\x29\x76\x53\xb1\xac\x2d\xe8\xe2\xbf\xd0\x3a\x96\x8c\x41\x6a\x8e\x63\xd6\x95\x55\xfd\xcc\xc7\xe9\xff\x4a\xcb\x49\xf7\xba\x08\x30\x5f\xc2\x4b\xe2\xf1\xd6\xd7\x2c\x4a\x62\xcf\x58\xf7\xcd\x58\x7e\x00\xd7\x73\x31\xb2\xf4\xeb\x4f\xe1\x66\x39\xeb\x7a\xd5\x9b\xb0\x9f\x99\xfa\x8c\x70\x4f\x98\x1b\x53\x29\xeb\xb2\xfa\x13\xc4\xdf\x46\x25\xb1\xe1\x98\x5b\x67\x6e\xad\x61\x6f\x96\xd5\x4b\xd6\x7b\x37\x6d\x24\xff\x2b\x00\x00\xff\xff\xb2\x0c\xd8\x6b\x34\x08\x00\x00")
|
||||
|
||||
func nameServiceGeneratedEndpointsGotemplateBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -174,12 +174,12 @@ func nameServiceGeneratedEndpointsGotemplate() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/generated/endpoints.gotemplate", size: 2127, mode: os.FileMode(436), modTime: time.Unix(1477333032, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/generated/endpoints.gotemplate", size: 2100, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServiceGeneratedTransport_grpcGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x57\xdf\x6f\xdb\x36\x10\x7e\x16\xff\x8a\x9b\x51\x0c\x76\xe0\x48\x7b\x0e\x90\x97\xa6\x5d\x52\x6c\xe9\x82\x2c\xd8\x1e\x8a\xa2\xa0\xa5\xb3\x44\x98\x22\x15\x92\x76\xe2\x09\xfa\xdf\x87\x23\x25\x5b\x4e\x94\xc8\x29\xf2\x50\xb8\x91\xee\xc7\x77\xdf\x77\x77\xa4\x2a\x9e\xae\x78\x8e\x60\x37\x29\x63\x49\x02\x77\x85\xb0\xb0\x14\x12\xa1\x32\x7a\x23\x32\xb4\x60\xd1\x6c\xd0\x9c\x5a\x91\x21\x2c\x84\xca\x84\xca\x2d\x2c\xb5\x01\x57\x20\xe4\xb7\x37\x17\xe0\x0c\x57\xb6\xd2\xc6\xc5\x14\xe2\x8b\x83\xb5\x13\x52\xfc\x87\xd6\x9b\xec\xde\x26\xb9\xa9\xd2\xf8\x6f\x1f\x2e\x66\x4c\x94\xf4\x10\xa6\x2c\x9a\x28\x74\x49\xe1\x5c\x35\x61\x2c\x9a\xe4\x5a\x72\x95\xc7\xda\xe4\xc9\x63\x42\x6f\x52\xad\x1c\x3e\xba\x89\x7f\xa7\x73\x89\x71\xcf\x84\x62\x26\x25\x3a\x9e\x71\xc7\xc9\x9f\x1e\xec\x52\xc2\x24\x17\xae\x58\x2f\xe2\x54\x97\x49\xae\x4f\x57\xc2\x25\xf4\xef\x10\x13\xb9\x75\xb5\x13\x3c\x91\x22\x8b\xaa\x05\x4c\xea\x3a\xbe\xf9\xf8\xc5\xe3\xbc\xe1\xae\x80\xd3\xa6\x99\xb0\x19\xf3\x4c\x5d\xf3\x15\x5e\xde\xde\x5c\x84\x7a\xa0\xe4\x2b\xb4\xc0\xc1\xa2\x03\xbd\x04\x54\x59\xa5\x85\x72\x16\xf8\x86\x0b\xc9\x17\x12\x81\xd3\x7b\x4f\x58\x5d\x5f\xea\xaf\xbc\x44\x88\xdb\x74\xf1\x25\x3a\x7a\xd0\x34\x1d\x3d\xcb\xb5\x4a\x9f\xe4\x98\xa6\xee\x11\x5a\x32\xe2\x8b\xf0\x3b\xef\x65\xfa\xdc\xfd\x6f\x06\xd5\x22\x1e\xcd\x01\x35\x8b\x82\xb6\x7f\x55\x4e\x68\x65\xe1\xec\x1c\xbe\x7d\x3f\xe0\xaf\x55\x2b\x18\xd4\x2c\x8a\x60\xe8\xf5\x47\x5c\x6a\x83\xd3\x4e\x85\x3b\xdd\x82\x9b\xcd\x59\xd4\xb0\xc8\xa0\x5b\x1b\x05\xbf\x92\x6b\x70\xa8\x3d\xdf\x75\x0d\x77\xfa\x4f\xfd\x80\xe6\x19\x46\x68\x1a\x16\xd5\xb5\xe1\x2a\x47\xf8\x20\x08\xd9\xce\xe4\x1a\x5d\xa1\x33\x4b\x16\x51\x5d\x77\x11\x3e\x88\x7d\x7d\x67\x4f\x50\x7e\xc5\x87\x96\x41\x16\x45\x51\xea\x1e\xe7\xf4\xbb\x23\x2e\xae\xeb\xbe\x77\x47\xa3\x37\xfa\x84\xa9\xce\xbc\x06\x87\x46\xb7\x78\xbf\x46\x1b\x6c\x3e\xab\x97\x6c\x6c\xa5\x95\x45\x6f\x74\xc0\x74\x1c\xc7\xf4\x90\xf8\xa9\xeb\x53\x92\x90\xaa\x69\x58\xe3\x3b\x6b\xcf\x13\x88\xb2\x92\x58\x22\xa9\x4b\xa3\x34\xae\xa9\x50\x0e\xcd\x92\xa7\xc8\xdc\xb6\xc2\x7e\x28\xeb\xcc\x3a\x75\x50\xb3\x71\x5a\x87\x59\x05\x78\x42\xeb\x15\x57\x99\x44\xc3\xf6\x25\x04\xfc\x6d\x24\xbf\x23\x7a\x00\x9c\xde\x97\xf3\xa6\x4a\x46\x01\xfb\x59\x99\x5a\x38\xd9\x67\x9b\xed\x33\xf4\x6b\x18\x1e\x21\x83\xf7\x70\xd2\x1f\x99\x0f\x22\x6e\x05\xbe\xdb\x56\x3d\x68\x33\x98\x3e\xb7\x0b\x22\x1f\x1a\xce\x01\x8d\xd1\x84\x82\x45\x3f\x28\x41\xe5\x9f\x10\x7e\x6a\xb7\x21\x7a\xc3\x2c\x51\x17\x11\x48\x0f\x6a\xc6\x22\xb1\xf4\x7e\xbf\x9c\x83\x12\x92\xa2\x75\xd3\xa4\x84\xf4\x21\xfb\x13\x66\xb0\x8a\x8f\x04\x38\x9b\x53\x04\xd6\xb0\xba\x0e\xd2\x91\x70\x2d\xf3\xa1\xe7\xc7\x69\x4f\x12\x18\x19\x0f\x10\xb4\xf2\x9e\x1c\x00\xc1\xa7\xb5\xf8\x9d\xa4\x73\x05\x77\xa4\xca\x06\x0d\x2d\x4c\x3f\x03\x61\x4d\x0e\xf6\xa1\x69\x83\x3b\x0d\x1c\xd6\x16\xcd\x69\xa6\x4b\x2e\xd4\x88\x7d\x0c\x37\x46\x94\xdc\x08\xb9\x25\xaf\xe5\x5a\x82\x50\x7e\x63\xf7\x36\xee\x48\x41\xd3\x1f\xcf\xbb\x87\x8a\xba\xc5\xfb\x7d\xc3\xd6\xd4\x27\xbd\xbf\xfa\xcd\x40\xad\x76\x76\xde\xf9\x0c\xa9\x35\xd4\x76\x3d\x85\xef\x9f\x09\x47\x74\x5d\x48\x41\x53\xf5\x2e\xca\x85\x76\x79\x55\xba\x60\xf2\x73\xda\x55\x72\xfb\x06\xe5\x42\xa6\x97\xa4\x4b\x7d\xd9\xa3\xd2\x85\x20\x2f\x6b\x47\x90\x8e\x54\x8f\x4c\x77\xfa\x55\x72\x7b\xf4\xbc\xf5\x87\x54\x6e\x5f\x99\xbe\x70\x9a\x1c\xa5\xe1\xd8\xc1\x33\xa8\x61\x70\x1a\xd3\xf0\x0d\xe2\x04\x35\x47\x45\x3f\x6a\xfc\xc6\x2a\x1a\xd2\x70\x87\xe3\x48\x09\x6d\x45\x8c\xee\x5a\xeb\x27\x04\xb4\xd5\x6b\x43\xf8\x2e\x02\xbe\xbc\x3e\x3b\xfd\x5e\x5d\x9f\xc7\x6f\xc5\x63\xd4\x7b\x75\x7d\x1e\xcc\xe0\x48\x41\xc3\xf2\xb5\xb5\xbe\x61\x7d\x76\x90\xde\x63\x7d\x26\x09\x5c\xa1\xac\xd0\x58\x16\x6a\x78\x76\x8d\x1d\xbe\x34\x94\x19\x9c\x74\xa6\xf1\xf5\xa7\xd9\x53\x0b\x82\x4b\x37\xa0\xd5\x1c\x36\x1e\xb3\xef\x86\x93\x32\xf3\xa7\xb8\x58\xc2\xa6\x7f\xaa\x87\xef\x0f\x84\x15\x6e\xbd\xea\x59\x86\x19\x2c\xb4\x2b\x88\xe4\x2e\x0d\xdd\xa8\x4a\xee\x60\xba\x9a\xc1\x43\x21\xd2\xc2\x9b\x4a\x09\x92\x54\x6b\xa3\x70\x95\xf9\xbb\x22\x7d\x4f\xc5\x17\x5c\x69\x25\x52\x2e\xaf\x90\x67\x68\xfe\xc0\x2d\x7d\x9c\xb8\x36\x91\xd5\xa1\x77\x84\x83\x94\x2b\x58\x60\x17\x22\x4d\xd1\x5a\xcc\x28\x37\x0a\x57\xa0\x69\x33\xb7\xd7\x67\x38\xdf\x15\xfb\xaf\x70\xc5\x3f\x5c\xae\x31\x5c\x5a\xa8\xd8\x6f\xbf\x7d\x9f\x8d\x1a\xbe\x80\x6e\xba\x9a\xed\x23\xf8\x2b\xf1\x4e\xbb\xd4\x3d\xb2\x86\xfd\x1f\x00\x00\xff\xff\xba\xba\x12\xdf\xb0\x0e\x00\x00")
|
||||
var _nameServiceGeneratedTransport_grpcGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xa4\x57\xdf\x6f\xdb\x36\x10\x7e\xb6\xfe\x8a\x9b\x51\x0c\x56\x10\xcb\x7b\x2e\x90\x97\xa6\x5d\x53\x6c\xe9\x82\x2e\xd8\x1e\x8a\xa2\xa0\xa5\xb3\x4c\x58\x12\x15\x92\x76\x92\x09\xfe\xdf\x77\x47\x4a\xb2\xfc\x23\xb2\xda\x3c\x04\x0e\xc5\xfb\xf1\xdd\xf7\xdd\x51\x54\x29\xe2\x95\x48\x11\xcc\x26\x0e\x82\xd9\x0c\xee\x97\xd2\xc0\x42\x66\x08\xa5\x56\x1b\x99\xa0\x01\x83\x7a\x83\x7a\x6a\x68\x01\x73\x59\x24\xb2\x48\xc9\x44\x69\xb0\x4b\x84\xf4\xcb\xdd\x35\x58\x2d\x0a\x53\x2a\x6d\x23\x0e\xf1\xc9\xc2\xda\xca\x4c\xfe\x47\xbe\x6c\xd2\xee\xce\x52\x5d\xc6\xd1\xdf\x2e\x5c\x14\x04\x32\xe7\x87\x30\x09\x46\xe3\x02\xed\x6c\x69\x6d\x39\x0e\x68\x91\xaa\x4c\x14\x69\xa4\x74\x3a\x7b\x9a\xf1\x4e\xac\x0a\x8b\x4f\x76\xec\xf6\x54\x9a\x61\xd4\x31\xe1\x98\xb3\x1c\xad\x48\x84\x15\xec\xcf\x0f\xda\x94\x30\x4e\xa5\x5d\xae\xe7\x51\xac\xf2\x59\xaa\xa6\x2b\x69\x67\xfc\xb7\x8f\x89\xdd\x9a\xda\x19\x9e\x8c\x31\x18\x95\x73\x18\x57\x55\x74\xf7\xee\x93\xc3\x79\x27\xec\x12\xa6\xdb\xed\x38\x08\x03\xc7\xd4\xad\x58\xe1\x47\xaa\xde\xd7\x03\x39\x2d\x0d\x08\x62\xcb\x82\x5a\x00\x16\x49\xa9\x64\x61\xe9\xd1\x46\xc8\x4c\xcc\x89\x51\xc1\xfb\x8e\xb0\xaa\xfa\xa8\x3e\x8b\x1c\x21\xaa\xd3\x45\xbc\xda\x6e\x1b\x6e\x16\xeb\x22\x3e\x48\x30\x89\xed\x13\xd4\x4c\x44\xd7\xfe\xf7\xb2\x93\xe6\x43\xf3\x5f\x08\xe5\x3c\xea\x4f\x00\x55\x30\xf2\xaa\xfe\x55\x5a\xa9\x0a\x03\x6f\xaf\xe0\xeb\xb7\x3d\xe6\x6a\x9d\xbc\x01\xd9\x8f\xe0\xd4\xf6\x3b\xa4\x46\xc0\x49\xc3\xff\xbd\xaa\x91\x85\x97\xc1\x68\x1b\x8c\x34\xda\xb5\x2e\xe0\x57\x76\xf5\x0e\x95\x63\xba\xaa\xe0\x5e\xfd\xa9\x1e\x09\xca\x1e\x40\xd8\x92\x53\x55\x51\x12\x6a\xc9\x37\x92\x61\xb5\xfb\xb7\x68\x97\x2a\x31\x6c\x41\x26\x8d\xfb\x1b\x59\x57\xf6\xf6\x00\xdf\x67\x7c\xac\x89\x23\xfb\x11\x91\x77\xc9\xbf\x2d\x5f\xc4\x50\xeb\xda\x50\xe7\x2c\xde\x63\xac\x12\xc7\x7b\xc7\xe2\x0b\x3e\xac\xd1\x78\x83\x0f\xc5\x49\x03\xca\x5a\x18\x74\x16\x7b\xd4\x46\x51\xc4\x0f\x99\x90\xaa\x9a\xb2\x60\x5c\xc1\x36\xd8\xba\x26\xda\x11\x03\x34\x0e\x19\xe6\xc8\x5a\xf2\xd4\x9c\x51\x90\xe0\xa2\x5e\x08\x6a\x54\xfb\x5c\x62\x37\x8e\xb1\x7a\x1d\x5b\x92\xf8\x3c\x8f\x27\x68\x04\x38\xe0\xf1\x46\x14\x49\x86\x3a\xd8\x81\xf7\xc8\xeb\x30\xee\x20\xe8\x64\xb7\x6a\x57\xc8\xf0\x1a\xce\x42\x75\x03\x31\x31\x70\xb1\x4b\x15\xee\xc2\xb7\xe8\x4f\x0f\x89\xc6\x07\xb8\xe8\x0e\x05\xd9\xd7\x8a\xde\x13\x79\xb5\x6f\x08\x93\x63\x23\xaf\x6a\xc7\x8a\x46\x4e\x6b\xc5\xc9\x83\xd1\x77\x0e\x5d\xba\x27\x0c\x9b\x7b\xea\x88\x4f\x3f\x27\xdc\x2d\x8c\xcd\x61\x09\x83\x91\x5c\x38\xa7\x5f\xae\xa0\x90\x19\x87\x6a\x26\x85\x96\x2e\x5e\x77\x7a\x28\x47\x34\x04\x5a\x78\xc9\xee\x24\x4f\x55\x79\xa1\x58\xa6\x9a\x6a\xdf\xd5\xe7\x79\x26\x8f\xbe\x01\x00\xc9\x47\xd8\xc1\x81\xee\x1d\x6a\x8b\xdf\x59\x28\xbb\x14\x96\x65\xa0\xcc\x7c\x00\xba\x46\xf7\xc7\xde\x71\xbf\xe9\x3a\x32\x35\x8e\x80\x35\x8d\xce\x34\x51\xb9\x90\x45\x9f\x71\x04\x77\x5a\xe6\x42\xcb\xec\x99\x5d\x16\xeb\x8c\x7a\xc9\x9d\xbd\x9d\xe3\xb3\xaf\x8e\xc9\xf7\xe3\x2e\xe1\x5a\x68\x7b\xd7\x95\x15\xb7\x44\x67\xd5\x95\x9e\x5b\x8a\x18\xac\x7d\x4e\xc9\x73\xd4\x5e\x1d\x3d\x1f\x8e\x94\x62\x8a\xae\x33\xc9\x43\xf3\x7a\xa9\x7c\x67\xf4\x6a\xe5\x4d\x7e\x42\xac\x92\x28\x1f\x28\x95\xcf\xf1\x92\x56\xb1\xab\xb6\x5f\x2b\x1f\xe1\x65\xb1\x18\xcc\x40\xb9\xd8\xb4\x15\x8c\x16\xc3\x26\xaa\x3b\x83\xd9\x73\xcf\x7c\xf9\x97\xc2\x20\xd1\x7a\xdf\x1f\x27\x45\xf3\x1e\xe7\x44\x1b\x2a\x88\x97\xaf\x5f\xe2\x41\x03\xd6\x5b\xc8\x29\xd1\x5a\x04\x03\x35\x33\x25\xb3\xd8\x36\xd2\x8f\x2a\x66\xca\xbe\x31\x7b\xbd\x62\x2f\x9f\x88\x8d\x60\xbd\x27\xe2\xc0\xb3\xee\xac\x5c\xbd\x27\xe2\xde\x94\xf5\xd5\x71\x5a\xaf\xba\xc4\x1f\x38\x11\x1b\x3c\xaf\x3e\x11\x89\xa1\x1b\xcc\x4a\xd4\x26\xf0\xe8\x8f\xee\x98\xa7\x5f\xf6\x79\x02\x17\x8d\x69\x74\xfb\x3e\x3c\xb4\x60\xac\x7c\x67\x59\x5d\xc2\xc6\x01\x76\xf2\x5f\x90\x1b\xbf\x86\xe9\xc5\xbc\xe9\xbe\x96\xfd\x67\x01\xc2\x0a\x9f\x9d\xd2\x49\x82\x09\xcc\x15\x7d\x0a\x10\xbd\x4d\x1a\xbe\x03\xe5\xa4\xef\x64\x15\xc2\xe3\x52\xc6\x4b\x67\x9a\x65\x90\xb1\x58\x75\x14\xba\x46\xb9\x7b\x1d\x7f\xe6\x44\xd7\xa2\x50\x85\x8c\x45\x76\x83\x22\x41\xfd\x07\x45\xa7\x6f\x06\x5b\x27\x32\xca\xf7\x8b\xa4\x96\x11\x05\xcc\xb1\x09\x11\xc7\x68\x0c\x01\xa0\xdc\x48\x9f\x35\xd4\x08\x3e\x73\x7d\xc3\x85\xab\xb6\xd8\x7f\x69\xfb\x1f\x91\xad\xd1\xdf\x3a\xb8\xd8\xaf\xbf\x7d\x0b\xcf\x1a\xbe\x80\x8e\x2a\xdb\x45\x70\xd7\xd7\x56\x3b\x72\x23\xd9\xfe\x0f\x00\x00\xff\xff\x09\x00\x51\xc2\x47\x0e\x00\x00")
|
||||
|
||||
func nameServiceGeneratedTransport_grpcGotemplateBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -194,12 +194,12 @@ func nameServiceGeneratedTransport_grpcGotemplate() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/generated/transport_grpc.gotemplate", size: 3760, mode: os.FileMode(436), modTime: time.Unix(1477708246, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/generated/transport_grpc.gotemplate", size: 3655, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServiceGeneratedTransport_httpGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x2c\xcb\xb1\x0d\xc2\x30\x10\x05\xd0\x3e\x53\x5c\x1d\x09\xdf\x1a\x29\x91\xe2\x05\xac\xf0\x31\x08\x93\xb3\xce\x1f\x1a\xeb\x76\xa7\x61\x80\x37\xa7\xae\xb2\x03\x52\xed\x42\xff\x8c\xa1\x15\x67\xb5\xd7\x93\xfa\x20\x3b\xbd\x9c\xa3\x9b\x53\x89\x77\x6f\x85\x48\xd5\xe4\x6e\x2e\x87\xdd\x20\xab\x46\x2c\x73\x1e\xa5\x35\x49\x5b\xce\xd7\x0d\xad\xc3\xd3\x0e\xff\xc2\xf3\x9f\x48\x8a\x58\x7e\x01\x00\x00\xff\xff\xaf\xf5\x0f\x3e\x69\x00\x00\x00")
|
||||
var _nameServiceGeneratedTransport_httpGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x2c\xcb\x31\x0e\xc2\x30\x0c\x05\xd0\x9d\x53\x78\xae\x44\x7c\x8d\x8e\x48\xcd\x05\xa2\xf2\x09\x88\x50\x47\xce\x87\xc5\xca\xdd\x61\x60\x7f\x2f\x42\x17\xd9\x00\xa9\x76\xa6\xbf\xc7\xd0\x8a\xa3\xda\xf3\x41\xbd\x93\x9d\x5e\x8e\xd1\xcd\xa9\xc4\xab\xb7\x42\xa4\x6a\x72\x33\x97\xdd\xae\x90\x45\xe7\x3c\x45\xec\xa5\x35\x49\x6b\xce\x97\x15\xad\xc3\xd3\x06\xff\xc0\xf3\xbf\x48\xfa\xa9\x6f\x00\x00\x00\xff\xff\xaf\xf5\x0f\x3e\x69\x00\x00\x00")
|
||||
|
||||
func nameServiceGeneratedTransport_httpGotemplateBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -214,12 +214,12 @@ func nameServiceGeneratedTransport_httpGotemplate() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/generated/transport_http.gotemplate", size: 105, mode: os.FileMode(436), modTime: time.Unix(1477696627, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/generated/transport_http.gotemplate", size: 105, mode: os.FileMode(436), modTime: time.Unix(1477930115, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServiceHandlersClientClient_handlerGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x92\xc1\x6e\xdb\x30\x0c\x86\xcf\xd1\x53\x10\x45\x50\xc4\x41\x6a\xdf\x0b\xec\x90\x0e\x6d\xd0\xc3\x86\xa2\xdb\x0b\x28\x36\x63\x0b\xb3\x29\x4d\xa2\xb7\x0e\x84\xde\x7d\x90\xe2\x34\x4b\x53\x6c\xc5\xd0\x4b\xc0\x88\x3f\x7f\x92\x1f\x2d\x02\x3f\x0d\x77\x30\x67\x1c\x5c\xaf\x19\x6f\x9f\xb0\x1e\xd9\x7a\xb8\xfe\x00\x65\x8c\xca\xe9\xfa\x9b\x6e\x11\xea\xde\x20\x71\xa7\xa9\xe9\xd1\x2b\x65\x06\x67\x3d\xc3\x42\xcd\xdc\x16\x2e\x44\xce\xea\xcb\x87\x9b\xfb\xac\x79\xd0\xdc\xc1\x55\x8c\x17\xaa\x50\x4a\x89\x78\x4d\x2d\xc2\xdc\xa4\x06\xe7\x55\x5f\xd0\xff\x30\x35\x96\x9f\x90\x3b\xdb\x84\x18\x55\x55\x81\xc8\xdc\x94\x1b\xe4\xcf\x7a\xc0\x18\xc1\x0c\xae\xc7\x01\x89\x03\x1c\xe4\x6a\x37\x52\xfd\x42\xb7\x10\xc9\xab\x19\x6a\xf0\xe9\x95\x56\x1f\xf3\x46\x6b\xdf\x86\xdc\x2d\x05\xf0\x67\xbd\xc8\xc6\xa6\x08\xca\xbb\x91\x6a\x36\x96\x92\x24\xbd\x23\x35\x31\x16\xb0\x58\xba\x6d\xf9\xac\x9a\x9b\xf2\x11\xbf\x8f\x18\xf8\xeb\x2f\x87\x47\x9b\x15\xa0\xf7\xd6\x17\xa2\x44\xaa\xa5\x12\xb9\x9a\x88\x0f\xc8\x5d\x82\xf0\x7f\xf3\x25\xa4\x6a\x96\xdc\x26\xa0\x4e\x7b\x3d\x64\xa8\xc9\xb8\xcc\xf2\xac\xc9\x22\xb3\x03\xb2\x3c\xa9\xca\xfb\x70\xa3\x03\xa6\x39\x27\x49\x55\xc1\xba\x69\xa0\x1e\x03\xdb\x01\xb6\x63\x30\x84\x21\x40\x6f\x5b\x53\xc3\xce\x7a\x30\xc4\xe8\x9d\x47\x36\xd4\x26\xce\x7b\x9f\xbb\x5e\xb7\x6b\xdf\xc6\xb8\x9a\xda\x20\x35\xc7\xc1\x0e\x7f\xa6\x38\x46\xb5\xac\x52\xce\xef\x31\xa5\x59\xdf\x02\x50\xde\x9d\xd9\x5b\x89\x69\x6a\x60\x91\x7f\x5e\x65\x57\x9c\xbc\x3f\xa2\x43\xcd\xd8\x14\xa7\xcf\xb7\x34\x0e\xc5\x64\x7a\x58\x74\x9f\x99\xbe\xe6\x6b\xb8\x7c\x99\xd9\xd8\x53\xa8\x7d\x40\xf8\xbb\xc5\xbf\x1c\x8e\x67\x39\x3f\xca\x2c\x9f\x84\x47\x4f\x70\x39\x9d\x66\x05\x64\x7a\x95\x44\x7b\xc9\x73\xf0\x3b\x00\x00\xff\xff\xec\x76\x11\x73\x2f\x04\x00\x00")
|
||||
var _nameServiceHandlersClientClient_handlerGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x52\x4d\x6f\x13\x31\x10\x3d\xc7\xbf\x62\x54\x55\x55\x36\x6a\x9d\x7b\x25\x0e\x2d\x6a\xab\x1e\x40\x55\xe1\x0f\x38\xbb\x93\x8d\x85\xbf\xb0\xbd\x50\x64\xf9\xbf\x33\x76\x9c\x94\x90\x8a\x20\xc4\x65\x35\x6b\xbf\x79\xef\xcd\x1b\xa7\x04\xdf\x65\xdc\xc0\x79\x44\xed\x94\x88\x78\xf7\x82\xfd\x14\xad\x87\xeb\x77\xc0\x73\x66\x4e\xf4\x5f\xc4\x88\xd0\x2b\x89\x26\x6e\x84\x19\x14\x7a\xc6\xa4\x76\xd6\x47\x98\xb3\x99\x5b\xc1\x59\x4a\x47\xfd\xfc\xe9\xf6\xb1\x62\x9e\x04\xd1\x5f\xe5\x7c\xc6\x3a\xc6\x58\x4a\x5e\x18\xa2\x3b\x97\x45\xe0\xb8\xeb\x13\xfa\x6f\xb2\x47\xfe\x01\xe3\xc6\x0e\x81\x0c\x2c\x97\x40\xf4\x92\x7f\x14\x1a\x73\x06\x12\x56\xa8\xc9\x4a\x80\x1d\x96\xad\x27\xd3\xff\x0a\x9a\xa7\x54\x87\x92\x66\xc0\x97\x37\x44\xde\xd7\x59\x6e\xfc\x18\xaa\x4e\x29\x60\xdf\x9c\xd2\x83\x2d\x15\xf0\x7b\xa2\x8d\xd2\x9a\x72\x5f\xce\xd1\x0c\x39\x77\x30\x5f\xb8\x15\xdf\xa3\xa8\xef\x19\xbf\x4e\x18\xe2\xe7\x1f\x0e\x1b\xc7\x25\xa0\xf7\xd6\x77\x89\xe6\x5d\x2e\xe8\x73\xd5\x52\xd6\x24\x57\x06\xff\x07\x67\x25\x43\x36\x2b\x54\x2d\x41\x27\xbc\xd0\x35\xc5\xc2\xca\x2b\xb6\x62\x2a\x48\xae\xc1\xd8\xd8\x50\xfc\x31\xdc\x8a\x80\xc5\x61\x83\x50\xaa\x37\xc3\x00\xfd\x14\xa2\xd5\xb0\x9a\x82\x34\x18\x02\x28\x3b\xca\x1e\xd6\xb4\x7e\x69\x22\x7a\xe7\x31\x4a\x33\x96\x6c\xb7\x3c\xf7\x4a\x8c\x24\x44\x13\x36\x19\xca\xe4\xd5\xd8\xee\xa7\xd5\x54\x2d\x96\xe5\xce\x6f\x03\x2a\x5e\x4f\x46\x97\xfe\x6f\x5a\x7f\x9b\x15\xbd\x6b\x98\xd7\xcf\x9b\xa9\x75\x07\xe7\xcf\xe8\x90\x7c\x0c\xdd\xe1\xf1\x9d\x99\x74\xd7\x48\x77\x23\x6e\x6f\xda\xdb\xbd\x86\x8b\xdf\x6f\x1e\xec\x61\x9c\x2a\x20\xfc\x99\xe2\x14\xc3\xeb\x42\x8e\xd7\x31\xab\xcb\x88\x93\x37\x70\xd1\x96\x72\x09\x46\x2a\x56\x40\x5b\xc8\xbe\xf8\x19\x00\x00\xff\xff\x59\xb7\xfe\xb0\x1a\x04\x00\x00")
|
||||
|
||||
func nameServiceHandlersClientClient_handlerGotemplateBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -234,12 +234,12 @@ func nameServiceHandlersClientClient_handlerGotemplate() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/handlers/client/client_handler.gotemplate", size: 1071, mode: os.FileMode(436), modTime: time.Unix(1476751391, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/handlers/client/client_handler.gotemplate", size: 1050, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServiceHandlersServerServer_handlerGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x52\x4b\x6e\xdb\x30\x10\x5d\x8b\xa7\x18\x08\x46\x61\x17\x0e\xb5\x0f\x90\x4d\x8b\x36\xc8\xa2\x41\xd0\x66\x1f\xd0\xd4\x58\x9a\x84\x22\x55\x72\x94\x38\x20\x78\xa6\x1e\xa2\x17\x2b\x28\x45\x8e\xed\xa6\x45\x77\x5d\x18\x26\x34\x6f\x1e\xe6\x7d\x7a\xa5\x1f\x54\x83\xd0\x2a\x5b\x1b\xf4\x42\x54\x15\xdc\xb6\x14\x60\x4b\x06\x41\x3b\xcb\x8a\x6c\x00\x6e\x11\xbe\xa1\x7f\x24\x8d\x50\xe3\x96\x2c\x31\x39\xbb\x06\x65\x6b\x50\xb0\x51\x81\x34\x84\x69\x9e\x19\xa8\xeb\x0d\x76\x68\x59\x65\x98\x84\x2b\x06\x65\x82\x03\xb2\xda\x0c\x35\x86\x19\x0b\x1d\xd5\xb5\xc1\x27\xe5\x31\x48\x21\xa8\xeb\x9d\x67\x58\x8a\xe2\x0e\x4a\xf4\xde\xf9\x50\x8e\x6f\xa6\x0e\x4b\x21\x8a\xb2\x71\x46\xd9\x46\x3a\xdf\x54\xbb\xca\x22\x57\xf9\x42\xdc\x71\x1e\xde\x41\xd9\x10\xb7\xc3\x46\x6a\xd7\x55\x8d\x3b\x7b\x20\xae\xf2\xcf\xb8\xa6\xfc\xcb\xb8\x43\xf6\xa4\x43\xa6\xe8\x37\x50\xc6\x28\x6f\x3e\x5c\x8d\x97\xdc\x28\x6e\xe1\x2c\xa5\x52\xac\x84\x18\xad\xb9\xc6\xa7\xd9\x06\x8f\x3c\x78\x1b\x40\x81\x55\x3f\x7f\x3c\xe2\x1a\x02\x2b\x46\x83\x21\x9c\xe8\x07\xb7\x9d\xcd\x93\x62\x3b\x58\x7d\x40\xb3\x5c\xed\x7d\x8d\xa2\x98\x38\x21\x9f\x30\xe5\x72\xad\x3a\x4c\xe9\x05\x11\x93\x48\x42\xf0\x73\x8f\x7f\x42\x40\x60\x3f\x68\x8e\x49\x88\x18\x9f\x88\x5b\x58\x7c\xda\xa1\x1e\xd8\x79\x38\xbf\x00\x99\xd2\xfe\xfb\xc1\x7a\x1e\xed\x71\xc7\xbc\x99\xc7\x2b\xdb\x20\x2c\xe8\x18\x36\x0b\xfa\x82\xdc\xba\x3a\xa4\x94\xed\x89\x71\x41\xf2\x12\x79\x5a\x7e\xb5\x21\x9c\xe8\x5f\x86\x0c\x7d\x4b\xc1\xea\x84\x63\xa9\x79\x07\x2f\x21\xcb\x8f\xd3\xff\x1a\xc8\xc2\xfb\x7e\x23\x63\xbc\x74\xa3\x80\x05\xc9\xaf\xf8\x7d\xc0\xc0\xb7\xcf\x3d\xbe\x6e\xaf\x60\xf9\x3b\x2e\xf4\xce\x06\x3c\x06\xae\x61\xac\xdb\x2a\xe6\x9e\x5c\x80\xe6\xdd\xf4\x20\x9b\x43\x99\x36\xb2\xfe\x7f\x22\x8b\xa2\x28\xf6\xb6\xdd\x8f\xb6\x9d\x40\x3f\x13\x9a\x3a\xe4\x6a\x89\xa2\x18\x7d\x9b\x39\xef\x67\x1a\x48\xe9\x1c\x46\x22\xb4\xf5\x84\x4c\xfb\x82\xbc\x9b\x6f\x5a\x83\x25\x23\x72\xaa\x68\xeb\x31\xdd\x33\x38\x7d\x4d\x8d\x99\x1b\x42\x96\xd1\x6f\xd5\xd8\xb7\xe3\x6c\xdf\x88\xb4\xf8\xaf\x61\x1c\x68\x48\xe2\x57\x00\x00\x00\xff\xff\xe2\x0f\x6e\x9b\xa9\x04\x00\x00")
|
||||
var _nameServiceHandlersServerServer_handlerGotemplate = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xc4\x93\xc1\x6e\x13\x31\x10\x86\xcf\xf1\x53\x8c\x56\x11\x4a\x50\xe2\xbd\x57\xea\x05\x04\xa8\x87\x56\x15\xf4\x8e\x1c\xef\x64\xd7\xed\xae\xbd\xd8\xde\x26\xc8\xf2\x33\xf1\x10\xbc\x18\x63\x6f\x36\x24\xa1\xc0\xb1\x87\x28\x56\xfc\xcd\xef\x99\x7f\xfe\xf4\x42\x3e\x89\x1a\xa1\x11\xba\x6a\xd1\x32\x56\x96\xf0\xd0\x28\x07\x5b\xd5\x22\x48\xa3\xbd\x50\xda\x81\x6f\x10\xbe\xa0\x7d\x56\x12\xa1\xc2\xad\xd2\xca\x2b\xa3\x57\x40\x55\x20\x60\x23\x9c\x92\xe0\xc6\xfb\xa4\xa0\xba\xbe\xc5\x0e\xa9\x38\x61\x1c\x6e\x3c\x88\xd6\x19\x50\x5a\xb6\x43\x85\x6e\x62\xa1\x53\x15\x3d\xbb\x13\x16\x1d\x67\x8c\xca\x8c\xf5\xb0\x60\xb3\xaf\x50\xa0\xb5\xc6\xba\x22\x9f\xbd\xea\xb0\x60\x6c\x56\xd4\xa6\x15\xba\xe6\xc6\xd6\xe5\xbe\xd4\xe8\xcb\xd4\x21\xee\x7d\xba\x24\xae\x56\xbe\x19\x36\x5c\x9a\xae\xac\xcd\xfa\x49\xf9\x32\x7d\x5a\x53\x17\xff\xb8\xee\xd0\x5b\x25\x5d\x92\xe8\x37\x50\x84\xc0\xef\xdf\xdd\xe4\x4e\xee\x85\x6f\x60\x1d\x63\xc1\x96\x8c\x65\x6b\xee\x70\x37\xd9\x60\xd1\x0f\x96\xac\x11\xa0\xc5\xcf\x1f\xcf\xb8\x02\x47\xe3\x62\x8b\xce\x5d\xcc\x0f\x66\x3b\x99\xc7\xd9\x76\xd0\xf2\x44\x66\xb1\x3c\xfa\x1a\xd8\x6c\xd4\x84\xd4\xc2\xb8\x97\x3b\xd1\x61\x8c\x07\x22\x44\x16\x19\xf3\xdf\x7b\xfc\x1b\x41\x2d\xd8\x41\x7a\x02\x59\x08\x3b\x9a\x16\xe6\x1f\xf6\x28\x07\x6f\x2c\x5c\x5d\x03\x8f\xf1\xf8\xfb\x49\x79\xba\x3a\x72\xe7\xba\x49\xc7\x92\xe3\x08\x73\x75\x8e\x4d\x03\xdd\xa2\x6f\x4c\xe5\x08\x25\x7b\x42\x98\x2b\x3e\x56\xfe\xf6\xc0\x5d\x0c\xbf\x70\x89\x7b\xa9\xfd\xe5\xa9\xc0\x42\xfa\x3d\x1c\xd6\xcb\xdf\x8f\xdf\x2b\x4a\x10\xbc\xed\x37\x3c\x84\x4f\x26\xb7\x4e\xf8\x67\xfc\x36\xa0\xf3\x0f\xe4\xcb\xa1\x74\x09\x8b\x3f\x21\xd7\x1b\xed\xf0\x84\x5a\x41\x8e\xd8\x32\xa4\x6c\x5c\x03\x3d\x37\x1e\x94\x4e\x8b\x18\xf1\x34\xf3\xff\x95\x48\x61\x76\xf4\xe9\x31\xfb\x74\xc1\xdd\x52\x2a\x68\x5a\xfe\x51\x61\x5b\xb9\x94\x29\x2a\xc9\x86\x4d\xc2\x8f\x59\x0b\x62\xbc\x82\xac\x86\xf4\xcf\xca\x58\x3c\xc6\xe2\xcd\xd4\xd5\x0a\xb4\x6a\x59\xda\x25\x51\x79\xa7\x6b\xb8\x3c\x8d\x39\x99\x72\xa1\xc8\x3e\xbb\x15\x39\x65\xe7\x1b\x7d\x61\x91\xb3\xd7\xd8\xc2\x49\xeb\x91\xfd\x0a\x00\x00\xff\xff\x05\xcf\x17\xf8\x96\x04\x00\x00")
|
||||
|
||||
func nameServiceHandlersServerServer_handlerGotemplateBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -254,12 +254,12 @@ func nameServiceHandlersServerServer_handlerGotemplate() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/handlers/server/server_handler.gotemplate", size: 1193, mode: os.FileMode(436), modTime: time.Unix(1477016114, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/handlers/server/server_handler.gotemplate", size: 1174, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServicePartial_templateClient_handlerMethods = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x92\xc1\x4e\xc3\x30\x0c\x86\xcf\xe4\x29\x7c\xa8\xd0\x86\xb6\xf4\x3e\x89\xc3\x40\x6c\xe2\x00\x07\xe0\x05\xba\xd6\xeb\x22\xb5\x4e\x49\x5c\x18\x8a\xf2\xee\x28\x59\xca\x60\x9b\xd0\x84\xb8\xa5\xf1\x57\xfb\xcf\x27\x3b\x07\xef\x8a\x37\x90\x31\xb6\x5d\x53\x30\xde\x6d\xb1\xec\x59\x1b\x98\x5d\x83\xf4\x5e\x08\xe7\x4c\x41\x35\x42\xa6\xc2\xd5\x11\x27\x9f\xd1\xbc\xa9\x12\xe5\x03\xf2\x46\x57\xd6\x7b\x91\xe7\xe0\x5c\xa6\xe4\x12\xf9\xb1\x68\xd1\x7b\x50\x6d\xd7\x60\x8b\xc4\x16\x06\x5c\xac\x7b\x2a\x0f\xb8\x91\x73\x31\x8c\xa2\x0a\xb7\x27\x46\xdd\x36\x0a\x89\xe7\xa6\xb6\x71\x5a\x38\xc0\xf7\xff\x9d\x5b\xea\x70\x02\xb9\xe8\xa9\x64\xa5\x29\x20\xe1\x1e\xa9\xf2\x7e\x0c\xa3\xab\x6e\x25\xbf\xa8\x4c\xc9\x27\x7c\xed\xd1\xf2\xcb\x47\x87\xfb\x36\x13\x40\x63\xb4\x19\x3b\xe1\xdc\x34\xe9\x69\x91\x37\xe1\xfd\x7f\x8b\x06\x53\xef\xc5\x45\xe8\x96\x5c\x76\x85\x29\xda\xe8\x33\x34\x96\x11\x8f\x4c\x84\xd4\x1a\x48\x73\xa2\xe4\xbd\xbd\x29\x2c\x86\x88\x09\xc9\x73\x98\x57\x15\x94\xbd\x65\xdd\xc2\xaa\xb7\x8a\xd0\x5a\x68\x74\xad\x4a\x58\x6b\x03\x8a\x18\x4d\x67\x90\x15\xd5\x41\xf1\xae\xcf\xa2\x29\xea\xb9\xa9\xbd\x9f\xa4\x31\x48\xd5\x3e\xd8\xf0\xf1\xa3\x60\x76\x7a\x42\xd0\x73\xc4\xfd\xbf\xb0\x73\x75\x1d\xa9\x4a\xc5\x21\xf0\xae\x9c\xb6\x71\x06\x87\x85\xdf\xd4\x9c\x14\x13\xdd\x70\x6f\x08\x2e\x93\xa3\x09\x90\x6a\x44\xc0\xe2\xae\x0d\xb8\xf7\xe2\x33\x00\x00\xff\xff\xc8\xa7\x80\x44\x63\x03\x00\x00")
|
||||
var _nameServicePartial_templateClient_handlerMethods = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\xac\x92\xcf\x4e\xc3\x30\x0c\xc6\xcf\xf4\x29\x7c\x98\xd0\x86\xb6\xec\x3e\x89\xc3\x40\x0c\x71\x80\x03\xf0\x02\x59\xeb\x75\x96\xda\xa4\x24\x29\x0c\x45\x7d\x77\x9c\x34\x1d\x7f\x36\x01\x42\xdc\xd2\xf8\xf3\xe7\xcf\xbf\xc6\x7b\x78\x21\xb7\x85\x91\xc3\xba\xa9\xa4\xc3\xab\x1d\xe6\xad\xd3\x06\x16\xe7\x20\xba\x2e\xcb\xbc\x37\x52\x95\x08\x23\x0a\x57\x07\x3a\xf1\x80\xe6\x99\x72\x14\xb7\xe8\xb6\xba\xb0\xdc\x32\x9f\x83\xf7\x23\x12\x77\xb2\xc6\xae\x03\xe2\x06\xac\x51\x39\x0b\x83\x36\xdb\xb4\x2a\xff\x28\x1a\x7b\x1f\x63\x90\x2a\x70\x77\x64\xc8\x65\x45\x6c\xb0\x34\xa5\x8d\x73\xc2\x01\xf6\xcd\xde\x5f\xeb\x70\x02\xb1\x62\x5b\x47\x5a\x85\x7a\xb8\x47\x55\x74\xdd\x04\xc6\x67\xcd\x5a\xec\x55\xdc\x77\x8f\x4f\x2d\x5a\xf7\xf8\xda\x60\xf2\x98\x02\x1a\xa3\xcd\xc4\xf3\xbe\xb3\x84\xa4\xe6\x49\x61\xe7\x3f\x84\x82\x19\x73\x38\x09\x56\x09\x5e\x23\x8d\xac\x23\xc0\xe0\x2a\xa2\x36\x6a\xa2\x88\x36\xa0\xb4\x4b\x2a\x71\x63\x2f\xa4\xc5\x10\x2e\x49\x18\xe8\xb2\x28\x20\x6f\xad\xd3\x35\xac\x5b\x4b\x0a\xad\x85\x4a\x97\x94\xc3\x86\xff\x15\x29\x87\xa6\x31\xe8\x48\x95\x01\x6b\xef\xb3\xaa\x64\xc9\x83\x78\xb9\x34\x86\x71\xbc\x07\x1b\x3e\x3e\x15\x4c\x0f\x26\x04\xfd\x11\xd9\x3f\xa3\xfa\x2d\xa8\x03\x48\xa9\x38\x44\xed\xcb\xe9\xed\x2d\xe0\x6b\xe1\x3b\x28\x47\x91\x44\x2a\xae\x35\x0a\x4e\x13\x9d\x29\x28\xaa\xb2\x20\x8b\xef\x6b\x90\xf3\xe9\x2d\x00\x00\xff\xff\xf0\xfb\x3d\xfc\x4e\x03\x00\x00")
|
||||
|
||||
func nameServicePartial_templateClient_handlerMethodsBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -274,12 +274,12 @@ func nameServicePartial_templateClient_handlerMethods() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/partial_template/client_handler.methods", size: 867, mode: os.FileMode(436), modTime: time.Unix(1476730517, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/partial_template/client_handler.methods", size: 846, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServicePartial_templateServiceInterface = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x64\xcb\x31\x0a\xc2\x30\x14\x87\xf1\xd9\x9c\xe2\x0d\x1d\x5a\xa9\x39\x80\xe0\xe4\xd0\x49\x07\xf5\x02\x35\xfd\xab\x19\x4c\x62\xf2\x94\x96\xc7\xbb\xbb\x88\x82\x88\xd3\xb7\xfc\x3e\x9e\x12\x68\x8f\xfc\xf0\x0e\xe4\x03\x23\x9f\x7a\x07\x12\x23\x92\xfb\x70\x06\x55\x9e\x96\x2b\xb2\x1f\x62\x37\xe0\x4b\x1c\x8a\xaa\x99\x89\x54\xde\x76\xe0\x6d\x7f\x85\x6a\xed\x78\x24\x17\x03\x63\x64\xbb\x7e\xb7\x25\x1f\x68\x9e\x8e\x56\xa4\x8b\x2f\x46\x95\xb7\x3b\xdc\xee\x28\x7c\x98\x12\xbe\x77\x43\xf5\xbf\x2b\x29\x86\x82\x5f\xd8\x12\x72\x8e\xb9\x31\x22\x0b\x42\x18\x54\x8d\x9a\x67\x00\x00\x00\xff\xff\x49\xf1\x29\x36\xc5\x00\x00\x00")
|
||||
var _nameServicePartial_templateServiceInterface = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x64\x8e\x31\x0e\xc2\x30\x0c\x45\x67\x7a\x0a\x0f\x1d\x5a\x54\x72\x00\x24\x26\x06\x26\x18\x80\x0b\x94\xf6\x03\x19\x48\x8a\x63\x50\x91\x95\xbb\x63\x44\x07\x24\x26\x7b\x78\xff\xbf\x2f\xaf\x01\x74\x00\x3f\x7d\x07\xf2\x41\xc0\xe7\xd6\x3e\x2d\x54\xb9\x0d\x17\x50\xe9\x69\xb9\x22\x37\x21\x6e\x0b\xb9\xc6\x3e\xe5\x5c\xcc\x54\x4b\xef\x76\xed\x0d\x39\x57\x9d\x8c\xd4\x45\x8b\x8f\xe2\xd6\xdf\xdb\x58\x1d\xcd\x87\x93\x53\xdd\xc4\x0f\x66\x55\x6e\x8f\xfb\x03\x49\x8e\x66\x9d\xa2\x35\x55\xff\x50\x1a\x62\x48\xf8\xa1\x1a\x02\x73\xe4\xda\x66\x2d\x08\xa1\x37\x7f\x2e\xde\x01\x00\x00\xff\xff\xf9\x3a\x09\x61\xbc\x00\x00\x00")
|
||||
|
||||
func nameServicePartial_templateServiceInterfaceBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -294,12 +294,12 @@ func nameServicePartial_templateServiceInterface() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/partial_template/service.interface", size: 197, mode: os.FileMode(436), modTime: time.Unix(1476730517, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/partial_template/service.interface", size: 188, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
||||
var _nameServicePartial_templateServiceMethods = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x8c\x91\x41\x4f\xf3\x30\x0c\x86\xcf\xc9\xaf\xf0\xa1\xfa\xb4\x7d\xea\xb2\xfb\xa4\x9d\x10\xec\x04\x42\xc0\x1d\x95\xd4\x6c\x19\x6d\x52\x12\x17\x8a\xac\xfc\x77\xd4\xa6\xdd\x28\x70\xe0\x54\x4b\x7d\xfc\xc4\x7e\xcd\x0c\xef\x86\x0e\x90\x11\xd6\x4d\x55\x10\x5e\x76\xa8\x5b\x72\x1e\x36\x5b\x50\x31\xca\x13\x70\x5b\xe8\x97\x62\x8f\x37\x45\x8d\xfd\xbf\x1f\x0d\xea\x0b\x10\xa3\x94\xcc\xbe\xb0\x7b\x84\xcc\xfc\x8e\xdf\xa3\x7f\x33\x1a\xd5\x35\xd2\xc1\x95\x21\x46\xb9\x5e\x03\xb3\xda\x21\x25\x05\x98\xba\xa9\xb0\x46\x4b\x01\x26\x58\x3e\xb7\x56\xc3\x22\x00\x73\x36\x7b\x6f\x04\x96\x33\xc3\x42\x53\x07\xda\x59\xc2\x8e\xd4\x45\xfa\xe6\x60\x2c\xfc\x6f\x9e\x14\xf3\xce\x0d\xcb\xa8\x3b\x7c\x6d\x31\xd0\xc3\x47\x83\xe7\xde\x25\x2c\xbe\x53\xa1\x71\x36\xe0\x1c\xcb\x01\xbd\x77\x7e\xc9\x52\x3c\xc2\x16\x34\x75\xa9\x30\x56\x0a\x3f\x76\xf4\xfb\xff\x41\xc5\x52\x88\x53\x68\xc7\x21\x34\x33\x47\xaf\x0c\x56\x65\x80\x55\x8c\x52\x88\x21\xad\xd1\x98\x1d\x27\x0d\xc4\xb8\x81\x41\x84\xb6\x4c\x64\xec\x27\xa1\xd6\x5b\xf8\x37\x4d\x94\x83\x35\x95\xec\x8f\x8b\xb6\x4c\xc7\x5a\x41\x2a\xcf\xd5\x67\x00\x00\x00\xff\xff\x01\x01\x6d\x90\x1b\x02\x00\x00")
|
||||
var _nameServicePartial_templateServiceMethods = []byte("\x1f\x8b\x08\x00\x00\x09\x6e\x88\x00\xff\x84\x91\xcd\x4e\xeb\x30\x10\x85\xd7\xc9\x53\x9c\x45\x74\xd5\x5e\xa5\xee\xbe\x52\x57\x08\x58\x81\x10\xb0\x47\xc1\x19\x5a\x97\xc4\x0e\xf6\x04\x82\xac\xbc\x3b\x4e\x9c\xfe\x01\x12\xab\x8c\x94\xef\x3b\xb6\xcf\x78\x8f\x0f\xc5\x5b\x64\x4c\x75\x53\x15\x4c\x97\x1d\xc9\x96\x8d\xc5\x6a\x0d\xd1\xf7\xe9\x01\xb8\x2b\xe4\x6b\xb1\xa1\xdb\xa2\xa6\xe1\xdf\x0f\x41\x9c\x00\xc1\x0b\xa2\x2d\xf4\x86\x90\xa9\xdf\xf1\x07\xb2\xef\x4a\x92\xb8\x21\xde\x9a\xd2\x05\x65\xb9\x84\xf7\x22\xfa\x50\x01\xa7\x9a\x34\x3b\xec\xc9\xf4\xa5\xd5\x12\x33\x17\xa8\xec\xec\xb0\x09\x98\x1f\xf5\x99\xe4\x0e\xd2\x68\xa6\x8e\xc5\x45\xfc\xe6\x50\x1a\xff\x9b\x67\xe1\xfd\xb5\x19\x9f\x21\xee\xe9\xad\x25\xc7\x8f\x9f\x0d\x4d\xe2\x1c\xb3\xef\x88\x6b\x8c\x76\x74\xc2\xe4\x20\x6b\x8d\x9d\xfb\x34\x79\xc2\x1a\xe1\xa8\x38\x28\x9d\x26\x76\xc2\x87\x37\xff\x95\x13\xfc\xe4\xd0\xd2\x6e\x6c\x49\x9d\x73\x57\x8a\xaa\xd2\x61\x11\xca\x49\x92\xb1\x9e\x29\x2e\xdb\x8d\x19\xe8\xfb\x15\xc6\x14\xd2\x65\xc4\xfa\xe1\x0e\xdc\x5a\x8d\x7f\xfb\xbb\xe4\xd0\xaa\x4a\x87\x55\x06\x2a\xae\x66\x81\x38\x1e\xa7\xaf\x00\x00\x00\xff\xff\x83\x97\xcb\x10\x09\x02\x00\x00")
|
||||
|
||||
func nameServicePartial_templateServiceMethodsBytes() ([]byte, error) {
|
||||
return bindataRead(
|
||||
|
@ -314,7 +314,7 @@ func nameServicePartial_templateServiceMethods() (*asset, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
info := bindataFileInfo{name: "NAME-service/partial_template/service.methods", size: 539, mode: os.FileMode(436), modTime: time.Unix(1476730517, 0)}
|
||||
info := bindataFileInfo{name: "NAME-service/partial_template/service.methods", size: 521, mode: os.FileMode(436), modTime: time.Unix(1477958362, 0)}
|
||||
a := &asset{bytes: bytes, info: info}
|
||||
return a, nil
|
||||
}
|
||||
|
|
|
@ -7,10 +7,22 @@ import (
|
|||
"strings"
|
||||
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/TuneLab/go-truss/deftree/svcparse"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
gogen "github.com/golang/protobuf/protoc-gen-go/generator"
|
||||
|
||||
"github.com/TuneLab/go-truss/deftree/svcparse"
|
||||
)
|
||||
|
||||
type optional interface {
|
||||
Optional() bool
|
||||
}
|
||||
|
||||
func isOptionalError(err error) bool {
|
||||
opt, ok := errors.Cause(err).(optional)
|
||||
return ok && opt.Optional()
|
||||
}
|
||||
|
||||
// consolidateHTTP accepts a SvcDef and the io.Readers for the proto files
|
||||
// comprising the definition. It modifies the SvcDef so that HTTPBindings and
|
||||
// their associated HTTPParamters are added to each ServiceMethod. After this,
|
||||
|
@ -22,13 +34,13 @@ func consolidateHTTP(sd *Svcdef, protoFiles []io.Reader) error {
|
|||
lex := svcparse.NewSvcLexer(pfile)
|
||||
protosvc, err := svcparse.ParseService(lex)
|
||||
if err != nil {
|
||||
if strings.Contains("'options' or", err.Error()) {
|
||||
if isOptionalError(err) {
|
||||
log.Warnf("Parser found rpc method which lacks HTTP " +
|
||||
"annotations; this is allowed, but will result in HTTP " +
|
||||
"transport not being generated.")
|
||||
} else {
|
||||
return errors.Wrap(err, "error while parsing http options for the service definition")
|
||||
return nil
|
||||
}
|
||||
return errors.Wrap(err, "error while parsing http options for the service definition")
|
||||
}
|
||||
assembleHTTPParams(sd.Service, protosvc)
|
||||
}
|
||||
|
@ -55,12 +67,13 @@ func assembleHTTPParams(svc *Service, httpsvc *svcparse.Service) error {
|
|||
bind := HTTPBinding{}
|
||||
bind.Verb, bind.Path = getVerb(parsedbind)
|
||||
|
||||
params := make([]*HTTPParameter, 0)
|
||||
//params := make([]*HTTPParameter, 0)
|
||||
var params []*HTTPParameter
|
||||
for _, field := range msg.Fields {
|
||||
new_param := &HTTPParameter{}
|
||||
new_param.Field = field
|
||||
new_param.Location = paramLocation(field, parsedbind)
|
||||
params = append(params, new_param)
|
||||
newParam := &HTTPParameter{}
|
||||
newParam.Field = field
|
||||
newParam.Location = paramLocation(field, parsedbind)
|
||||
params = append(params, newParam)
|
||||
}
|
||||
bind.Params = params
|
||||
meth.Bindings = append(meth.Bindings, &bind)
|
||||
|
@ -71,7 +84,7 @@ func assembleHTTPParams(svc *Service, httpsvc *svcparse.Service) error {
|
|||
for _, hm := range httpsvc.Methods {
|
||||
m := getMethNamed(hm.Name)
|
||||
if m == nil {
|
||||
return errors.New(fmt.Sprintf("Could not find service method named %q", hm.Name))
|
||||
return fmt.Errorf("Could not find service method named %q", hm.Name)
|
||||
}
|
||||
for _, hbind := range hm.HTTPBindings {
|
||||
createParams(m, hbind)
|
||||
|
@ -96,9 +109,11 @@ func getVerb(binding *svcparse.HTTPBinding) (verb string, path string) {
|
|||
// paramLocation returns the location that a field would be found according to
|
||||
// the rules of a given HTTPBinding.
|
||||
func paramLocation(field *Field, binding *svcparse.HTTPBinding) string {
|
||||
path_params := getPathParams(binding)
|
||||
for _, path_param := range path_params {
|
||||
if strings.Split(path_param, ".")[0] == field.Name {
|
||||
pathParams := getPathParams(binding)
|
||||
for _, param := range pathParams {
|
||||
// Have to CamelCase the data from the parser since it may be lowercase
|
||||
// while the name from the Go file will be CamelCased
|
||||
if gogen.CamelCase(strings.Split(param, ".")[0]) == field.Name {
|
||||
return "path"
|
||||
}
|
||||
}
|
||||
|
@ -118,12 +133,12 @@ func paramLocation(field *Field, binding *svcparse.HTTPBinding) string {
|
|||
// Returns a slice of strings containing all parameters in the path
|
||||
func getPathParams(binding *svcparse.HTTPBinding) []string {
|
||||
_, path := getVerb(binding)
|
||||
find_params := regexp.MustCompile("{(.*?)}")
|
||||
remove_braces := regexp.MustCompile("{|}")
|
||||
params := find_params.FindAllString(path, -1)
|
||||
findParams := regexp.MustCompile("{(.*?)}")
|
||||
removeBraces := regexp.MustCompile("{|}")
|
||||
params := findParams.FindAllString(path, -1)
|
||||
rv := []string{}
|
||||
for _, p := range params {
|
||||
rv = append(rv, remove_braces.ReplaceAllString(p, ""))
|
||||
rv = append(rv, removeBraces.ReplaceAllString(p, ""))
|
||||
}
|
||||
return rv
|
||||
}
|
||||
|
|
|
@ -0,0 +1,59 @@
|
|||
package svcdef
|
||||
|
||||
import (
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/TuneLab/go-truss/truss/execprotoc"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// NewFromString creates a Svcdef from a string of a valid protobuf file. Very
|
||||
// useful in tests.
|
||||
func NewFromString(def string) (*Svcdef, error) {
|
||||
const defFileName = "definition.proto"
|
||||
const goFileName = "definition.pb.go"
|
||||
|
||||
// Write our proto file to a directory
|
||||
protoDir, err := ioutil.TempDir("./", "trusssvcdef")
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not create temp directory to store proto definition")
|
||||
}
|
||||
defer os.RemoveAll(protoDir)
|
||||
|
||||
defPath := filepath.Join(protoDir, defFileName)
|
||||
|
||||
err = ioutil.WriteFile(defPath, []byte(def), 0666)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not write proto definition to file")
|
||||
}
|
||||
|
||||
cur, err := filepath.Abs("./")
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get absolute path for ./")
|
||||
}
|
||||
importDir := filepath.Join(cur, protoDir)
|
||||
|
||||
// Create our pb.go file
|
||||
err = execprotoc.GeneratePBDotGo([]string{defPath}, importDir, protoDir)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "unable to create a pb.go file")
|
||||
}
|
||||
gPath := filepath.Join(protoDir, goFileName)
|
||||
|
||||
buf, err := ioutil.ReadFile(gPath)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "unable to read pb.go file %q", gPath)
|
||||
}
|
||||
pbgo := string(buf)
|
||||
|
||||
sd, err := New([]io.Reader{strings.NewReader(pbgo)}, []io.Reader{strings.NewReader(def)})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not create new svcdef from pb.go and definition")
|
||||
}
|
||||
|
||||
return sd, nil
|
||||
}
|
|
@ -0,0 +1,173 @@
|
|||
package svcdef
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/TuneLab/go-truss/gengokit/gentesthelper"
|
||||
"github.com/davecgh/go-spew/spew"
|
||||
)
|
||||
|
||||
func basicFromString(t *testing.T) *Svcdef {
|
||||
defStr := `
|
||||
syntax = "proto3";
|
||||
|
||||
// General package
|
||||
package general;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
message SumRequest {
|
||||
int64 a = 1;
|
||||
int64 b = 2;
|
||||
}
|
||||
|
||||
message SumReply {
|
||||
int64 v = 1;
|
||||
string err = 2;
|
||||
}
|
||||
|
||||
service SumSvc {
|
||||
rpc Sum(SumRequest) returns (SumReply) {
|
||||
option (google.api.http) = {
|
||||
get: "/sum/{a}"
|
||||
};
|
||||
}
|
||||
}
|
||||
`
|
||||
sd, err := NewFromString(defStr)
|
||||
|
||||
if err != nil {
|
||||
t.Fatal("Failed to create a svcdef from the definition string:", err)
|
||||
}
|
||||
return sd
|
||||
}
|
||||
|
||||
func TestMessages(t *testing.T) {
|
||||
sd := basicFromString(t)
|
||||
expected := []*Message{
|
||||
&Message{
|
||||
Name: "SumRequest",
|
||||
Fields: []*Field{
|
||||
&Field{
|
||||
Name: "A",
|
||||
Type: &FieldType{
|
||||
Name: "int64",
|
||||
Enum: nil,
|
||||
Message: nil,
|
||||
Map: nil,
|
||||
StarExpr: false,
|
||||
ArrayType: false,
|
||||
},
|
||||
},
|
||||
&Field{
|
||||
Name: "B",
|
||||
Type: &FieldType{
|
||||
Name: "int64",
|
||||
Enum: nil,
|
||||
Message: nil,
|
||||
Map: nil,
|
||||
StarExpr: false,
|
||||
ArrayType: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
&Message{
|
||||
Name: "SumReply",
|
||||
Fields: []*Field{
|
||||
&Field{
|
||||
Name: "V",
|
||||
Type: &FieldType{
|
||||
Name: "int64",
|
||||
Enum: nil,
|
||||
Message: nil,
|
||||
Map: nil,
|
||||
StarExpr: false,
|
||||
ArrayType: false,
|
||||
},
|
||||
},
|
||||
&Field{
|
||||
Name: "Err",
|
||||
Type: &FieldType{
|
||||
Name: "string",
|
||||
Enum: nil,
|
||||
Message: nil,
|
||||
Map: nil,
|
||||
StarExpr: false,
|
||||
ArrayType: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
if got, want := sd.Messages, expected; !reflect.DeepEqual(got, want) {
|
||||
diff := gentesthelper.DiffStrings(spew.Sdump(got), spew.Sdump(want))
|
||||
t.Errorf("got != want; methods differ: %v\n", diff)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHTTPBinding(t *testing.T) {
|
||||
sd := basicFromString(t)
|
||||
expected := []*HTTPBinding{
|
||||
&HTTPBinding{
|
||||
Verb: "get",
|
||||
Path: "/sum/{a}",
|
||||
Params: []*HTTPParameter{
|
||||
&HTTPParameter{
|
||||
Location: "path",
|
||||
Field: &Field{
|
||||
Name: "A",
|
||||
Type: &FieldType{
|
||||
Name: "int64",
|
||||
},
|
||||
},
|
||||
},
|
||||
&HTTPParameter{
|
||||
Location: "query",
|
||||
Field: &Field{
|
||||
Name: "B",
|
||||
Type: &FieldType{
|
||||
Name: "int64",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
output := sd.Service.Methods[0].Bindings
|
||||
if got, want := output, expected; !reflect.DeepEqual(got, want) {
|
||||
diff := gentesthelper.DiffStrings(spew.Sdump(got), spew.Sdump(want))
|
||||
t.Errorf("got != want; methods differ: %v\n", diff)
|
||||
}
|
||||
}
|
||||
|
||||
func TestNoHTTPBinding(t *testing.T) {
|
||||
defstr := `
|
||||
syntax = "proto3";
|
||||
|
||||
// General package
|
||||
package general;
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
message SumRequest {
|
||||
int64 a = 1;
|
||||
int64 b = 2;
|
||||
}
|
||||
|
||||
message SumReply {
|
||||
int64 v = 1;
|
||||
string err = 2;
|
||||
}
|
||||
|
||||
service SumSvc {
|
||||
rpc Sum(SumRequest) returns (SumReply) {}
|
||||
}
|
||||
`
|
||||
_, err := NewFromString(defstr)
|
||||
if err != nil {
|
||||
t.Fatal("Failed to create svcdef from string:", err)
|
||||
}
|
||||
}
|
|
@ -22,6 +22,8 @@ import (
|
|||
"go/token"
|
||||
"io"
|
||||
"strings"
|
||||
"unicode"
|
||||
"unicode/utf8"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
@ -144,8 +146,12 @@ func New(goFiles []io.Reader, protoFiles []io.Reader) (*Svcdef, error) {
|
|||
if err != nil {
|
||||
return nil, errors.Wrap(err, "couldn't parse go file to create Svcdef")
|
||||
}
|
||||
rv.PkgName = fileAst.Name.Name
|
||||
|
||||
typespecs, _ := retrieveTypeSpecs(fileAst)
|
||||
typespecs, err := retrieveTypeSpecs(fileAst)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not retrive type specs")
|
||||
}
|
||||
for _, t := range typespecs {
|
||||
switch typdf := t.Type.(type) {
|
||||
case *ast.Ident:
|
||||
|
@ -157,6 +163,10 @@ func New(goFiles []io.Reader, protoFiles []io.Reader) (*Svcdef, error) {
|
|||
rv.Enums = append(rv.Enums, nenm)
|
||||
}
|
||||
case *ast.StructType:
|
||||
// Non-exported structs do not represent types
|
||||
if !isExported(t.Name.Name) {
|
||||
break
|
||||
}
|
||||
nmsg, err := NewMessage(t)
|
||||
if err != nil {
|
||||
return nil, errors.Wrapf(err, "error parsing message %q", t.Name.Name)
|
||||
|
@ -252,10 +262,10 @@ func NewMap(m ast.Expr) (*Map, error) {
|
|||
}
|
||||
|
||||
// NewService returns a new Service struct derived from an *ast.TypeSpec with a
|
||||
// Type of *ast.InterfaceType representing an "{SVCNAME}Client" interface.
|
||||
// Type of *ast.InterfaceType representing an "{SVCNAME}Server" interface.
|
||||
func NewService(s *ast.TypeSpec) (*Service, error) {
|
||||
rv := &Service{
|
||||
Name: s.Name.Name,
|
||||
Name: strings.TrimSuffix(s.Name.Name, "Server"),
|
||||
}
|
||||
asvc := s.Type.(*ast.InterfaceType)
|
||||
for _, m := range asvc.Methods.List {
|
||||
|
@ -373,3 +383,13 @@ func NewField(f *ast.Field) (*Field, error) {
|
|||
}
|
||||
return rv, nil
|
||||
}
|
||||
|
||||
// isExported returns true if the provided name of a declaration begins with a
|
||||
// capital letter.
|
||||
func isExported(name string) bool {
|
||||
r, _ := utf8.DecodeRuneInString(name)
|
||||
if unicode.IsUpper(r) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import (
|
|||
"github.com/TuneLab/go-truss/deftree"
|
||||
"github.com/TuneLab/go-truss/gendoc"
|
||||
"github.com/TuneLab/go-truss/gengokit"
|
||||
ggkconf "github.com/TuneLab/go-truss/gengokit/config"
|
||||
"github.com/TuneLab/go-truss/svcdef"
|
||||
)
|
||||
|
||||
|
@ -44,11 +45,10 @@ func main() {
|
|||
cfg, err := parseInput()
|
||||
exitIfError(errors.Wrap(err, "cannot parse input"))
|
||||
|
||||
//dt, sd, err := parseServiceDefinition(cfg)
|
||||
dt, _, err := parseServiceDefinition(cfg)
|
||||
dt, sd, err := parseServiceDefinition(cfg)
|
||||
exitIfError(errors.Wrap(err, "cannot parse input definition proto files"))
|
||||
|
||||
genFiles, err := generateCode(cfg, dt)
|
||||
genFiles, err := generateCode(cfg, dt, sd)
|
||||
exitIfError(errors.Wrap(err, "cannot generate service"))
|
||||
|
||||
for _, f := range genFiles {
|
||||
|
@ -190,9 +190,14 @@ func parseServiceDefinition(cfg *truss.Config) (deftree.Deftree, *svcdef.Svcdef,
|
|||
|
||||
// generateCode returns a []truss.NamedReadWriter that represents a gokit
|
||||
// service with documentation
|
||||
func generateCode(cfg *truss.Config, dt deftree.Deftree) ([]truss.NamedReadWriter, error) {
|
||||
func generateCode(cfg *truss.Config, dt deftree.Deftree, sd *svcdef.Svcdef) ([]truss.NamedReadWriter, error) {
|
||||
conf := ggkconf.Config{
|
||||
PBPackage: cfg.PBPackage,
|
||||
GoPackage: cfg.ServicePackage,
|
||||
PreviousFiles: cfg.PrevGen,
|
||||
}
|
||||
|
||||
genGokitFiles, err := gengokit.GenerateGokit(dt, cfg.ServicePackage, cfg.PBPackage, cfg.PrevGen)
|
||||
genGokitFiles, err := gengokit.GenerateGokit(sd, conf)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "cannot generate gokit service")
|
||||
}
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
Загрузка…
Ссылка в новой задаче