mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-30 10:45:18 -06:00
30 lines
690 B
Cheetah
30 lines
690 B
Cheetah
// {{.StructName}}
|
|
|
|
type {{.StructName}} struct {
|
|
m types.Map
|
|
}
|
|
|
|
func New{{.StructName}}() {{.StructName}} {
|
|
return {{.StructName}}{
|
|
types.NewMap(types.NewString("$name"), types.NewString("{{.StructName}}")),
|
|
}
|
|
}
|
|
|
|
func {{.StructName}}FromVal(v types.Value) {{.StructName}} {
|
|
return {{.StructName}}{v.(types.Map)}
|
|
}
|
|
|
|
// TODO: This was going to be called Value() but it collides with root.value. We need some other place to put the built-in fields like Value() and Equals().
|
|
func (s {{.StructName}}) NomsValue() types.Map {
|
|
return s.m
|
|
}
|
|
|
|
func (s {{.StructName}}) Equals(p {{.StructName}}) bool {
|
|
return s.m.Equals(p.m)
|
|
}
|
|
|
|
func (s {{.StructName}}) Ref() ref.Ref {
|
|
return s.m.Ref()
|
|
}
|
|
|