Documentation
¶
Overview ¶
Package tenancy holds the tenant checks every Weave metadata store runs before it touches data.
Index ¶
- func ChunkCount(ctx context.Context, f *chunk.CountFilter) (string, error)
- func ChunkList(ctx context.Context, f *chunk.ListFilter) (string, error)
- func CollectionCount(ctx context.Context, f *collection.CountFilter) (string, error)
- func CollectionList(ctx context.Context, f *collection.ListFilter) (string, error)
- func DocumentCount(ctx context.Context, f *document.CountFilter) (string, error)
- func DocumentList(ctx context.Context, f *document.ListFilter) (string, error)
- func Owner(ctx context.Context, what, owner string) (string, error)
- func Scope(ctx context.Context, filter *string) (string, error)
- func SourceReplace(ctx context.Context, doc *document.Document, chunks []*chunk.Chunk) (string, error)
- func VectorDeleteFilter(filter map[string]string) error
- func VectorEntries(entries []vectorstore.Entry) error
- func VectorSearch(opts *vectorstore.SearchOptions) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunkCount ¶
ChunkCount scopes a chunk count filter.
func CollectionCount ¶
func CollectionCount(ctx context.Context, f *collection.CountFilter) (string, error)
CollectionCount scopes a collection count filter.
func CollectionList ¶
func CollectionList(ctx context.Context, f *collection.ListFilter) (string, error)
CollectionList scopes a collection list filter.
func DocumentCount ¶
DocumentCount scopes a document count filter.
func DocumentList ¶
DocumentList scopes a document list filter.
func Owner ¶
Owner returns the context tenant when owner, the tenant on an entity being created, equals it. Any other owner, "" included, is ErrInvalidArgument naming what (collection, document or chunk).
func Scope ¶
Scope returns the context tenant. A non-nil filter must equal it; anything else, "" included, is ErrInvalidArgument.
func SourceReplace ¶
func SourceReplace(ctx context.Context, doc *document.Document, chunks []*chunk.Chunk) (string, error)
SourceReplace runs the checks ReplaceSourceDocument makes before it reads anything and returns the context tenant. A doc labelled with another tenant is ErrDocumentNotFound, as the stored row would be. A doc without a SourceKey, and a chunk that doesn't belong to doc, its collection and the context tenant, are ErrInvalidArgument.
func VectorDeleteFilter ¶
VectorDeleteFilter refuses an empty delete filter, which would match every entry of every tenant.
func VectorEntries ¶
func VectorEntries(entries []vectorstore.Entry) error
VectorEntries refuses a batch in which any entry has no tenant_id, before any of it is written.
func VectorSearch ¶
func VectorSearch(opts *vectorstore.SearchOptions) error
VectorSearch refuses a search that names no tenant. There is no search across every tenant.
Types ¶
This section is empty.