Documentation
¶
Overview ¶
Package quicksearch4datatug implements consent-controlled project metadata search.
Index ¶
- Constants
- Variables
- func EqualMetadata(uploaded, canonical Document) bool
- func Fold(s string) string
- func MetadataTags(tags []string) []string
- func RawTags(value any) []string
- type Access
- type Authority
- type CleanupAuthority
- type Coverage
- type DALStore
- type Document
- type FirestoreStore
- type Provider
- type ProviderDocument
- type PublicGitHubVerifier
- type PublicRepository
- type Query
- type Reference
- type Results
- type Scope
- type Service
- func (s *Service) CurrentOperation(ctx context.Context, canonical Scope) (WriterOperation, error)
- func (s *Service) CurrentWriter(ctx context.Context, canonical Scope) (string, time.Time, error)
- func (s *Service) Disable(ctx context.Context, actor string, scope Scope) (Status, error)
- func (s *Service) Index(ctx context.Context, actor string, scope Scope, snapshot Snapshot, enable bool) (Status, error)
- func (s *Service) RecoverWriter(ctx context.Context, scope Scope, operation string, ...) error
- func (s *Service) Search(ctx context.Context, actor string, scope Scope, q Query) (Results, error)
- func (s *Service) Status(ctx context.Context, actor string, scope Scope) (Status, error)
- type Snapshot
- type State
- type Status
- type Store
- type TransactionalStore
- type Typesense
- func (t *Typesense) CredentialGeneration() string
- func (t *Typesense) Delete(ctx context.Context, collection string) error
- func (t *Typesense) Read(ctx context.Context, collection string) ([]ProviderDocument, error)
- func (t *Typesense) Replace(ctx context.Context, collection string, docs []ProviderDocument) error
- type TypesenseOptions
- type WriterOperation
- type WriterRecoveryBarrier
Constants ¶
const ConsentVersion = "project-quick-search/1"
const MaxDocuments = 1000
const MaxKnownScopes = 256
A repository catalogue bounds only this repository/folder; other customers cannot exhaust its capacity. Entries remain until physical deletion is known.
const MaxTrackedCollections = 128
Bound failed cleanup resources before creating another provider collection.
Variables ¶
var ( ErrInvalid = errors.New("invalid_request") ErrDenied = errors.New("project_denied") ErrConflict = errors.New("operation_in_progress") ErrCapacity = errors.New("index_capacity_reached") ErrConsent = errors.New("consent_required") ErrProvider = errors.New("provider_unavailable") ErrProviderUnknown = errors.New("provider_completion_unknown") )
Functions ¶
func EqualMetadata ¶
EqualMetadata compares the entire uploaded projection, including navigation. No provider-controlled name/tag/source label survives an existence-only check.
func MetadataTags ¶
Types ¶
type Access ¶
type Access struct {
Scope Scope
CanManage, Eligible bool
Audience string
GitHubOwner, GitHubName string
}
Access is always server-derived, including the immutable canonical scope.
type CleanupAuthority ¶ added in v0.46.2
CleanupAuthority grants only deletion of retained metadata, independently of source read access.
type DALStore ¶
DALStore reuses the host's server-owned database and transaction lifecycle.
type Document ¶
type Document struct {
Kind string `json:"kind"`
ID string `json:"id"`
Name string `json:"name"`
QualifiedName string `json:"qualifiedName,omitempty"`
SourceName string `json:"sourceName,omitempty"`
ParentID string `json:"parentId,omitempty"`
ParentName string `json:"parentName,omitempty"`
Tags []string `json:"tags"`
Reference Reference `json:"reference"`
}
func NamedDocument ¶
func NamedDocumentJSON ¶
func SchemaDocument ¶
type FirestoreStore ¶
FirestoreStore keeps lifecycle authority server-side; it stores no indexed metadata.
func (FirestoreStore) UpdateMany ¶ added in v0.46.2
type ProviderDocument ¶
type PublicGitHubVerifier ¶
type PublicGitHubVerifier struct {
// contains filtered or unexported fields
}
func NewPublicGitHubVerifier ¶
func NewPublicGitHubVerifier(client *http.Client) *PublicGitHubVerifier
func (*PublicGitHubVerifier) ReadFile ¶
func (v *PublicGitHubVerifier) ReadFile(ctx context.Context, repo PublicRepository, branch, file string) ([]byte, error)
func (*PublicGitHubVerifier) Resolve ¶
func (v *PublicGitHubVerifier) Resolve(ctx context.Context, owner, name, folder, branch string) (PublicRepository, error)
type PublicRepository ¶
type Reference ¶
type Reference struct {
EnvironmentID string `json:"environmentId,omitempty"`
SourceID string `json:"sourceId,omitempty"`
DBModelID string `json:"dbModelId,omitempty"`
Schema string `json:"schema,omitempty"`
Table string `json:"table,omitempty"`
Column string `json:"column,omitempty"`
ObjectID string `json:"objectId,omitempty"`
Folder string `json:"folder,omitempty"`
}
type Scope ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) CurrentOperation ¶
func (*Service) CurrentWriter ¶
CurrentWriter is trusted host recovery information, never a browser API.
func (*Service) RecoverWriter ¶
type Snapshot ¶
type State ¶
type State struct {
CatalogueInitialized bool
KnownScopes []Scope
CleanupEpoch uint64
CredentialGeneration string
Scope Scope
Generation uint64
ConsentActor string
ConsentAt time.Time
ConsentVersion string
Phase string
Active string
ActiveGeneration uint64
Collections []string
CleanupOwners map[string]string
Lease string
LeaseUntil time.Time
LastIndexedAt *time.Time
Count int
Coverage []Coverage
Error string
}
type Status ¶
type Status struct {
State string `json:"state"`
CanManage bool `json:"canManage"`
Eligible bool `json:"eligible"`
Audience string `json:"audience"`
Provider string `json:"provider"`
ConsentVersion string `json:"consentVersion,omitempty"`
LastIndexedAt *time.Time `json:"lastIndexedAt,omitempty"`
DocumentCount int `json:"documentCount"`
Error string `json:"error,omitempty"`
SourceCoverage []Coverage `json:"sourceCoverage"`
Revision uint64 `json:"revision"`
}
type Store ¶
type Store interface {
Update(context.Context, string, func(*State) error) error
Read(context.Context, string) (State, error)
}
Store serializes mutations durably across processes. A missing scope is a zero State.
type TransactionalStore ¶ added in v0.46.2
type TransactionalStore interface {
UpdateMany(context.Context, []string, func(map[string]*State) error) error
}
TransactionalStore atomically validates the repository catalogue and claims lifecycle state.
type Typesense ¶
type Typesense struct {
// contains filtered or unexported fields
}
func NewTypesense ¶
func NewTypesense(o TypesenseOptions) (*Typesense, error)
func (*Typesense) CredentialGeneration ¶
type TypesenseOptions ¶
type WriterOperation ¶
type WriterOperation struct {
ID string
CredentialGeneration string
LeaseUntil time.Time
Scope Scope
}
WriterOperation is trusted maintenance information, never exposed by routes.
type WriterRecoveryBarrier ¶
WriterRecoveryBarrier must prove the old process/operation cannot issue any further provider requests (for example after an authoritative instance kill). Lease expiry or a caller assertion alone is not a recovery barrier.