You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
695 B
Go

8 years ago
package ent
8 years ago
import (
"fmt"
"github.com/jordanorelli/hyperstone/bit"
)
8 years ago
type class struct {
8 years ago
name string
version int
fields []field
}
func (c class) String() string {
return fmt.Sprintf("<%s.%d>", c.name, c.version)
8 years ago
}
func (c *class) read(r bit.Reader) (value, error) {
return nil, fmt.Errorf("fart")
8 years ago
}
type classHistory map[int]*class
8 years ago
func classType(spec *typeSpec, env *Env) tÿpe {
if spec.serializer != "" {
h := env.classes[spec.serializer]
if h != nil {
class := h[spec.serializerV]
if class != nil {
return class
}
return typeError("class %s exists for spec serializer but can't find version %d", spec.serializer, spec.serializerV)
}
}
return nil
}