Sha256: d87be0957037aedf1ad52cbaa89bba8376e74c290d03e9d9861fae08f216a5bf

Contents?: true

Size: 598 Bytes

Versions: 6

Compression:

Stored size: 598 Bytes

Contents

package model

import (
	"golang.org/x/net/context"

	"github.com/mjibson/goon"
)

// // Use the following code if you want to change kind name from model struct name.
// var ModelNameToKindMap = map[string]string{
// 	"Person": "People",
// 	"Book":   "Books",
// }

func GoonFromContext(c context.Context) *goon.Goon {
	r := goon.FromContext(c)
	// baseResolver := r.KindNameResolver
	// r.KindNameResolver = func(src interface{}) string {
	// 	base := baseResolver(src)
	// 	mapped := ModelNameToKindMap[base]
	// 	if mapped != "" {
	// 		return mapped
	// 	}
	// 	return base
	// }
	return r
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
goa_model_gen-0.4.2 lib/goa_model_gen/templates/goon.go.erb
goa_model_gen-0.4.1 lib/goa_model_gen/templates/goon.go.erb
goa_model_gen-0.4.0 lib/goa_model_gen/templates/goon.go.erb
goa_model_gen-0.3.0 lib/goa_model_gen/templates/goon.go.erb
goa_model_gen-0.2.1 lib/goa_model_gen/templates/goon.go.erb
goa_model_gen-0.2.0 lib/goa_model_gen/templates/goon.go.erb