func getStructCodec(t reflect.Type) (*structCodec, error) {
	structCodecsMutex.Lock()
	defer structCodecsMutex.Unlock()
	return getStructCodecLocked(t)
}
getStructCodec returns the structCodec for the given struct type.
package datastore
import (
	"fmt"
	"reflect"
	"strings"
	"sync"
	"unicode"
)
const maxIndexedProperties = 20000
const maxBlobLen = 1 << 20
type Property struct {
	Name string
	Value interface{}
	NoIndex bool
	Multiple bool
}
type ByteString []byte
type PropertyLoadSaver interface {
	Load([]Property) error
	Save() ([]Property, error)
}
type PropertyList []Property
var (
	typeOfPropertyLoadSaver = reflect.TypeOf((*PropertyLoadSaver)(nil)).Elem()
	typeOfPropertyList      = reflect.TypeOf(PropertyList(nil))
)
func (l *PropertyList) Load(p []Property) error {
	*l = append(*l, p...)
	return nil
}
func (l *PropertyList) Save() ([]Property, error) {
	return *l, nil
}
func validPropertyName(name string) bool {
	if name == "" {
		return false
	}
	for _, s := range strings.Split(name, ".") {
		if s == "" {
			return false
		}
		first := true
		for _, c := range s {
			if first {
				first = false
				if c != '_' && !unicode.IsLetter(c) {
					return false
				}
			} else {
				if c != '_' && !unicode.IsLetter(c) && !unicode.IsDigit(c) {
					return false
				}
			}
		}
	}
	return true
}
type structTag struct {
	name    string
	noIndex bool
}
type structCodec struct {
	byIndex []structTag
	byName map[string]fieldCodec
	hasSlice bool
	complete bool
}
type fieldCodec struct {
	index          int
	substructCodec *structCodec
}
var (
	structCodecsMutex sync.Mutex
	structCodecs      = make(map[reflect.Type]*structCodec)
)