Documentation ¶
Index ¶
- func WalkPathNodes(rootMessage protoreflect.MessageDescriptor, callback func(Path) error) error
- type JSONPathSpec
- type NestedField
- type Path
- func (pp Path) Child(name protoreflect.Name) (*Path, error)
- func (pp Path) DebugName() string
- func (pp *Path) GetValue(msg protoreflect.Message) (protoreflect.Value, error)
- func (pp Path) IDPath() string
- func (pp *Path) JSONBArrowPath() string
- func (pp *Path) JSONPathQuery() string
- func (pp Path) Leaf() protoreflect.Descriptor
- func (pp Path) LeafField() protoreflect.FieldDescriptor
- func (pp Path) LeafOneof() protoreflect.OneofDescriptor
- func (pp Path) Root() protoreflect.MessageDescriptor
- type ProtoFieldSpec
- type ProtoPathSpec
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WalkPathNodes ¶
func WalkPathNodes(rootMessage protoreflect.MessageDescriptor, callback func(Path) error) error
WalkPathNodes visits every field in the message tree other than the root message itself, calling the callback for each.
Types ¶
type JSONPathSpec ¶
type JSONPathSpec []string
Like ProtoPathSpec but uses JSON field names
func ParseJSONPathSpec ¶
func ParseJSONPathSpec(path string) JSONPathSpec
func (JSONPathSpec) String ¶
func (jp JSONPathSpec) String() string
type NestedField ¶
type NestedField struct { // The column containing the element JSONB RootColumn string // The path from the column root to the node Path Path }
func (*NestedField) ProtoChild ¶
func (nf *NestedField) ProtoChild(name protoreflect.Name) (*NestedField, error)
func (*NestedField) Selector ¶
func (nf *NestedField) Selector(inTable string) string
type Path ¶
type Path struct {
// contains filtered or unexported fields
}
func NewJSONPath ¶
func NewJSONPath(message protoreflect.MessageDescriptor, fieldPath JSONPathSpec) (*Path, error)
func NewProtoPath ¶
func NewProtoPath(message protoreflect.MessageDescriptor, fieldPath ProtoPathSpec) (*Path, error)
func (*Path) GetValue ¶
func (pp *Path) GetValue(msg protoreflect.Message) (protoreflect.Value, error)
func (*Path) JSONBArrowPath ¶
func (*Path) JSONPathQuery ¶
func (Path) Leaf ¶
func (pp Path) Leaf() protoreflect.Descriptor
func (Path) LeafField ¶
func (pp Path) LeafField() protoreflect.FieldDescriptor
func (Path) LeafOneof ¶
func (pp Path) LeafOneof() protoreflect.OneofDescriptor
func (Path) Root ¶
func (pp Path) Root() protoreflect.MessageDescriptor
type ProtoFieldSpec ¶
type ProtoFieldSpec struct { // The column holding the data, either directly or JSONB from here using the // path ColumnName string // The path from the column root to the node being specified (not the path // of the node from a 'root node' of the table) Path ProtoPathSpec // The path from the nominal table root message to the node being specified PathFromRoot ProtoPathSpec }
type ProtoPathSpec ¶
type ProtoPathSpec []string
An element in a path from a root message to a leaf node Messages use field name strings Repeated uses index numbes as strings (1 = "1") Maps use the map keys, which are always strings in J5 land. OneOf is not included as it doesn't appear in the proto tree
func ParseProtoPathSpec ¶
func ParseProtoPathSpec(path string) ProtoPathSpec
func (ProtoPathSpec) String ¶
func (pp ProtoPathSpec) String() string
Click to show internal directories.
Click to hide internal directories.