genKindStringReprString.go 369 Bytes
Newer Older
Eric Myhre's avatar
Eric Myhre committed
1
package gengo
Eric Myhre's avatar
Eric Myhre committed
2 3 4 5 6 7

import (
	"io"
)

func (gk generateKindString) EmitNodeType(w io.Writer) {
Eric Myhre's avatar
Eric Myhre committed
8
	doTemplate(`
Eric Myhre's avatar
Eric Myhre committed
9 10 11
		var _ ipld.Node = {{ .Name }}{}

		type {{ .Name }} struct { x string }
Eric Myhre's avatar
Eric Myhre committed
12
	`, w, gk)
Eric Myhre's avatar
Eric Myhre committed
13 14 15
}

func (gk generateKindString) EmitNodeMethodReprKind(w io.Writer) {
Eric Myhre's avatar
Eric Myhre committed
16
	doTemplate(`
Eric Myhre's avatar
Eric Myhre committed
17 18 19
		func ({{ .Name }}) ReprKind() ipld.ReprKind {
			return ipld.ReprKind_String
		}
Eric Myhre's avatar
Eric Myhre committed
20
	`, w, gk)
Eric Myhre's avatar
Eric Myhre committed
21
}