Documentation
¶
Index ¶
Constants ¶
const SetDedup = "lsh_dedup"
SetDedup is the set name for LSH dedup storage.
const SetVector = "lsh_vector"
SetVector is the set name for LSH vector storage.
Variables ¶
This section is empty.
Functions ¶
func DeleteDedup ¶
DeleteDedup removes the LSH dedup bucket entry for the given reference value. The server stores dedup data under the namespace with the reference value as key.
func DeleteVector ¶
func DeleteVector(ctx context.Context, c queries.Client, req VectorRequest, src queries.Source) error
DeleteVector removes the LSH vector bucket entry for the given attribute vector.
Types ¶
type DedupRequest ¶
type DedupRequest struct {
Namespace string // FrogoDB namespace for LSH index
Reference string // source key for reference value (e.g., "standard.email")
TTL time.Duration // REQUIRED. Expiration for LSH bucket entries.
}
DedupRequest describes an LSH string deduplication query.
func (DedupRequest) Validate ¶
func (r DedupRequest) Validate() error
Validate checks that required fields are set.
type DedupResult ¶
type DedupResult struct {
BucketID string // LSH bucket identifier
}
DedupResult holds the outcome of an LSH deduplication query.
func Dedup ¶
func Dedup(ctx context.Context, c queries.Client, req DedupRequest, src queries.Source) (DedupResult, error)
Dedup performs an LSH string deduplication query. It extracts the reference value from the source, sends it to the FrogoDB LSH dedup service, and returns the bucket ID.
Flow:
- value = src.String(req.Reference)
- Send OpLSHDedup to FrogoDB with value
- Server computes LSH hash -> bucket_id
- Return DedupResult{BucketID: bucketID}
type VectorRequest ¶
type VectorRequest struct {
Namespace string // FrogoDB namespace for vector LSH index
Attributes []string // ordered source keys for vector components
TTL time.Duration // REQUIRED. Expiration for vector LSH bucket entries.
}
VectorRequest describes an LSH vector query for behavioural clustering.
func (VectorRequest) Validate ¶
func (r VectorRequest) Validate() error
Validate checks that required fields are set.
type VectorResult ¶
type VectorResult struct {
BehavioralID string // LSH bucket identifier for this behavior vector
}
VectorResult holds the outcome of an LSH vector query.
func Vector ¶
func Vector(ctx context.Context, c queries.Client, req VectorRequest, src queries.Source) (VectorResult, error)
Vector performs an LSH vector query. It extracts ordered attribute floats from the source, forms a vector, sends it to the FrogoDB LSH vector service, and returns the behavioural ID.
Flow:
- vec[i] = src.Float(req.Attributes[i]) for each attribute
- Send OpLSHVector to FrogoDB with vector bytes
- Server computes vector LSH -> behavioral_id
- Return VectorResult{BehavioralID: id}