Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func All ¶
func All(_ context.Context, _ ...protoreflect.FieldDescriptor) (bool, error)
Types ¶
type Field ¶
type Field interface { // Value returns the value of the field Value() protoreflect.Value // Keys returns an iterator over the keys of the messages that have this value for this field Keys(ctx context.Context) (Iterator[string], error) // Descriptors returns the field descriptors for this field Descriptors() []protoreflect.FieldDescriptor }
Field is an indexed field in the index
type FieldReader ¶
type FieldReader interface { // Get returns the field for the given field descriptor Get(ctx context.Context, f protoreflect.Name) (Iterator[Field], bool, error) }
FieldReader is an interface for reading a type fields from the index
type Func ¶
type Func func(ctx context.Context, fds ...protoreflect.FieldDescriptor) (bool, error)
Func is a function that is called to determine if a field should be indexed It takes a context and a list of field descriptors that represent the path to the field It returns a bool indicating if the field should be indexed or not and an error if any
type Index ¶
type Index interface { // Insert inserts and indexes the given message with the given key Insert(ctx context.Context, k string, m proto.Message) error // Update updates the index for the given message with the given key Update(ctx context.Context, k string, m proto.Message) error // Remove removes the given key from the index Remove(ctx context.Context, k string) error // Find returns the keys of the messages that match the given FieldFilterer Find(ctx context.Context, t protoreflect.FullName, f filters.FieldFilterer) ([]string, error) }
Index is a protobuf message index
type Iterator ¶
Iterator is an interface for iterating over a collection of values It is used by the Index to iterate over the values of a field that can be stored in a remote database
type Store ¶
type Store interface { // For returns a FieldReader for the given message type. For(ctx context.Context, t protoreflect.FullName) (FieldReader, error) // Add adds a value to the store for the given key and field descriptor. Add(ctx context.Context, k string, v protoreflect.Value, fds ...protoreflect.FieldDescriptor) error // Remove removes a value from the store for the given key and field descriptor. Remove(ctx context.Context, k string, f protoreflect.FieldDescriptor, v protoreflect.Value) error // Clear removes all values from the store for the given key. Clear(ctx context.Context, k string) error }
Store is an interface for storing and retrieving protobuf message fields.
type Tx ¶
type Tx interface { Store // Commit commits the transaction. Commit(ctx context.Context) error // Close closes the transaction. // If the transaction has not been committed, it will be rolled back. // If the transaction has been committed, it should be a no-op. Close() error }
Tx is an interface for a transaction.