Documentation
¶
Index ¶
- func CleanupTempDatabase() error
- func GetEmbeddedDatabasePath() (string, error)
- func HasEmbeddedDatabase() bool
- type Query
- type QueryResult
- type Storage
- func (s *Storage) Close() error
- func (s *Storage) GetBreakingChanges(componentName string) []types.BreakingChange
- func (s *Storage) GetCompatibleVersions(componentName, version string) []types.CompatibleComponent
- func (s *Storage) GetComponentByName(name string) *types.Component
- func (s *Storage) GetComponentCount() (int, error)
- func (s *Storage) GetComponentsByCategory(category types.ComponentCategory) []types.Component
- func (s *Storage) GetComponentsByLanguage(language types.ComponentLanguage) []types.Component
- func (s *Storage) GetComponentsByStatus(status types.ComponentStatus) []types.Component
- func (s *Storage) GetComponentsBySupportLevel(supportLevel types.SupportLevel) []types.Component
- func (s *Storage) GetComponentsByType(componentType types.ComponentType) []types.Component
- func (s *Storage) GetComponentsLight(query Query) *QueryResult
- func (s *Storage) GetInstrumentationsByFramework(framework string) []types.Component
- func (s *Storage) GetLatestVersions() map[string]types.Version
- func (s *Storage) GetVersionCount() (int, error)
- func (s *Storage) LoadComponentVersions(componentName string) ([]types.Version, error)
- func (s *Storage) QueryKnowledgeBase(query Query) *QueryResult
- func (s *Storage) SaveComponents(components []types.Component, filename string) error
- func (s *Storage) SaveKnowledgeBase(components []types.Component, filename string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupTempDatabase ¶
func CleanupTempDatabase() error
CleanupTempDatabase removes the temporary database file if it exists
func GetEmbeddedDatabasePath ¶
GetEmbeddedDatabasePath returns a path to the embedded database file. It extracts the embedded database to a temporary location if needed.
func HasEmbeddedDatabase ¶
func HasEmbeddedDatabase() bool
HasEmbeddedDatabase checks if an embedded database is available
Types ¶
type Query ¶
type Query struct { Language string Type string Category string Status string SupportLevel string Name string Version string MinDate time.Time MaxDate time.Time Tags []string Maintainers []string Framework string // For instrumentation targets // Pagination support Limit int // Maximum number of results to return (0 = no limit) Offset int // Number of results to skip }
Query represents a query against the knowledge base
type QueryResult ¶
type QueryResult struct { Components []types.Component Total int // Total number of matching components (ignoring pagination) Returned int // Number of components returned in this result Query Query HasMore bool // Whether there are more results available }
QueryResult represents the result of a query
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage represents the knowledge base storage interface using SQLite
func NewStorage ¶
NewStorageWithLogger creates a new storage instance with a custom logger
func NewStorageWithEmbedded ¶
NewStorageWithEmbedded creates a new storage instance using the embedded database as a fallback if no database path is provided or if the specified path doesn't exist.
func (*Storage) GetBreakingChanges ¶
func (s *Storage) GetBreakingChanges(componentName string) []types.BreakingChange
GetBreakingChanges returns breaking changes for a given component
func (*Storage) GetCompatibleVersions ¶
func (s *Storage) GetCompatibleVersions(componentName, version string) []types.CompatibleComponent
GetCompatibleVersions returns compatible versions for a given component and version
func (*Storage) GetComponentByName ¶
GetComponentByName returns a component by name
func (*Storage) GetComponentCount ¶
GetComponentCount returns the total number of components in the database
func (*Storage) GetComponentsByCategory ¶
func (s *Storage) GetComponentsByCategory(category types.ComponentCategory) []types.Component
GetComponentsByCategory returns all components of a specific category
func (*Storage) GetComponentsByLanguage ¶
func (s *Storage) GetComponentsByLanguage(language types.ComponentLanguage) []types.Component
GetComponentsByLanguage returns all components for a specific language
func (*Storage) GetComponentsByStatus ¶
func (s *Storage) GetComponentsByStatus(status types.ComponentStatus) []types.Component
GetComponentsByStatus returns all components with a specific status
func (*Storage) GetComponentsBySupportLevel ¶
func (s *Storage) GetComponentsBySupportLevel(supportLevel types.SupportLevel) []types.Component
GetComponentsBySupportLevel returns all components with a specific support level
func (*Storage) GetComponentsByType ¶
func (s *Storage) GetComponentsByType(componentType types.ComponentType) []types.Component
GetComponentsByType returns all components of a specific type
func (*Storage) GetComponentsLight ¶
func (s *Storage) GetComponentsLight(query Query) *QueryResult
GetComponentsLight returns components without loading their versions (for performance)
func (*Storage) GetInstrumentationsByFramework ¶
GetInstrumentationsByFramework returns all instrumentations for a specific framework
func (*Storage) GetLatestVersions ¶
GetLatestVersions returns the latest version of each component
func (*Storage) GetVersionCount ¶
GetVersionCount returns the total number of versions in the database
func (*Storage) LoadComponentVersions ¶
LoadComponentVersions loads versions for a specific component by name
func (*Storage) QueryKnowledgeBase ¶
func (s *Storage) QueryKnowledgeBase(query Query) *QueryResult
QueryKnowledgeBase queries the knowledge base based on criteria using SQLite with pagination support