Sha256: 0cf19e00fb92acfb3ce8dcde57f3fb09520c4a2c4b657a8213d8ea674b8369e1

Contents?: true

Size: 363 Bytes

Versions: 4

Compression:

Stored size: 363 Bytes

Contents

<%-
import 'context'
import 'datastore'
import 'log'
import 'goon'
-%>

func (s *<%= type.name %>) CountBy(ctx context.Context, q *datastore.Query) (int, error) {
	g := goon.FromContext(ctx)
	c, err := g.Count(q)
	if err != nil {
		log.Errorf(ctx, "Failed to count <%= model.qualified_name %> with %v because of %v\n", q, err)
		return 0, err
	}
	return c, nil
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
goon_model_gen-0.4.3 lib/goon_model_gen/templates/store/goon/11_CountBy.go.erb
goon_model_gen-0.4.2 lib/goon_model_gen/templates/store/goon/11_CountBy.go.erb
goon_model_gen-0.4.1 lib/goon_model_gen/templates/store/goon/11_CountBy.go.erb
goon_model_gen-0.4.0 lib/goon_model_gen/templates/store/goon/11_CountBy.go.erb