api

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 27 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	PodName       = "gittar"
	ComponentName = "gittar"
	MysqlName     = "mysql-connection"
)

Variables

View Source
var (
	ERROR_CODE_INTERNAL     = "500"
	ERROR_CODE_NOT_FOUND    = "404"
	ERROR_CODE_INVALID_ARGS = "400"
)
View Source
var (
	ERROR_NOT_FILE       = errors.New("path not file")
	ERROR_PATH_NOT_FOUND = errors.New("path not exist")
	ERROR_DB             = errors.New("db error")
	ERROR_ARG_ID         = errors.New("id parse failed")
	ERROR_HOOK_NOT_FOUND = errors.New("hook not found")
	ERROR_LOCKED_DENIED  = errors.New("locked denied")
	ERROR_REPO_LOCKED    = errors.New("repo locked")
)

Functions

func AddHook

func AddHook(context *webcontext.Context)

func AddSystemHook

func AddSystemHook(context *webcontext.Context)

func Backup

func Backup(ctx *webcontext.Context)

Backup 添加到备份

func BackupList

func BackupList(ctx *webcontext.Context)

BackupList 获取备份列表

func BlameFile

func BlameFile(context *webcontext.Context)

BlameFile function

func CheckMergeStatus

func CheckMergeStatus(ctx *webcontext.Context)

func CloseMR

func CloseMR(ctx *webcontext.Context)

func Commit

func Commit(ctx *webcontext.Context)

func Compare

func Compare(ctx *webcontext.Context)

Compare 比较

func CreateCheckRun

func CreateCheckRun(ctx *webcontext.Context)

func CreateCommit

func CreateCommit(context *webcontext.Context)

CreateCommit 创建Commit

func CreateMergeRequest

func CreateMergeRequest(ctx *webcontext.Context)

func CreateNotes

func CreateNotes(ctx *webcontext.Context)

func CreateRepo

func CreateRepo(context *webcontext.Context)

CreateRepo function

func CreateRepoBranch

func CreateRepoBranch(context *webcontext.Context)

CreateRepoBranch 创建分支

func CreateRepoTag

func CreateRepoTag(context *webcontext.Context)

CreateRepoTag 创建tag

func DeleteBackup

func DeleteBackup(ctx *webcontext.Context)

DeleteBackup 删除备份

func DeleteHook

func DeleteHook(context *webcontext.Context)

func DeleteRepo

func DeleteRepo(context *webcontext.Context)

DeleteRepo 通过repoID删除关联仓库

func DeleteRepoBranch

func DeleteRepoBranch(context *webcontext.Context)

DeleteRepoBranch 删除分支

func DeleteRepoByApp

func DeleteRepoByApp(ctx *webcontext.Context)

DeleteRepoByApp 通过appID删除关联仓库

func DeleteRepoTag

func DeleteRepoTag(context *webcontext.Context)

DeleteRepoTag 删除tag

func DiffFile

func DiffFile(ctx *webcontext.Context)

func GetArchive

func GetArchive(ctx *webcontext.Context)

GetArchive 打包下载

func GetGoImportMeta

func GetGoImportMeta(ctx *webcontext.Context)

func GetHookDetail

func GetHookDetail(context *webcontext.Context)

func GetHooks

func GetHooks(context *webcontext.Context)

GetRepoStats function

func GetMergeRequestDetail

func GetMergeRequestDetail(ctx *webcontext.Context)

func GetMergeRequests

func GetMergeRequests(ctx *webcontext.Context)

func GetMergeTemplates

func GetMergeTemplates(ctx *webcontext.Context)

func GetRepoBlob

func GetRepoBlob(context *webcontext.Context)

GetRepoBlob function

func GetRepoBlobRange

func GetRepoBlobRange(context *webcontext.Context)

func GetRepoBranchDetail

func GetRepoBranchDetail(context *webcontext.Context)

GetRepoBranches function

