database

package
v0.0.0-...-f4fb894 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsdSystem

type AsdSystem struct {
	Id           primitive.SystemId   `db:"id"`
	Name         string               `db:"name"`
	DocumentId   primitive.DocumentId `db:"document_id"`
	AnalyzedTime float64              `db:"analyzed_time"`
}

type Database

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

func New

func New(databaseFile string) *Database

func (*Database) Close

func (d *Database) Close() error

func (*Database) Connect

func (d *Database) Connect() error

func (*Database) InitTables

func (d *Database) InitTables() error

func (*Database) InsertAsdSystem

func (d *Database) InsertAsdSystem(record *AsdSystem) error

func (*Database) InsertDocument

func (d *Database) InsertDocument(filename, body string) error

func (*Database) InsertPackage

func (d *Database) InsertPackage(record *Package) error

func (*Database) InsertPackageDefinition

func (d *Database) InsertPackageDefinition(record *PackageDefinition) error

func (*Database) InsertSymbol

func (d *Database) InsertSymbol(record *Symbol) error

func (*Database) InsertSymbolDefinition

func (d *Database) InsertSymbolDefinition(record *SymbolDefinition) error

func (*Database) InsertToken

func (d *Database) InsertToken(tokenId primitive.TokenId, term string) error

func (*Database) ResolveAllAsdSystem

func (d *Database) ResolveAllAsdSystem() ([]*AsdSystem, error)

func (*Database) ResolveAllDocuments

func (d *Database) ResolveAllDocuments() ([]*Document, error)

func (*Database) ResolveAllPackageDefinitions

func (d *Database) ResolveAllPackageDefinitions() ([]*PackageDefinition, error)

func (*Database) ResolveAllPackages

func (d *Database) ResolveAllPackages() ([]*Package, error)

func (*Database) ResolveAllSymbolDefinitions

func (d *Database) ResolveAllSymbolDefinitions() ([]*SymbolDefinition, error)

func (*Database) ResolveAllSymbols

func (d *Database) ResolveAllSymbols() ([]*Symbol, error)

func (*Database) ResolveAllTokens

func (d *Database) ResolveAllTokens() ([]*Token, error)

func (*Database) ResolveDocumentByFilename

func (d *Database) ResolveDocumentByFilename(filename string) (*Document, error)

func (*Database) ResolveDocumentById

func (d *Database) ResolveDocumentById(id primitive.DocumentId) (*Document, error)

func (*Database) ResolveDocumentWithBodyById

func (d *Database) ResolveDocumentWithBodyById(id primitive.DocumentId) (string, error)

func (*Database) ResolveDocumentsByFilenames

func (d *Database) ResolveDocumentsByFilenames(filenames []string) ([]*Document, error)

func (*Database) ResolveDocumentsByIds

func (d *Database) ResolveDocumentsByIds(ids []primitive.DocumentId) ([]*Document, error)

func (*Database) ResolveInvertedIndex

func (d *Database) ResolveInvertedIndex(tokenIds []primitive.TokenId) (
	*invertedindex.InvertedIndex,
	error,
)

func (*Database) ResolveSymbolDefinitionsBySymbolId

func (d *Database) ResolveSymbolDefinitionsBySymbolId(id primitive.SymbolId) (
	[]*SymbolDefinition, error,
)

func (*Database) ResolveSymbols

func (d *Database) ResolveSymbols(symbol *Symbol) ([]*Symbol, error)

func (*Database) ResolveTokenById

func (d *Database) ResolveTokenById(id primitive.TokenId) (*Token, error)

func (*Database) ResolveTokenByTerm

func (d *Database) ResolveTokenByTerm(term string) (*Token, error)

func (*Database) ResolveTokensByTerms

func (d *Database) ResolveTokensByTerms(terms []string) ([]*Token, error)

func (*Database) ResolveWholeInvertedIndex

func (d *Database) ResolveWholeInvertedIndex() (*invertedindex.InvertedIndex, error)

func (*Database) UpsertInvertedIndex

func (d *Database) UpsertInvertedIndex(tokenId primitive.TokenId, blob []byte) error

type Document

type Document struct {
	Id       primitive.DocumentId `db:"id"`
	Filename string               `db:"filename"`
	Body     string               `db:"body"`
}

type InvertedIndex

type InvertedIndex struct {
	TokenId     primitive.TokenId `db:"token_id"`
	PostingList []byte            `db:"posting_list"`
}

type Location

type Location struct {
	Specifier  string               `db:"specifier"`
	DocumentId primitive.DocumentId `db:"document_id"`
	Position   int                  `db:"position"`
}

type Package

type Package struct {
	Id       primitive.PackageId `db:"id"`
	Name     string              `db:"name"`
	SystemId primitive.SystemId  `db:"system_id"`
}

type PackageDefinition

type PackageDefinition struct {
	PackageId primitive.PackageId `db:"package_id"`
	Location
}

type Symbol

type Symbol struct {
	Id          primitive.SymbolId `db:"id"`
	Name        string             `db:"name"`
	PackageName sql.NullString     `db:"package_name"`
}

type SymbolDefinition

type SymbolDefinition struct {
	SymbolId primitive.SymbolId `db:"symbol_id"`
	Location
}

type Token

type Token struct {
	Id   primitive.TokenId `db:"id"`
	Term string            `db:"term"`
	Kind sql.NullInt64     `db:"kind"`
}

Jump to

Keyboard shortcuts

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