Documentation
¶
Index ¶
- func ExportGraph(kg KnowledgeGraph, format, title string) ([]byte, error)
- func MarshalTargets(names []string) string
- func OpenDB(dbURL string) (*gorm.DB, error)
- type AuditEvent
- type AuditFilter
- type AuditStore
- type AuditSummary
- type ContentCache
- func (cc *ContentCache) Count() (int64, error)
- func (cc *ContentCache) DeleteOrphanedContent(activeRepos []string) error
- func (cc *ContentCache) ListDocs(repoName string) ([]DocRecord, error)
- func (cc *ContentCache) NeedsUpdate(repoName, path, sha string) bool
- func (cc *ContentCache) Search(query, repoName, fileType string) ([]ContentMatch, error)
- func (cc *ContentCache) SearchMode() string
- func (cc *ContentCache) Upsert(repoName, path, sha, content, fileType string) error
- type ContentMatch
- type DBAuditStore
- type DocRecord
- type Entity
- type IntegrationEdge
- type IntegrationMap
- type KnowledgeGraph
- type MemoryService
- func (srv *MemoryService) AddObservations(obs []Observation) ([]Observation, error)
- func (srv *MemoryService) CreateEntities(entities []Entity) ([]Entity, error)
- func (srv *MemoryService) CreateRelations(relations []Relation) ([]Relation, error)
- func (srv *MemoryService) DeleteEntities(names []string) error
- func (srv *MemoryService) DeleteObservations(deletions []Observation) error
- func (srv *MemoryService) DeleteRelations(relations []Relation) error
- func (srv *MemoryService) EntityCount() (int64, error)
- func (srv *MemoryService) EntityTypeCounts() (map[string]int64, error)
- func (srv *MemoryService) FindPath(from, to string, maxDepth int) ([]PathEdge, error)
- func (srv *MemoryService) GetIntegrationMap(ctx context.Context, service string, depth int) (IntegrationMap, error)
- func (srv *MemoryService) ListEntities(entityType string) (KnowledgeGraph, error)
- func (srv *MemoryService) ListRelations(relationType, fromEntity string) ([]Relation, error)
- func (srv *MemoryService) OpenNodes(names []string) (KnowledgeGraph, error)
- func (srv *MemoryService) OpenNodesFiltered(names []string, includeArchived bool) (KnowledgeGraph, error)
- func (srv *MemoryService) ReadGraph() (KnowledgeGraph, error)
- func (srv *MemoryService) SearchNodes(query string) (KnowledgeGraph, error)
- func (srv *MemoryService) SearchNodesFiltered(query string, includeArchived bool) (KnowledgeGraph, error)
- func (srv *MemoryService) TraverseGraph(entity, relationType, direction string, maxDepth int) ([]TraverseNode, []TraverseEdge, error)
- func (srv *MemoryService) UpdateEntity(oldName, newName, newType string) error
- type Observation
- type PathEdge
- type Relation
- type TraverseEdge
- type TraverseNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportGraph ¶ added in v0.1.0
func ExportGraph(kg KnowledgeGraph, format, title string) ([]byte, error)
func MarshalTargets ¶
Types ¶
type AuditEvent ¶
type AuditFilter ¶
type AuditStore ¶
type AuditStore interface {
Write(ctx context.Context, e AuditEvent) error
Query(ctx context.Context, f AuditFilter) ([]AuditEvent, int64, error)
Summary(ctx context.Context, window time.Duration) (AuditSummary, error)
}
type AuditSummary ¶
type ContentCache ¶
type ContentCache struct {
// contains filtered or unexported fields
}
func NewContentCache ¶
func NewContentCache(db *gorm.DB, enabled bool, maxSize int) *ContentCache
func (*ContentCache) Count ¶
func (cc *ContentCache) Count() (int64, error)
func (*ContentCache) DeleteOrphanedContent ¶
func (cc *ContentCache) DeleteOrphanedContent(activeRepos []string) error
func (*ContentCache) ListDocs ¶
func (cc *ContentCache) ListDocs(repoName string) ([]DocRecord, error)
func (*ContentCache) NeedsUpdate ¶
func (cc *ContentCache) NeedsUpdate(repoName, path, sha string) bool
func (*ContentCache) Search ¶
func (cc *ContentCache) Search(query, repoName, fileType string) ([]ContentMatch, error)
func (*ContentCache) SearchMode ¶
func (cc *ContentCache) SearchMode() string
func (*ContentCache) Upsert ¶
func (cc *ContentCache) Upsert(repoName, path, sha, content, fileType string) error
type ContentMatch ¶
type DBAuditStore ¶
type DBAuditStore struct {
// contains filtered or unexported fields
}
func NewAuditStore ¶
func NewAuditStore(db *gorm.DB) (*DBAuditStore, error)
func (*DBAuditStore) Query ¶
func (s *DBAuditStore) Query(_ context.Context, f AuditFilter) ([]AuditEvent, int64, error)
func (*DBAuditStore) Summary ¶
func (s *DBAuditStore) Summary(_ context.Context, window time.Duration) (AuditSummary, error)
func (*DBAuditStore) Write ¶
func (s *DBAuditStore) Write(_ context.Context, e AuditEvent) error
type IntegrationEdge ¶
type IntegrationEdge struct {
Target string `json:"target"`
Schema string `json:"schema,omitempty"` // event-topic schema name
Version string `json:"version,omitempty"` // api version
Paths int `json:"paths,omitempty"` // api path count
Confidence string `json:"confidence"` // "authoritative" | "inferred"
SourceRepo string `json:"source_repo,omitempty"` // originating repo
}
type IntegrationMap ¶
type IntegrationMap struct {
Service string `json:"service"`
Publishes []IntegrationEdge `json:"publishes"`
Subscribes []IntegrationEdge `json:"subscribes"`
ExposesAPI []IntegrationEdge `json:"exposes_api"`
ProvidesGRPC []IntegrationEdge `json:"provides_grpc"`
GRPCDeps []IntegrationEdge `json:"grpc_deps"`
Calls []IntegrationEdge `json:"calls"`
Coverage string `json:"graph_coverage"` // "full" | "partial" | "inferred" | "none"
}
type KnowledgeGraph ¶
type MemoryService ¶
type MemoryService struct {
// contains filtered or unexported fields
}
func NewMemoryService ¶
func NewMemoryService(db *gorm.DB) *MemoryService
func (*MemoryService) AddObservations ¶
func (srv *MemoryService) AddObservations(obs []Observation) ([]Observation, error)
func (*MemoryService) CreateEntities ¶
func (srv *MemoryService) CreateEntities(entities []Entity) ([]Entity, error)
func (*MemoryService) CreateRelations ¶
func (srv *MemoryService) CreateRelations(relations []Relation) ([]Relation, error)
func (*MemoryService) DeleteEntities ¶
func (srv *MemoryService) DeleteEntities(names []string) error
func (*MemoryService) DeleteObservations ¶
func (srv *MemoryService) DeleteObservations(deletions []Observation) error
func (*MemoryService) DeleteRelations ¶
func (srv *MemoryService) DeleteRelations(relations []Relation) error
func (*MemoryService) EntityCount ¶
func (srv *MemoryService) EntityCount() (int64, error)
func (*MemoryService) EntityTypeCounts ¶
func (srv *MemoryService) EntityTypeCounts() (map[string]int64, error)
func (*MemoryService) FindPath ¶
func (srv *MemoryService) FindPath(from, to string, maxDepth int) ([]PathEdge, error)
func (*MemoryService) GetIntegrationMap ¶
func (srv *MemoryService) GetIntegrationMap(ctx context.Context, service string, depth int) (IntegrationMap, error)
func (*MemoryService) ListEntities ¶
func (srv *MemoryService) ListEntities(entityType string) (KnowledgeGraph, error)
func (*MemoryService) ListRelations ¶
func (srv *MemoryService) ListRelations(relationType, fromEntity string) ([]Relation, error)
func (*MemoryService) OpenNodes ¶
func (srv *MemoryService) OpenNodes(names []string) (KnowledgeGraph, error)
func (*MemoryService) OpenNodesFiltered ¶
func (srv *MemoryService) OpenNodesFiltered(names []string, includeArchived bool) (KnowledgeGraph, error)
func (*MemoryService) ReadGraph ¶
func (srv *MemoryService) ReadGraph() (KnowledgeGraph, error)
func (*MemoryService) SearchNodes ¶
func (srv *MemoryService) SearchNodes(query string) (KnowledgeGraph, error)
func (*MemoryService) SearchNodesFiltered ¶
func (srv *MemoryService) SearchNodesFiltered(query string, includeArchived bool) (KnowledgeGraph, error)
func (*MemoryService) TraverseGraph ¶
func (srv *MemoryService) TraverseGraph(entity, relationType, direction string, maxDepth int) ([]TraverseNode, []TraverseEdge, error)
func (*MemoryService) UpdateEntity ¶
func (srv *MemoryService) UpdateEntity(oldName, newName, newType string) error
type Observation ¶
type PathEdge ¶
type PathEdge struct {
From string `json:"from"`
RelationType string `json:"relationType"`
To string `json:"to"`
Confidence string `json:"confidence,omitempty"`
}
PathEdge is a single directed edge on the path between two entities. The edge reflects the actual stored direction regardless of traversal direction.
type TraverseEdge ¶ added in v0.1.0
type TraverseEdge struct {
From string `json:"from"`
To string `json:"to"`
RelationType string `json:"relationType"`
Confidence string `json:"confidence,omitempty"`
}
TraverseEdge is a directed edge discovered during graph traversal.
type TraverseNode ¶
type TraverseNode struct {
Name string `json:"name"`
EntityType string `json:"entityType"`
Observations []string `json:"observations"`
Distance int `json:"distance"`
Path []string `json:"path"` // entity names from start (exclusive) to this node (inclusive)
}
TraverseNode is a node reached during graph traversal, enriched with distance from the start entity and the path of entity names leading to it.
Click to show internal directories.
Click to hide internal directories.