func GetRepoBranches

func GetRepoBranches(context *webcontext.Context)

GetRepoBranches function

func GetRepoCommits

func GetRepoCommits(context *webcontext.Context)

GetRepoCommits function

func GetRepoHead

func GetRepoHead(context *webcontext.Context)

GetRepoHead function

func GetRepoInfoRefs

func GetRepoInfoRefs(c *webcontext.Context)

GetRepoInfoRefs function

func GetRepoObjects

func GetRepoObjects(c *webcontext.Context)

GetRepoObjects function

func GetRepoRaw

func GetRepoRaw(context *webcontext.Context)

GetRepoRaw function

func GetRepoStats

func GetRepoStats(context *webcontext.Context)

GetRepoStats function

func GetRepoTags

func GetRepoTags(context *webcontext.Context)

GetRepoTags function

func GetRepoTree

func GetRepoTree(context *webcontext.Context)

GetRepoTree function

func Health added in v1.1.0

func Health(ctx *webcontext.Context)

Health health check

func Merge

func Merge(ctx *webcontext.Context)

func MigrationNewAuth

func MigrationNewAuth(ctx *webcontext.Context)

func QueryCheckRuns

func QueryCheckRuns(ctx *webcontext.Context)

func QueryNotes

func QueryNotes(ctx *webcontext.Context)

func ReopenMR

func ReopenMR(ctx *webcontext.Context)

func RequeueTask

func RequeueTask(context *webcontext.Context)

func SearchRepoTree

func SearchRepoTree(ctx *webcontext.Context)

GetRepoTree function

func ServiceRepoRPC

func ServiceRepoRPC(c *webcontext.Context)

ServiceRepoRPC function

func SetLocked

func SetLocked(context *webcontext.Context)

SetLocked 仓库锁定

func SetRepoDefaultBranch

func SetRepoDefaultBranch(context *webcontext.Context)

SetRepoDefaultBranch 设置默认分支

func ShowCacheStats

func ShowCacheStats(context *webcontext.Context)

func UpdateHook

func UpdateHook(context *webcontext.Context)

func UpdateMergeRequest

func UpdateMergeRequest(ctx *webcontext.Context)

func UpdateRepoByApp

func UpdateRepoByApp(ctx *webcontext.Context)

CreateRepo function

Types

type CreateBranchRequest

type CreateBranchRequest struct {
	Name string `json:"name"`
	Ref  string `json:"ref"`
}

type CreateRepoRequest

type CreateRepoRequest struct {
	OrgID       int64             `json:"org_id"`
	ProjectID   int64             `json:"project_id"`
	AppID       int64             `json:"app_id"`
	OrgName     string            `json:"org_name"`
	ProjectName string            `json:"project_name"`
	AppName     string            `json:"app_name"`
	HostMode    string            `json:"host_mode"` //selfhost|external
	Config      map[string]string `json:"config"`
}

type CreateRepoResponseData

type CreateRepoResponseData struct {
	ID int64 `json:"id"`

	// 仓库相对路径
	RepoPath string `json:"repo_path"`
}

type CreateTagRequest

type CreateTagRequest struct {
	Name    string `json:"name"`
	Message string `json:"message"`
	Ref     string `json:"ref"`
}

type HookRequest

type HookRequest struct {
	Id         int64  `json:"id"`
	Url        string `json:"url"`
	Name       string `json:"name"`
	PushEvents bool   `json:"push_events"`
}

type Map

type Map map[string]interface{}

type MergeTemplatesResponseData

type MergeTemplatesResponseData struct {
	Branch string   `json:"branch"`
	Path   string   `json:"path"`
	Names  []string `json:"names"`
}

type PagingRequest

type PagingRequest struct {
	// +optional default 1
	PageNo int `json:"PageNo"`
	// +optional default 10
	PageSize int `json:"PageSize"`
}

分页查询

Jump to

Keyboard shortcuts

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