entity

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package entity implements entity extraction and linking for Cortex.

It extracts files, URLs, packages, symbols, and concepts from observation content using regex patterns and stores them as entity links.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(obs *domain.Observation) []*domain.EntityLink

Extract extracts all entity links from an observation's content.

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service handles entity extraction and storage.

func NewService

func NewService(repo domain.EntityRepository) *Service

NewService creates a new entity service.

func (*Service) ExtractAndSave

func (s *Service) ExtractAndSave(ctx context.Context, obs *domain.Observation) error

ExtractAndSave extracts entities from an observation and saves the links.

func (*Service) FindByEntity

func (s *Service) FindByEntity(ctx context.Context, entityType, entityValue string) ([]*domain.EntityLink, error)

FindByEntity returns observations referencing a specific entity.

func (*Service) GetByObservation

func (s *Service) GetByObservation(ctx context.Context, obsID int64) ([]*domain.EntityLink, error)

GetByObservation returns entity links for an observation.

Jump to

Keyboard shortcuts

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