gittar

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GITTAR_ARCHIVE = apis.ApiSpec{
	Path:        "/api/gittar/<org>/<repo>/archive/<*>",
	BackendPath: "/<org>/<repo>/archive/<*>",
	Host:        "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	Doc:         `summary: 获取压缩包`,
}
View Source
var GITTAR_BLAME = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/blame/<*>",
	BackendPath:  "/<org>/<repo>/blame/<*>",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarBlameResponse{},
	Doc:          `summary: 获取文件blame信息`,
}
View Source
var GITTAR_BLOB = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/blob/<*>",
	BackendPath:  "/<org>/<repo>/blob/<*>",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	ResponseType: apistructs.GittarBlobResponse{},
	IsOpenAPI:    true,
	Doc:          `summary: 获取git仓库文件`,
}
View Source
var GITTAR_BRANCH = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/branches",
	BackendPath:  "/<org>/<repo>/branches",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarBranchesResponse{},
	Doc:          `summary: 获取git仓库分支`,
}
View Source
var GITTAR_BRANCH_CREATE = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/branches",
	BackendPath:  "/<org>/<repo>/branches",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GittarCreateBranchRequest{},
	ResponseType: apistructs.GittarCreateBranchResponse{},
	Doc:          `summary: 创建分支`,
}
View Source
var GITTAR_BRANCH_DELETE = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/branches/<*>",
	BackendPath:  "/<org>/<repo>/branches/<*>",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarDeleteBranchResponse{},
	Doc:          `summary: 删除分支`,
}
View Source
var GITTAR_CHECK_RUN_CREATE = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/check-runs",
	BackendPath:  "/<org>/<repo>/check-runs",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.CheckRun{},
	ResponseType: apistructs.CreateCheckRunResponse{},
	Doc:          `summary: 创建check run纪录`,
}
View Source
var GITTAR_CHECK_RUN_QUERY = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/check-runs",
	BackendPath:  "/<org>/<repo>/check-runs",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.CheckRun{},
	ResponseType: apistructs.CreateCheckRunResponse{},
	Doc:          `summary: 查询check run纪录`,
}
View Source
var GITTAR_COMMIT = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/commit/<*>",
	BackendPath:  "/<org>/<repo>/commit/<*>",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarCommitResponse{},
	Doc:          `summary: 获取git commit详情`,
}
View Source
var GITTAR_COMMITS = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/commits/<*>",
	BackendPath:  "/<org>/<repo>/commits/<*>",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GittarCommitsRequest{},
	ResponseType: apistructs.GittarCommitsResponse{},
	Doc:          `summary: 获取git 指定分支,tag的commits`,
}
View Source
var GITTAR_COMMITS_CREATE = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/commits",
	BackendPath:  "/<org>/<repo>/commits",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GittarCreateCommitRequest{},
	ResponseType: apistructs.GittarCreateCommitResponse{},
	Doc:          `summary: 创建git commit`,
}
View Source
var GITTAR_COMPARE = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/compare/<*>",
	BackendPath:  "/<org>/<repo>/compare/<*>",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarCompareResponse{},
	Doc:          `summary: 比较两个git分支差异`,
}
View Source
var GITTAR_MERGE_ACTION_POST = apis.ApiSpec{
	Path:        "/api/gittar/<org>/<repo>/merge-requests/<id>/<action>",
	BackendPath: "/<org>/<repo>/merge-requests/<id>/<action>",
	Host:        "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	Doc:         `summary: MR变更操作`,
}
View Source
var GITTAR_MERGE_ACTION_QUERY = apis.ApiSpec{
	Path:        "/api/gittar/<org>/<repo>/merge-requests/<id>/<action>",
	BackendPath: "/<org>/<repo>/merge-requests/<id>/<action>",
	Host:        "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	Doc:         `summary: MR变更操作查询`,
}
View Source
var GITTAR_MERGE_CREATE = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/merge-requests",
	BackendPath:  "/<org>/<repo>/merge-requests",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GittarCreateMergeRequest{},
	ResponseType: apistructs.GittarCreateMergeResponse{},
	Doc:          `summary: 创建MR`,
}
View Source
var GITTAR_MERGE_GET = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/merge-requests/<id>",
	BackendPath:  "/<org>/<repo>/merge-requests/<id>",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarQueryMrDetailResponse{},
	Doc:          `summary: MR 详情查看`,
}
View Source
var GITTAR_MERGE_QUERY = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/merge-requests",
	BackendPath:  "/<org>/<repo>/merge-requests",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GittarQueryMrRequest{},
	ResponseType: apistructs.GittarQueryMrResponse{},
	Doc:          `summary: MR 查询`,
}
View Source
var GITTAR_MERGE_STATS = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/merge-stats",
	BackendPath:  "/<org>/<repo>/merge-stats",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	IsOpenAPI:    true,
	CheckLogin:   true,
	RequestType:  apistructs.GittarMergeStatusRequest{},
	ResponseType: apistructs.GittarMergeStatusResponse{},
	Doc:          `summary: mr状态检测`,
}
View Source
var GITTAR_MR_TEMPLATES = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/merge-templates",
	BackendPath:  "/<org>/<repo>/merge-templates",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarMergeTemplatesResponse{},
	Doc:          `summary: 获取mr模板信息`,
}
View Source
var GITTAR_RAW = apis.ApiSpec{
	Path:        "/api/gittar/<org>/<repo>/raw/<*>",
	BackendPath: "/<org>/<repo>/raw/<*>",
	Host:        "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	IsOpenAPI:   true,
	Doc:         `summary: 获取git仓库指定路基原始文件`,
}
View Source
var GITTAR_REPO_STATS = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/stats/<*>",
	BackendPath:  "/<org>/<repo>/stats/<*>",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarStatsResponse{},
	Doc:          `summary: 获取git仓库指定分支信息`,
}
View Source
var GITTAR_REPO_STATS_DEFAULT = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/stats",
	BackendPath:  "/<org>/<repo>/stats",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarStatsResponse{},
	Doc:          `summary: 获取git仓库默认分支信息`,
}
View Source
var GITTAR_TAG = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/tags",
	BackendPath:  "/<org>/<repo>/tags",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarTagsResponse{},
	Doc:          `summary: 获取git仓库tag列表`,
}
View Source
var GITTAR_TAG_CREATE = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/tags",
	BackendPath:  "/<org>/<repo>/tags",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "POST",
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GittarCreateTagRequest{},
	ResponseType: apistructs.GittarCreateTagResponse{},
	Doc:          `summary: 创建tag`,
}
View Source
var GITTAR_TAG_DELETE = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/tags/<*>",
	BackendPath:  "/<org>/<repo>/tags/<*>",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "DELETE",
	CheckLogin:   true,
	IsOpenAPI:    true,
	ResponseType: apistructs.GittarDeleteResponse{},
	Doc:          `summary: 删除 tag`,
	Audit: func(ctx *spec.AuditContext) error {
		var responseBody apistructs.GittarDeleteResponse
		if err := ctx.BindResponseData(&responseBody); err != nil {
			return err
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.SysScope,
			ScopeID:      1,
			OrgID:        uint64(ctx.OrgID),
			TemplateName: apistructs.DeleteTagTemplate,
		})
	},
}
View Source
var GITTAR_TREE = apis.ApiSpec{
	Path:        "/api/gittar/<org>/<repo>/tree/<*>",
	BackendPath: "/<org>/<repo>/tree/<*>",
	Host:        "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	IsOpenAPI:   true,

	Doc: `summary: 获取git仓库目录信息`,
}
View Source
var GITTAR_TREE_SEARCH = apis.ApiSpec{
	Path:         "/api/gittar/<org>/<repo>/tree-search",
	BackendPath:  "/<org>/<repo>/tree-search",
	Host:         "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:       "http",
	Method:       "GET",
	CheckLogin:   true,
	IsOpenAPI:    true,
	RequestType:  apistructs.GittarTreeSearchRequest{},
	ResponseType: apistructs.GittarTreeSearchResponse{},
	Doc:          `summary: 搜索文件`,
}
View Source
var REPO_DELETE = apis.ApiSpec{
	Path:        "/api/repo/<*>",
	BackendPath: "/wb/<*>",
	Host:        "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:      "http",
	Method:      "DELETE",
	CheckLogin:  true,
	IsOpenAPI:   true,
	CheckToken:  true,
	Doc:         `summary: repo delete api proxy`,
	Audit: func(ctx *spec.AuditContext) error {
		var responseBody apistructs.GittarDeleteResponse
		if err := ctx.BindResponseData(&responseBody); err != nil {
			return err
		}
		if responseBody.Data.Event != apistructs.DeleteTagTemplate && responseBody.Data.Event != apistructs.DeleteBranchTemplate {
			return nil
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.AppScope,
			ScopeID:      1,
			OrgID:        uint64(ctx.OrgID),
			TemplateName: responseBody.Data.Event,
			AppID:        uint64(responseBody.Data.AppID),
			ProjectID:    uint64(responseBody.Data.ProjectID),
			Context: map[string]interface{}{
				"name":      responseBody.Data.Name,
				"appName":   responseBody.Data.AppName,
				"appId":     responseBody.Data.AppID,
				"projectId": responseBody.Data.ProjectID,
			},
		})
	},
}
View Source
var REPO_GET = apis.ApiSpec{
	Path:        "/api/repo/<*>",
	BackendPath: "/wb/<*>",
	Host:        "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:      "http",
	Method:      "GET",
	CheckLogin:  true,
	IsOpenAPI:   true,
	CheckToken:  true,
	Doc:         `summary: repo delete api proxy`,
}
View Source
var REPO_POST = apis.ApiSpec{
	Path:        "/api/repo/<*>",
	BackendPath: "/wb/<*>",
	Host:        "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:      "http",
	Method:      "POST",
	CheckLogin:  true,
	IsOpenAPI:   true,
	CheckToken:  true,
	Doc:         `summary: repo delete api proxy`,
	Audit: func(ctx *spec.AuditContext) error {
		var responseBody apistructs.LockedRepoResponse
		if err := ctx.BindResponseData(&responseBody); err != nil {
			return err
		}
		if responseBody.Data.AppName == "" {
			return nil
		}
		return ctx.CreateAudit(&apistructs.Audit{
			ScopeType:    apistructs.AppScope,
			ScopeID:      1,
			OrgID:        uint64(ctx.OrgID),
			TemplateName: apistructs.RepoLockedTemplate,
			AppID:        uint64(responseBody.Data.AppID),
			ProjectID:    uint64(responseBody.Data.ProjectID),
			Context: map[string]interface{}{
				"appName":   responseBody.Data.AppName,
				"isLocked":  strconv.FormatBool(responseBody.Data.IsLocked),
				"appId":     responseBody.Data.AppID,
				"projectId": responseBody.Data.ProjectID,
			},
		})
	},
}
View Source
var REPO_PUT = apis.ApiSpec{
	Path:        "/api/repo/<*>",
	BackendPath: "/wb/<*>",
	Host:        "gittar.marathon.l4lb.thisdcos.directory:5566",
	Scheme:      "http",
	Method:      "PUT",
	CheckLogin:  true,
	IsOpenAPI:   true,
	CheckToken:  true,
	Doc:         `summary: repo delete api proxy`,
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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