func()

in sub_store.go [51:73]


func (s *SubStore) IsValid() bool {
	if s.SortedKeyCount <= 0 || s.SortedKeyCount >= len(s.Keys) {
		return false
	}
	if s.TimeIndex >= len(s.Keys) || s.TimeIndex < s.SortedKeyCount {
		return false
	}
	if s.TTL <= 0 || s.TTL > 3650 {
		return false
	}
	for index, key := range s.Keys {
		if !key.IsValid() {
			return false
		}
		if index == s.TimeIndex && key.Type != "long" {
			return false
		}
		if index < s.SortedKeyCount && key.Type == "double" {
			return false
		}
	}
	return true
}