Documentation ¶
Index ¶
- Constants
- Variables
- func CreateTransformationRule(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func DeleteConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func GetConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func GetScope(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func GetScopeList(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func GetTransformationRule(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func GetTransformationRuleList(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func Init(config *viper.Viper, logger core.Logger, database *gorm.DB)
- func ListConnections(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func MakeDataSourcePipelinePlanV200(connectionId uint64, scopes []*core.BlueprintScopeV200) (pp core.PipelinePlan, sc []core.Scope, err errors.Error)
- func MakePipelinePlan(subtaskMetas []core.SubTaskMeta, connectionId uint64, ...) (core.PipelinePlan, errors.Error)
- func PatchConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func PostConnections(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func PostGitlabPipeline(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func Proxy(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func PutScope(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func TestConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func UpdateScope(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- func UpdateTransformationRule(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
- type CodeTransformationRules
- type GitlabBlueprintSetting
- type GitlabPipelinePlan
Constants ¶
const (
TimeOut = 10 * time.Second
)
Variables ¶
var BasicRes core.BasicRes
Functions ¶
func CreateTransformationRule ¶ added in v0.15.0
func CreateTransformationRule(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
CreateTransformationRule create transformation rule for Gitlab @Summary create transformation rule for Gitlab @Description create transformation rule for Gitlab @Tags plugins/gitlab @Accept application/json @Param transformationRule body models.GitlabTransformationRule true "transformation rule" @Success 200 {object} models.GitlabTransformationRule @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/transformation_rules [POST]
func DeleteConnection ¶ added in v0.12.0
func DeleteConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
@Summary delete a gitlab connection @Description Delete a gitlab connection @Tags plugins/gitlab @Success 200 {object} models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/gitlab/connections/{connectionId} [DELETE]
func GetConnection ¶
func GetConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
@Summary get gitlab connection detail @Description Get gitlab connection detail @Tags plugins/gitlab @Success 200 {object} models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/gitlab/connections/{connectionId} [GET]
func GetScope ¶ added in v0.15.0
func GetScope(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
GetScope get one Gitlab project @Summary get one Gitlab project @Description get one Gitlab project @Tags plugins/gitlab @Param connectionId path int false "connection ID" @Param projectId path int false "project ID" @Param pageSize query int false "page size, default 50" @Param page query int false "page size, default 1" @Success 200 {object} models.GitlabProject @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes/{projectId} [GET]
func GetScopeList ¶ added in v0.15.0
func GetScopeList(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
GetScopeList get Gitlab projects @Summary get Gitlab projects @Description get Gitlab projects @Tags plugins/gitlab @Param connectionId path int false "connection ID" @Success 200 {object} []models.GitlabProject @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes/ [GET]
func GetTransformationRule ¶ added in v0.15.0
func GetTransformationRule(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
GetTransformationRule return one transformation rule @Summary return one transformation rule @Description return one transformation rule @Tags plugins/gitlab @Param id path int true "id" @Success 200 {object} models.GitlabTransformationRule @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/transformation_rules/{id} [GET]
func GetTransformationRuleList ¶ added in v0.15.0
func GetTransformationRuleList(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
GetTransformationRuleList return all transformation rules @Summary return all transformation rules @Description return all transformation rules @Tags plugins/gitlab @Param pageSize query int false "page size, default 50" @Param page query int false "page size, default 1" @Success 200 {object} []models.GitlabTransformationRule @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/transformation_rules [GET]
func ListConnections ¶
func ListConnections(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
@Summary get all gitlab connections @Description Get all gitlab connections @Tags plugins/gitlab @Success 200 {object} []models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/gitlab/connections [GET]
func MakeDataSourcePipelinePlanV200 ¶
func MakeDataSourcePipelinePlanV200(connectionId uint64, scopes []*core.BlueprintScopeV200) (pp core.PipelinePlan, sc []core.Scope, err errors.Error)
func MakePipelinePlan ¶ added in v0.12.0
func MakePipelinePlan(subtaskMetas []core.SubTaskMeta, connectionId uint64, scope []*core.BlueprintScopeV100) (core.PipelinePlan, errors.Error)
func PatchConnection ¶
func PatchConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
@Summary patch gitlab connection @Description Patch gitlab connection @Tags plugins/gitlab @Param body body models.GitlabConnection true "json body" @Success 200 {object} models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/gitlab/connections/{connectionId} [PATCH]
func PostConnections ¶ added in v0.12.0
func PostConnections(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
@Summary create gitlab connection @Description Create gitlab connection @Tags plugins/gitlab @Param body body models.GitlabConnection true "json body" @Success 200 {object} models.GitlabConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/gitlab/connections [POST]
func PostGitlabPipeline ¶ added in v0.13.0
func PostGitlabPipeline(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
@Summary pipelines plan for gitlab @Description pipelines plan for gitlab @Tags plugins/gitlab @Accept application/json @Param blueprint body GitlabPipelinePlan true "json" @Router /pipelines/gitlab/pipeline-plan [post]
func Proxy ¶ added in v0.13.0
func Proxy(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
func PutScope ¶ added in v0.15.0
func PutScope(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
PutScope create or update gitlab project @Summary create or update gitlab project @Description Create or update gitlab project @Tags plugins/gitlab @Accept application/json @Param connectionId path int false "connection ID" @Param scope body req true "json" @Success 200 {object} []models.GitlabProject @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes [PUT]
func TestConnection ¶
func TestConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
@Summary test gitlab connection @Description Test gitlab Connection @Tags plugins/gitlab @Param body body models.TestConnectionRequest true "json body" @Success 200 {object} shared.ApiBody "Success" @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/gitlab/test [POST]
func UpdateScope ¶ added in v0.15.0
func UpdateScope(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
UpdateScope patch to gitlab project @Summary patch to gitlab project @Description patch to gitlab project @Tags plugins/gitlab @Accept application/json @Param connectionId path int false "connection ID" @Param projectId path int false "project ID" @Param scope body models.GitlabProject true "json" @Success 200 {object} models.GitlabProject @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/connections/{connectionId}/scopes/{projectId} [PATCH]
func UpdateTransformationRule ¶ added in v0.15.0
func UpdateTransformationRule(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)
UpdateTransformationRule update transformation rule for Gitlab @Summary update transformation rule for Gitlab @Description update transformation rule for Gitlab @Tags plugins/gitlab @Accept application/json @Param id path int true "id" @Param transformationRule body models.GitlabTransformationRule true "transformation rule" @Success 200 {object} models.GitlabTransformationRule @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/gitlab/transformation_rules/{id} [PATCH]
Types ¶
type CodeTransformationRules ¶ added in v0.14.0
type CodeTransformationRules struct { PrType string `mapstructure:"prType" json:"prType"` PrComponent string `mapstructure:"prComponent" json:"prComponent"` PrBodyClosePattern string `mapstructure:"prBodyClosePattern" json:"prBodyClosePattern"` IssueSeverity string `mapstructure:"issueSeverity" json:"issueSeverity"` IssuePriority string `mapstructure:"issuePriority" json:"issuePriority"` IssueComponent string `mapstructure:"issueComponent" json:"issueComponent"` IssueTypeBug string `mapstructure:"issueTypeBug" json:"issueTypeBug"` IssueTypeIncident string `mapstructure:"issueTypeIncident" json:"issueTypeIncident"` IssueTypeRequirement string `mapstructure:"issueTypeRequirement" json:"issueTypeRequirement"` }
type GitlabBlueprintSetting ¶ added in v0.14.0
type GitlabBlueprintSetting []struct { Version string `json:"version"` Connections []struct { Plugin string `json:"plugin"` ConnectionID int `json:"connectionId"` Scope []struct { Transformation CodeTransformationRules `json:"transformation"` Options struct { ProjectId int `json:"projectId"` Since string } `json:"options"` Entities []string `json:"entities"` } `json:"scope"` } `json:"connections"` }