db

package
v0.0.0-...-0f43fba Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BranchOpen   BranchStatus = "OPEN"
	BranchMerged BranchStatus = "MERGED"
	BranchClosed BranchStatus = "CLOSED"

	BranchPgStarting BranchPgStatus = "STARTING"
	BranchPgStopped  BranchPgStatus = "STOPPED"
	BranchPgRunning  BranchPgStatus = "RUNNING"
	BranchPgFailed   BranchPgStatus = "FAILED"
)
View Source
const (
	RepoStarted   RepoStatus = "STARTED"
	RepoCompleted RepoStatus = "READY"
	RepoFailed    RepoStatus = "FAILED"

	HostAdapter RepoPgAdapter = "HOST"
)

Variables

View Source
var Db *sql.DB

Functions

func CountRepoByNameOrPath

func CountRepoByNameOrPath(ctx context.Context, repoName, repoPath string) (int64, error)

func CreateBranch

func CreateBranch(ctx context.Context, branch model.Branch) (model.Branch, error)

func CreatePool

func CreatePool(ctx context.Context, pool model.ZfsPool) (model.ZfsPool, error)

func CreateRepo

func CreateRepo(ctx context.Context, repo model.Repo) (model.Repo, error)

func DeletePool

func DeletePool(ctx context.Context, poolId int32) error

func DeleteRepo

func DeleteRepo(ctx context.Context, repoId int32) error

func GetBranch

func GetBranch(ctx context.Context, branchId int32) (model.Branch, error)

func GetBranchByName

func GetBranchByName(ctx context.Context, branchName string) (model.Branch, error)

func GetBranchPorts

func GetBranchPorts(ctx context.Context) ([]int32, error)

func Initialize

func Initialize() func()

func UpdateBranchPgStatus

func UpdateBranchPgStatus(ctx context.Context, branchId int32, status BranchPgStatus) error

func UpdateBranchStatus

func UpdateBranchStatus(ctx context.Context, branchId int32, status BranchStatus) error

func UpdateRepoPg

func UpdateRepoPg(ctx context.Context,
	repoId int32,
	pgPath string,
	version int32,
	adapter RepoPgAdapter,
	status RepoStatus,
) (model.Repo, error)

func UpdateRepoStatus

func UpdateRepoStatus(ctx context.Context, repoId int32, status RepoStatus, output string) (model.Repo, error)

Types

type BranchPgStatus

type BranchPgStatus string

type BranchStatus

type BranchStatus string

type PoolDetail

type PoolDetail struct {
	Repo model.Repo    `alias:"repo"`
	Pool model.ZfsPool `alias:"pool"`
}

func ListPoolDetail

func ListPoolDetail(ctx context.Context) ([]PoolDetail, error)

type RepoDetail

type RepoDetail struct {
	Repo     model.Repo
	Pool     model.ZfsPool  `alias:"pool"`
	Branches []model.Branch `alias:"branches"`
}

func GetRepo

func GetRepo(ctx context.Context, repoId int64) (RepoDetail, error)

func GetRepoByName

func GetRepoByName(ctx context.Context, repoName string) (RepoDetail, error)

func ListRepo

func ListRepo(ctx context.Context) ([]RepoDetail, error)

func ListRepoWithStatus

func ListRepoWithStatus(ctx context.Context, status ...RepoStatus) ([]RepoDetail, error)

type RepoPgAdapter

type RepoPgAdapter string

type RepoStatus

type RepoStatus string

Directories

Path Synopsis
gen

Jump to

Keyboard shortcuts

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