db

package
v0.0.0-...-3377491 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreatePackageParams

type CreatePackageParams struct {
	PkgName     string  `db:"pkg_name" json:"pkg_name"`
	PkgType     Pkgtype `db:"pkg_type" json:"pkg_type"`
	Vcs         Vcstype `db:"vcs" json:"vcs"`
	Url         string  `db:"url" json:"url"`
	Description string  `db:"description" json:"description"`
}

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 GetPackagesParams

type GetPackagesParams struct {
	Offset int32 `db:"offset" json:"offset"`
	Limit  int32 `db:"limit" json:"limit"`
}

type NullPkgtype

type NullPkgtype struct {
	Pkgtype Pkgtype
	Valid   bool // Valid is true if String is not NULL
}

func (*NullPkgtype) Scan

func (ns *NullPkgtype) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullPkgtype) Value

func (ns NullPkgtype) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullVcstype

type NullVcstype struct {
	Vcstype Vcstype
	Valid   bool // Valid is true if String is not NULL
}

func (*NullVcstype) Scan

func (ns *NullVcstype) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullVcstype) Value

func (ns NullVcstype) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Package

type Package struct {
	ID          int64   `db:"id" json:"id"`
	PkgName     string  `db:"pkg_name" json:"pkg_name"`
	PkgType     Pkgtype `db:"pkg_type" json:"pkg_type"`
	Vcs         Vcstype `db:"vcs" json:"vcs"`
	Url         string  `db:"url" json:"url"`
	Description string  `db:"description" json:"description"`
}

type Pkgtype

type Pkgtype string
const (
	PkgtypeGo   Pkgtype = "go"
	PkgtypeRust Pkgtype = "rust"
	PkgtypeJava Pkgtype = "java"
	PkgtypeNode Pkgtype = "node"
)

func (*Pkgtype) Scan

func (e *Pkgtype) Scan(src interface{}) error

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) CreatePackage

func (q *Queries) CreatePackage(ctx context.Context, arg CreatePackageParams) error

func (*Queries) DeletePackage

func (q *Queries) DeletePackage(ctx context.Context, pkgName string) error

func (*Queries) GetPackageWithID

func (q *Queries) GetPackageWithID(ctx context.Context, id int64) (Package, error)

func (*Queries) GetPackageWithName

func (q *Queries) GetPackageWithName(ctx context.Context, pkgName string) (Package, error)

func (*Queries) GetPackages

func (q *Queries) GetPackages(ctx context.Context, arg GetPackagesParams) ([]Package, error)

func (*Queries) SearchPackages

func (q *Queries) SearchPackages(ctx context.Context, arg SearchPackagesParams) ([]Package, error)

func (*Queries) WithTx

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

type SearchPackagesParams

type SearchPackagesParams struct {
	ToTsquery string `db:"to_tsquery" json:"to_tsquery"`
	Offset    int32  `db:"offset" json:"offset"`
	Limit     int32  `db:"limit" json:"limit"`
}

type Vcstype

type Vcstype string
const (
	VcstypeBzr    Vcstype = "bzr"
	VcstypeFossil Vcstype = "fossil"
	VcstypeGit    Vcstype = "git"
	VcstypeHg     Vcstype = "hg"
	VcstypeSvn    Vcstype = "svn"
)

func (*Vcstype) Scan

func (e *Vcstype) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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