database

package
v0.0.0-...-113b096 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type Distro

type Distro struct {
	ID      int64
	Name    string
	Version string
}

Linux distributions. Each row contains a Linux distro with a version.

type FuzzySearchRow

type FuzzySearchRow struct {
	ID            int64
	HumanName     string
	Name          string
	LatestVersion string
	Description   string
	Keywords      []string
	Homepage      string
	Developer     []string
}

type GetVariationsRow

type GetVariationsRow struct {
	ID            int64
	PackageID     int64
	DistroID      int64
	HumanName     string
	Name          string
	Version       int64
	PackageUrl    string
	DownloadUrl   string
	DistroName    string
	DistroVersion string
}

type MajorVersion

type MajorVersion struct {
	ID          int64
	PackageID   int64
	VersionName string
	ReleaseDate time.Time
}

Major versions of packages

type Package

type Package struct {
	ID            int64
	HumanName     string
	Name          string
	LatestVersion int64
	Description   string
	Keywords      []string
	Homepage      string
	Developer     []string
}

Package information that is shared across distributions

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) FuzzySearch

func (q *Queries) FuzzySearch(ctx context.Context, term string) ([]FuzzySearchRow, error)

func (*Queries) GetAllPackages

func (q *Queries) GetAllPackages(ctx context.Context) ([]Package, error)

func (*Queries) GetPackageFromID

func (q *Queries) GetPackageFromID(ctx context.Context, id pgtype.Numeric) (Package, error)

func (*Queries) GetVariations

func (q *Queries) GetVariations(ctx context.Context, packageID pgtype.Numeric) ([]GetVariationsRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Variation

type Variation struct {
	ID          int64
	PackageID   int64
	DistroID    int64
	Name        string
	Version     int64
	PackageUrl  string
	DownloadUrl string
}

Package variants for each distro

type Version

type Version struct {
	ID             int64
	MajorVersionID int64
	VersionName    string
	ReleaseDate    time.Time
}

Minor versions of packages

Jump to

Keyboard shortcuts

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