Documentation ¶
Overview ¶
Package database manages the storage of documentation.
Index ¶
- type Database
- func (db *Database) Directories(ctx context.Context, platform, modulePath, version, importPath string) ([]Synopsis, error)
- func (db *Database) HasPackage(ctx context.Context, platform, importPath, version string) (bool, error)
- func (db *Database) IsBlocked(ctx context.Context, importPath string) (bool, error)
- func (db *Database) Modules(ctx context.Context) (int64, error)
- func (db *Database) Oldest(ctx context.Context) (string, time.Time, error)
- func (db *Database) Package(ctx context.Context, platform, importPath, version string) (*Package, error)
- func (db *Database) Project(ctx context.Context, modulePath string) (*autodiscovery.Project, error)
- func (db *Database) ProjectUpdated(ctx context.Context, modulePath string) (time.Time, error)
- func (db *Database) PutDirectory(tx *sql.Tx, platform string, mod *internal.Module, importPath string, ...) error
- func (db *Database) PutModule(ctx context.Context, mod *internal.Module) error
- func (db *Database) PutPackage(tx *sql.Tx, platform string, mod *internal.Module, pkg *doc.Package, ...) error
- func (db *Database) PutProject(ctx context.Context, modulePath string, project *autodiscovery.Project) error
- func (db *Database) RegisterMetrics(r prometheus.Registerer) error
- func (db *Database) Search(ctx context.Context, platform, query string) ([]Synopsis, error)
- func (db *Database) Synopses(ctx context.Context, platform string, importPaths []string) ([]Synopsis, error)
- func (db *Database) TouchModule(ctx context.Context, modulePath string) error
- func (db *Database) WithTx(ctx context.Context, opts *sql.TxOptions, fn func(tx *sql.Tx) error) error
- type Package
- type Synopsis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Database ¶
type Database struct {
// contains filtered or unexported fields
}
Database stores package documentation.
func (*Database) Directories ¶
func (db *Database) Directories(ctx context.Context, platform, modulePath, version, importPath string) ([]Synopsis, error)
Directories returns the subdirectories for a given package.
func (*Database) HasPackage ¶
func (db *Database) HasPackage(ctx context.Context, platform, importPath, version string) (bool, error)
HasPackage reports whether the given package is present in the database.
func (*Database) IsBlocked ¶
IsBlocked returns whether the package is blocked or belongs to a blocked domain/repo.
func (*Database) Oldest ¶
Oldest returns the module path of the oldest module in the database (i.e., the module with the smallest updated timestamp).
func (*Database) Package ¶
func (db *Database) Package(ctx context.Context, platform, importPath, version string) (*Package, error)
Package returns information for the package with the given import path. It may return nil if no such package was found.
func (*Database) Project ¶
Project returns information about the project associated with the given module. It may return nil if no project exists.
func (*Database) ProjectUpdated ¶
ProjectUpdated returns the last time the project was updated. If no project exists, it returns the zero timestamp.
func (*Database) PutDirectory ¶
func (db *Database) PutDirectory(tx *sql.Tx, platform string, mod *internal.Module, importPath string, errorMsg string) error
PutDirectory stores the directory in the database.
func (*Database) PutPackage ¶
func (db *Database) PutPackage(tx *sql.Tx, platform string, mod *internal.Module, pkg *doc.Package, source []byte) error
PutPackage stores the package in the database.
func (*Database) PutProject ¶
func (db *Database) PutProject(ctx context.Context, modulePath string, project *autodiscovery.Project) error
PutProject puts project information in the database.
func (*Database) RegisterMetrics ¶
func (db *Database) RegisterMetrics(r prometheus.Registerer) error
func (*Database) Synopses ¶
func (db *Database) Synopses(ctx context.Context, platform string, importPaths []string) ([]Synopsis, error)
Synopses returns a list of package synopses for the given import paths.
func (*Database) TouchModule ¶
TouchModule updates the module's updated timestamp. If the module does not exist, TouchModule does nothing.