tenancy

package
v1.9.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package tenancy holds the tenant checks every Weave metadata store runs before it touches data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChunkCount

func ChunkCount(ctx context.Context, f *chunk.CountFilter) (string, error)

ChunkCount scopes a chunk count filter.

func ChunkList

func ChunkList(ctx context.Context, f *chunk.ListFilter) (string, error)

ChunkList scopes a chunk list 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

func DocumentCount(ctx context.Context, f *document.CountFilter) (string, error)

DocumentCount scopes a document count filter.

func DocumentList

func DocumentList(ctx context.Context, f *document.ListFilter) (string, error)

DocumentList scopes a document list filter.

func Owner

func Owner(ctx context.Context, what, owner string) (string, error)

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

func Scope(ctx context.Context, filter *string) (string, error)

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

func VectorDeleteFilter(filter map[string]string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL