api

package
v0.15.1-beta5 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2023 License: Apache-2.0, MIT Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	TimeOut = 10 * time.Second
)

Variables

This section is empty.

Functions

func CreateTransformationRule added in v0.15.0

func CreateTransformationRule(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

CreateTransformationRule create transformation rule for Github @Summary create transformation rule for Github @Description create transformation rule for Github @Tags plugins/github @Accept application/json @Param transformationRule body models.GithubTransformationRule true "transformation rule" @Success 200 {object} models.GithubTransformationRule @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/transformation_rules [POST]

func DeleteConnection added in v0.12.0

func DeleteConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

@Summary delete a github connection @Description Delete a github connection @Tags plugins/github @Success 200 {object} models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/github/connections/{connectionId} [DELETE]

func GetConnection

func GetConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

@Summary get github connection detail @Description Get github connection detail @Tags plugins/github @Success 200 {object} models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/github/connections/{connectionId} [GET]

func GetScope added in v0.15.0

GetScope get one Github repo @Summary get one Github repo @Description get one Github repo @Tags plugins/github @Param connectionId path int true "connection ID" @Param repoId path int true "repo ID" @Success 200 {object} apiRepo @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scopes/{repoId} [GET]

func GetScopeList added in v0.15.0

func GetScopeList(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

GetScopeList get Github repos @Summary get Github repos @Description get Github repos @Tags plugins/github @Param connectionId path int true "connection ID" @Param pageSize query int false "page size, default 50" @Param page query int false "page size, default 1" @Success 200 {object} []apiRepo @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/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/github @Param id path int true "id" @Success 200 {object} models.GithubTransformationRule @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/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/github @Param pageSize query int false "page size, default 50" @Param page query int false "page size, default 1" @Success 200 {object} []models.GithubTransformationRule @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/transformation_rules [GET]

func Init added in v0.12.0

func Init(br core.BasicRes)

func ListConnections

func ListConnections(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

@Summary get all github connections @Description Get all github connections @Tags plugins/github @Success 200 {object} []models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/github/connections [GET]

func MakeDataSourcePipelinePlanV200 added in v0.15.0

func MakeDataSourcePipelinePlanV200(subtaskMetas []core.SubTaskMeta, connectionId uint64, bpScopes []*core.BlueprintScopeV200, syncPolicy *core.BlueprintSyncPolicy) (core.PipelinePlan, []core.Scope, errors.Error)

func MakePipelinePlan added in v0.12.0

func MakePipelinePlan(subtaskMetas []core.SubTaskMeta, connectionId uint64, scope []*core.BlueprintScopeV100) (core.PipelinePlan, errors.Error)

func MemorizedGetApiRepo added in v0.15.0

func MemorizedGetApiRepo(repo *tasks.GithubApiRepo, op *tasks.GithubOptions, apiClient helper.ApiClientGetter) (*tasks.GithubApiRepo, errors.Error)

func PatchConnection

func PatchConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

@Summary patch github connection @Description Patch github connection @Tags plugins/github @Param body body models.GithubConnection true "json body" @Success 200 {object} models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/github/connections/{connectionId} [PATCH]

func PostConnections added in v0.12.0

func PostConnections(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

@Summary create github connection @Description Create github connection @Tags plugins/github @Param body body models.GithubConnection true "json body" @Success 200 {object} models.GithubConnection @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/github/connections [POST]

func Proxy added in v0.15.0

func PutScope added in v0.15.0

PutScope create or update github repo @Summary create or update github repo @Description Create or update github repo @Tags plugins/github @Accept application/json @Param connectionId path int true "connection ID" @Param scope body req true "json" @Success 200 {object} []models.GithubRepo @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scopes [PUT]

func TestConnection

func TestConnection(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

@Summary test github connection @Description Test github Connection @Tags plugins/github @Param body body models.TestConnectionRequest true "json body" @Success 200 {object} GithubTestConnResponse @Failure 400 {string} errcode.Error "Bad Request" @Failure 500 {string} errcode.Error "Internel Error" @Router /plugins/github/test [POST]

func UpdateScope added in v0.15.0

func UpdateScope(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

UpdateScope patch to github repo @Summary patch to github repo @Description patch to github repo @Tags plugins/github @Accept application/json @Param connectionId path int true "connection ID" @Param repoId path int true "repo ID" @Param scope body models.GithubRepo true "json" @Success 200 {object} models.GithubRepo @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/connections/{connectionId}/scopes/{repoId} [PATCH]

func UpdateTransformationRule added in v0.15.0

func UpdateTransformationRule(input *core.ApiResourceInput) (*core.ApiResourceOutput, errors.Error)

UpdateTransformationRule update transformation rule for Github @Summary update transformation rule for Github @Description update transformation rule for Github @Tags plugins/github @Accept application/json @Param id path int true "id" @Param transformationRule body models.GithubTransformationRule true "transformation rule" @Success 200 {object} models.GithubTransformationRule @Failure 400 {object} shared.ApiBody "Bad Request" @Failure 500 {object} shared.ApiBody "Internal Error" @Router /plugins/github/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 GithubBlueprintSetting added in v0.14.0

type GithubBlueprintSetting []struct {
	Version     string `json:"version"`
	Connections []struct {
		Plugin       string `json:"plugin"`
		ConnectionID int    `json:"connectionId"`
		Scope        []struct {
			Transformation CodeTransformationRules `json:"transformation"`
			Options        struct {
				Owner string `json:"owner"`
				Repo  string `json:"repo"`
				Since string
			} `json:"options"`
			Entities []string `json:"entities"`
		} `json:"scope"`
	} `json:"connections"`
}

type GithubPipelinePlan added in v0.14.0

type GithubPipelinePlan [][]struct {
	Plugin   string   `json:"plugin"`
	Subtasks []string `json:"subtasks"`
	Options  struct {
		ConnectionID   int    `json:"connectionId"`
		Owner          string `json:"owner"`
		Repo           string `json:"repo"`
		Since          string
		Transformation CodeTransformationRules `json:"transformation"`
	} `json:"options"`
}

type GithubTestConnResponse added in v0.13.0

type GithubTestConnResponse struct {
	shared.ApiBody
	Login string `json:"login"`
}

Jump to

Keyboard shortcuts

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