Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseWSOptionIndex ¶ added in v0.3.0
func ParseWSOptionIndex(md protoreflect.MessageDescriptor) ([]*Index, []*Index)
parse worksheet option index
Types ¶
type Index ¶
type IndexDescriptor ¶
type IndexDescriptor struct {
LevelMessage *LevelMessage // message hierarchy to the deepest level message which contains all index fields.
}
func ParseIndexDescriptor ¶
func ParseIndexDescriptor(md protoreflect.MessageDescriptor) *IndexDescriptor
type LevelField ¶
type LevelField struct {
FD protoreflect.FieldDescriptor // index field descriptor
// leveled fd list
// For example, if you have a message described as below and created an index on "PathUserID"
// fds are ["path", "user", "id"]
//
// message ItemConf {
// option (tableau.worksheet) = {
// name: "ItemConf"
// index: "PathUserID"
// };
// map<uint32, Item> item_map = 1 [(tableau.field) = { key: "ID" layout: LAYOUT_VERTICAL }];
// message Item {
// uint32 id = 1 [(tableau.field) = { name: "ID" }];
// Path path = 2 [(tableau.field) = { name: "Path" }];
// message Path {
// string dir = 1 [(tableau.field) = { name: "Dir" }];
// User user = 2 [(tableau.field) = { name: "User" }];
// message User {
// uint32 id = 1 [(tableau.field) = { name: "ID" }];
// }
// }
// }
// }
LeveledFDList []protoreflect.FieldDescriptor
}
type LevelIndex ¶ added in v0.3.0
type LevelIndex struct {
*Index
MD protoreflect.MessageDescriptor
ColFields []*LevelField
SortedColFields []*LevelField
NameConflict *Index
}
func (*LevelIndex) Name ¶ added in v0.3.0
func (l *LevelIndex) Name() string
type LevelMessage ¶
type LevelMessage struct {
NextLevel *LevelMessage
// Current level message's field which contains index fields.
// Only valid when NextLevel is not nil.
FD protoreflect.FieldDescriptor
// Current level message's all index fields
Indexes, OrderedIndexes []*LevelIndex
// depth of message hierarchy
Depth, MapDepth int
}
namespaced level info
func (*LevelMessage) NeedGenIndex ¶ added in v0.5.0
func (l *LevelMessage) NeedGenIndex() bool
func (*LevelMessage) NeedGenOrderedIndex ¶ added in v0.5.0
func (l *LevelMessage) NeedGenOrderedIndex() bool
Click to show internal directories.
Click to hide internal directories.