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

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