db

package
v0.0.0-...-90ad787 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBClient

func DBClient() *bun.DB

According to documentation, it's rarely necessary to close a DB connection. The returned DB is safe for concurrent use by multiple goroutines and maintains its own pool of idle connections. Thus, the OpenDB function should be called just once.

func UpdateRepo

func UpdateRepo(repo RepoData, ctx context.Context) error

Types

type RepoData

type RepoData struct {
	bun.BaseModel `bun:"table:repos"`

	ID       int64        `bun:"id,pk,notnull"`
	Repo     string       `bun:"repo,notnull"`
	Owner    string       `bun:"owner,notnull"`
	Schedule string       `bun:"schedule,notnull"`
	LastRun  bun.NullTime `bun:"lastrun"`
}

func GetRepos

func GetRepos(ctx context.Context) (repos []RepoData, err error)

Jump to

Keyboard shortcuts

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