sqlite

package
v0.0.0-...-642d354 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPath

func GetPath(filename string) string

GetPath returns the full path to the data file

Types

type DB

type DB struct {
	*sql.DB
}

DB local database with our custom methods.

func NewDatabase

func NewDatabase() (*DB, error)

NewDatabase returns an open database connection

func (*DB) BuildCreate

func (db *DB) BuildCreate(name, repo, branch string) (string, error)

BuildCreate stores a new build request

func (*DB) BuildDelete

func (db *DB) BuildDelete(id string) error

BuildDelete delete a build request and its logs

func (*DB) BuildGet

func (db *DB) BuildGet(id string) (domain.Build, error)

BuildGet fetches a build with its logs

func (*DB) BuildList

func (db *DB) BuildList() ([]domain.Build, error)

BuildList get the list of builds

func (*DB) BuildListForRepo

func (db *DB) BuildListForRepo(name, branch string) ([]domain.Build, error)

BuildListForRepo get the list of builds for a repo

func (*DB) BuildLogCreate

func (db *DB) BuildLogCreate(buildID, message string) error

BuildLogCreate logs a message for a build

func (*DB) BuildLogDelete

func (db *DB) BuildLogDelete(buildID string) error

BuildLogDelete deletes logs for a build

func (*DB) BuildLogList

func (db *DB) BuildLogList(buildID string) ([]domain.BuildLog, error)

BuildLogList lists messages for a build

func (*DB) BuildUpdate

func (db *DB) BuildUpdate(id, status string, duration int) error

BuildUpdate updates a build request

func (*DB) BuildUpdateContainer

func (db *DB) BuildUpdateContainer(id, container string) error

BuildUpdateContainer updates a build request's container name

func (*DB) BuildUpdateDownload

func (db *DB) BuildUpdateDownload(id, download string) error

BuildUpdateDownload updates a build request's download file path

func (*DB) CreateTables

func (db *DB) CreateTables() error

CreateTables creates the database tables

func (*DB) KeysCreate

func (db *DB) KeysCreate(name, data, password string) (string, error)

KeysCreate stores a new ssh key

func (*DB) KeysDelete

func (db *DB) KeysDelete(id string) error

KeysDelete removes a key from its name

func (*DB) KeysGet

func (db *DB) KeysGet(id string) (domain.Key, error)

KeysGet fetches an ssh key by its ID

func (*DB) KeysList

func (db *DB) KeysList() ([]domain.Key, error)

KeysList get the list of ssh keys. Only unencrypted data is returned.

func (*DB) RepoCreate

func (db *DB) RepoCreate(name, repo, branch, keyID string) (string, error)

RepoCreate creates a new repository to watch

func (*DB) RepoDelete

func (db *DB) RepoDelete(id string) error

RepoDelete removes a repo from its ID

func (*DB) RepoGet

func (db *DB) RepoGet(id string) (domain.Repo, error)

RepoGet fetches a repo from its ID

func (*DB) RepoList

func (db *DB) RepoList(watch bool) ([]domain.Repo, error)

RepoList get the list of repos

func (*DB) RepoUpdateHash

func (db *DB) RepoUpdateHash(id, hash string) error

RepoUpdateHash updates a repo's last commit hash

func (*DB) ReposForKey

func (db *DB) ReposForKey(keyID string) ([]domain.Repo, error)

ReposForKey get the list repos using a key

func (*DB) SettingsCreate

func (db *DB) SettingsCreate(key, name, data string) (string, error)

SettingsCreate stores a new config setting

func (*DB) SettingsGet

func (db *DB) SettingsGet(key, name string) (domain.ConfigSetting, error)

SettingsGet fetches an existing config setting

Jump to

Keyboard shortcuts

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