db

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: GPL-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database struct {
	DB *gorm.DB
}

func NewDB

func NewDB(dbPath string) (*Database, error)

func (*Database) FindRepository added in v0.1.0

func (d *Database) FindRepository(ctx context.Context, provider, org, name string) (*Repository, error)

func (*Database) Init

func (d *Database) Init() error

func (*Database) InsertRepository

func (d *Database) InsertRepository(ctx context.Context, repo *Repository) error

func (*Database) SelectAllRepositories

func (d *Database) SelectAllRepositories(ctx context.Context) ([]Repository, error)

func (*Database) SelectRepositories

func (d *Database) SelectRepositories(ctx context.Context, org, filter string) ([]Repository, error)

func (*Database) UpsertRepositories

func (d *Database) UpsertRepositories(ctx context.Context, repos []Repository) error

type Repository

type Repository struct {
	gorm.Model
	Provider               string
	Title                  string `gorm:"unique"`
	Owner                  string
	Name                   string
	Description            string
	BrowserHomepageURL     string
	BrowserPullRequestsURL string
	OrgURL                 string
	IssuesURL              string
	CIURL                  string
	ReleasesURL            string
	SettingsURL            string
	HTTPSCloneURL          string
	SSHCloneURL            string
}

func NewRepository

func NewRepository(
	provider,
	title,
	owner,
	name,
	description,
	browserHomepageURL,
	browserPullRequestsURL,
	orgURL,
	issuesURL,
	ciURL,
	releasesURL,
	settingsURL,
	httpsCloneURL,
	sshCloneURL string,
) Repository

Jump to

Keyboard shortcuts

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