repo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RepoAlreadyExistsError = errors.New("repo already exists")

Functions

func Create

func Create(db *model.DBEngine, store *storage.Storage) gin.HandlerFunc

func CreatePage

func CreatePage(c *gin.Context)

func CreateV2

func CreateV2(db *model.DBEngine, store *storage.Storage) gin.HandlerFunc

func Delete

func Delete(db *model.DBEngine, store *storage.Storage) gin.HandlerFunc

Delete repo record from database and git storage 1. backup .git -> .git.backup 2. delete .git 2. delete db record 3. commit txn 4. remove backup

TODO(adl): If the database crashes while deleting repository records, we need to recover the Git repository data again during the database recovery process. This process should be delegated to an external stable storage to record the task, such as Redis or message queues.

func DeleteV2

func DeleteV2(db *model.DBEngine, store *storage.Storage) gin.HandlerFunc

func Home

func Home(db *model.DBEngine, store *storage.Storage) gin.HandlerFunc

func ShowRepo

func ShowRepo(db *model.DBEngine, store *storage.Storage) gin.HandlerFunc

func ShowRepos

func ShowRepos(db *model.DBEngine) gin.HandlerFunc

Types

type CreateRequest

type CreateRequest struct {
	RepoName    string `json:"repoName"`
	Description string `json:"description"`
}

type DeleteRequest

type DeleteRequest struct {
	Owner string `json:"owner"`
	Repo  string `json:"repo"`
}

type DeleteRequestV2

type DeleteRequestV2 struct {
	RepoName string `json:"reponame"`
}

Jump to

Keyboard shortcuts

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