db

package
v0.0.0-...-6eaabc9 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConnectAttempts = 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseClient

type DatabaseClient interface {
	CreateSchema() error

	InsertBuild(build *structs.Build) error
	AllBuilds(repoID int64, branch string) ([]*structs.Build, error)
	CountBuildsInRepoWithBranch(repoID int64, branch string) (int, error)
	FindBuildByID(buildID int64) (*structs.Build, error)

	InsertArtifact(artifact *structs.Artifact) error
	AllArtifacts(repoID int64, branch string) ([]*structs.Artifact, error)
	FindArtifactByBuildID(buildID int64) (*structs.Artifact, error)
	FindArtifactByID(id int64) (*structs.Artifact, error)

	Disconnect() error
}

type PostgresClient

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

func NewPostgresClient

func NewPostgresClient(config config.PostgresConfig) *PostgresClient

func (*PostgresClient) AllArtifacts

func (p *PostgresClient) AllArtifacts(repoID int64, branch string) ([]*structs.Artifact, error)

func (*PostgresClient) AllBuilds

func (p *PostgresClient) AllBuilds(repoID int64, branch string) ([]*structs.Build, error)

func (*PostgresClient) CountBuildsInRepoWithBranch

func (p *PostgresClient) CountBuildsInRepoWithBranch(repoID int64, branch string) (int, error)

func (*PostgresClient) CreateSchema

func (p *PostgresClient) CreateSchema() error

func (*PostgresClient) Disconnect

func (p *PostgresClient) Disconnect() error

func (*PostgresClient) FindArtifactByBuildID

func (p *PostgresClient) FindArtifactByBuildID(buildID int64) (*structs.Artifact, error)

func (*PostgresClient) FindArtifactByID

func (p *PostgresClient) FindArtifactByID(id int64) (*structs.Artifact, error)

func (*PostgresClient) FindBuildByID

func (p *PostgresClient) FindBuildByID(buildID int64) (*structs.Build, error)

func (*PostgresClient) InsertArtifact

func (p *PostgresClient) InsertArtifact(artifact *structs.Artifact) error

func (*PostgresClient) InsertBuild

func (p *PostgresClient) InsertBuild(build *structs.Build) error

Jump to

Keyboard shortcuts

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