Documentation
¶
Index ¶
- Constants
- func CreateOrg(ctx *gin.Context)
- func CreateProj(ctx *gin.Context)
- func CreateSource(ctx *gin.Context)
- func DeleteOrg(ctx *gin.Context)
- func DeleteProj(ctx *gin.Context)
- func DeleteSource(ctx *gin.Context)
- func GetOrg(ctx *gin.Context)
- func GetProj(ctx *gin.Context)
- func ListBranchesAndTags(ctx *gin.Context)
- func ListBranchesAndTagsFromGithub(src *repository.Source, accessToken string, perPage, page int) ([]string, []string, error)
- func ListCommits(ctx *gin.Context)
- func ListOrg(ctx *gin.Context)
- func ListPipelineTemplate(ctx *gin.Context)
- func ListProj(ctx *gin.Context)
- func ListUserInstallations(ctx *gin.Context)
- func RegisterControllerFromConfig(configFilePath string) map[string]rkentry.Entry
- func UpdateOrg(ctx *gin.Context)
- func UpdateProj(ctx *gin.Context)
- type Artifact
- type BootConfig
- type Commit
- type Controller
- type ControllerOption
- type CreateOrgResponse
- type CreateProjRequest
- type CreateProjResponse
- type CreateSourceRequest
- type CreateSourceResponse
- type DeleteOrgResponse
- type DeleteProjResponse
- type DeleteSourceResponse
- type GetOrgResponse
- type GetProjResponse
- type Installation
- type ListBranchesAndTagsResponse
- type ListCommitsResponse
- type ListOrgResponse
- type ListPipelineTemplateResponse
- type ListProjResponse
- type Org
- type PipelineTemplate
- type Proj
- type Repository
- type UpdateOrgRequest
- type UpdateOrgResponse
- type UpdateProjRequest
- type UpdateProjResponse
Constants ¶
const ( // EntryName name of entry EntryName = "ws-controller" // EntryType type of entry EntryType = "ws-controller" // EntryDescription description of entry EntryDescription = "Entry for controller entry." )
const ( PerPageDefault = 10 PageDefault = 1 )
Variables ¶
This section is empty.
Functions ¶
func CreateOrg ¶
CreateOrg @Summary Create organization @Id 3 @version 1.0 @Tags organization @produce application/json @Param orgName query string true "Organization name" @Success 200 {object} CreateOrgResponse @Router /v1/org [put]
func CreateProj ¶
CreateProj @Summary create project @Id 8 @version 1.0 @Tags project @produce application/json @Param project body CreateProjRequest true "Project" @Success 200 {object} CreateProjResponse @Router /v1/proj [put]
func CreateSource ¶
CreateSource @Summary create source @Id 11 @version 1.0 @Tags source @produce application/json @Param projId query int true "Project Id" @Param source body CreateSourceRequest true "Source" @Success 200 {object} CreateSourceResponse @Router /v1/source [put]
func DeleteOrg ¶
DeleteOrg @Summary Delete organization @Id 4 @version 1.0 @Tags organization @produce application/json @Param orgId path int true "Organization Id" @Success 200 {object} DeleteOrgResponse @Router /v1/org/{orgId} [delete]
func DeleteProj ¶
DeleteProj @Summary delete project @Id 9 @version 1.0 @Tags project @produce application/json @Param projId path int true "Project Id" @Success 200 {object} DeleteProjResponse @Router /v1/proj/{projId} [delete]
func DeleteSource ¶
DeleteSource @Summary delete source @Id 12 @version 1.0 @Tags source @produce application/json @Param sourceId path int true "Source Id" @Success 200 {object} DeleteProjResponse @Router /v1/source/{sourceId} [delete]
func GetOrg ¶
GetOrg @Summary Get organization @Id 2 @version 1.0 @Tags organization @produce application/json @Param orgId path int true "Organization Id" @Success 200 {object} GetOrgResponse @Router /v1/org/{orgId} [get]
func GetProj ¶
GetProj @Summary Get project @Id 7 @version 1.0 @Tags project @produce application/json @Param projId path int true "Project Id" @Success 200 {object} GetProjResponse @Router /v1/proj/{projId} [get]
func ListBranchesAndTags ¶
ListBranchesAndTags @Summary List branches and tags @Id 16 @version 1.0 @Tags installation @produce application/json @Param sourceId path int true "Source Id" @Param perPage query int false "Number of commits per page" @Param page query int false "Page number to fetch" @Success 200 @Router /v1/source/{sourceId}/branches [get]
func ListBranchesAndTagsFromGithub ¶
func ListBranchesAndTagsFromGithub(src *repository.Source, accessToken string, perPage, page int) ([]string, []string, error)
ListBranchesAndTagsFromGithub returns branches and taqs from github repository.
func ListCommits ¶
ListCommits @Summary List user installation commits @Id 15 @version 1.0 @Tags installation @produce application/json @Param sourceId path int true "Source Id" @Param branch query string true "Branch" @Param perPage query int false "Number of commits per page" @Param page query int false "Page number to fetch" @Success 200 @Router /v1/source/{sourceId}/commits [get]
func ListOrg ¶
ListOrg @Summary List organizations @Id 1 @version 1.0 @Tags organization @produce application/json @Success 200 {object} ListOrgResponse @Router /v1/org [get]
func ListPipelineTemplate ¶
ListPipelineTemplate @Summary List pipeline templates @Id 14 @version 1.0 @Tags pipeline @produce application/json @Success 200 {object} ListPipelineTemplateResponse @Router /v1/pipeline/template [get]
func ListProj ¶
ListProj @Summary List projects @Id 6 @version 1.0 @Tags project @produce application/json @Param orgId query int false "Organization Id" @Success 200 {object} ListProjResponse @Router /v1/proj [get]
func ListUserInstallations ¶
ListUserInstallations @Summary List user installations @Id 13 @version 1.0 @Tags installation @produce application/json @Param source query string true "Source" @Param user query string true "user" @Success 200 @Router /v1/user/installations [get]
func RegisterControllerFromConfig ¶
RegisterControllerFromConfig is an implementation of: type EntryRegFunc func(string) map[string]rkentry.Entry
func UpdateOrg ¶
UpdateOrg @Summary Update organization @Id 5 @version 1.0 @Tags organization @produce application/json @Param org body UpdateOrgRequest true "Organization" @Param orgId path int true "Organization Id" @Success 200 {object} UpdateOrgResponse @Router /v1/org/{orgId} [post]
func UpdateProj ¶
UpdateProj @Summary update project @Id 10 @version 1.0 @Tags project @produce application/json @Param projId path int true "Project Id" @Param project body UpdateProjRequest true "Project" @Success 200 {object} UpdateProjResponse @Router /v1/proj/{projId} [post]
Types ¶
type BootConfig ¶
type BootConfig struct { Controller struct { Enabled bool `yaml:"enabled" json:"enabled"` Logger struct { ZapLogger struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"zapLogger" json:"zapLogger"` EventLogger struct { Ref string `yaml:"ref" json:"ref"` } `yaml:"eventLogger" json:"eventLogger"` } `yaml:"logger" json:"logger"` } `yaml:"controller" json:"controller"` }
BootConfig is a struct which is for unmarshalled YAML
type Commit ¶
type Commit struct { Id string `yaml:"id" json:"id"` Url string `yaml:"url" json:"url"` Message string `yaml:"message" json:"message"` Date time.Time `yaml:"date" json:"date"` Committer string `yaml:"committer" json:"committer"` CommitterUrl string `yaml:"committerUrl" json:"committerUrl"` Artifact *Artifact `yaml:"artifact" json:"artifact"` }
func ListCommitsFromGithub ¶
func ListCommitsFromGithub(src *repository.Source, branch, accessToken string, perPage, page int) ([]*Commit, error)
ListCommitsFromGithub returns commits from remote github repository. The repos would have access permission with Github app named as workstation.
type Controller ¶
type Controller struct { EntryName string `json:"entryName" yaml:"entryName"` EntryType string `json:"entryType" yaml:"entryType"` EntryDescription string `json:"entryDescription" yaml:"entryDescription"` ZapLoggerEntry *rkentry.ZapLoggerEntry `json:"zapLoggerEntry" yaml:"zapLoggerEntry"` EventLoggerEntry *rkentry.EventLoggerEntry `json:"eventLoggerEntry" yaml:"eventLoggerEntry"` Repo repository.Repository `json:"repository" yaml:"repository"` }
Controller performs as manager of project and organizations
func RegisterController ¶
func RegisterController(opts ...ControllerOption) *Controller
RegisterController will register Entry into GlobalAppCtx
func (*Controller) GetDescription ¶
func (con *Controller) GetDescription() string
GetDescription returns entry description
func (*Controller) GetType ¶
func (con *Controller) GetType() string
GetType returns entry type as project
type ControllerOption ¶
type ControllerOption func(*Controller)
ControllerOption will be extended in future.
type CreateOrgResponse ¶
type CreateOrgResponse struct {
OrgId int `yaml:"orgId" json:"orgId"`
}
CreateOrgResponse response of create organization
type CreateProjRequest ¶
type CreateProjRequest struct { OrgId int `yaml:"orgId" json:"orgId"` OrgName string `yaml:"orgName" json:"orgName"` Name string `yaml:"name" json:"name"` }
CreateProjRequest request body
type CreateProjResponse ¶
type CreateProjResponse struct { OrgId int `yaml:"orgId" json:"orgId"` ProjId int `yaml:"projId" json:"projId"` }
CreateProjResponse response of create project
type CreateSourceRequest ¶
type CreateSourceRequest struct { Type string `yaml:"type" json:"type"` Repository string `yaml:"repository" json:"repository"` }
CreateSourceRequest request body
type CreateSourceResponse ¶
type CreateSourceResponse struct { ProjId int `yaml:"projId" json:"projId"` SourceId int `yaml:"sourceId" json:"sourceId"` }
CreateSourceResponse response of create source
type DeleteOrgResponse ¶
type DeleteOrgResponse struct {
Status bool `yaml:"status" json:"status"`
}
DeleteOrgResponse response of delete organization
type DeleteProjResponse ¶
type DeleteProjResponse struct {
Status bool `yaml:"status" json:"status"`
}
DeleteProjResponse response of delete project
type DeleteSourceResponse ¶
type DeleteSourceResponse struct {
Status bool `yaml:"status" json:"status"`
}
DeleteSourceResponse response of delete source
type GetOrgResponse ¶
type GetOrgResponse struct {
Org *Org `yaml:"org" json:"org"`
}
GetOrgResponse response of get organization
type GetProjResponse ¶
type GetProjResponse struct {
Proj *Proj `yaml:"proj" json:"proj"`
}
GetProjResponse response of get project
type Installation ¶
type Installation struct { RepoSource string `yaml:"repoSource" json:"repoSource"` Organization string `yaml:"organization" json:"organization"` AvatarUrl string `yaml:"avatarUrl" json:"avatarUrl"` Repos []*Repository `yaml:"repos" json:"repos"` }
func ListUserInstallationsFromGithub ¶
func ListUserInstallationsFromGithub(user string) ([]*Installation, error)
ListUserInstallations returns repositories from code repo created by user. The repos would have access permission with Github app named as workstation.
type ListCommitsResponse ¶
type ListCommitsResponse struct {
Commits []*Commit `yaml:"commits" json:"commits"`
}
ListCommitsResponse response of user commits of source
type ListOrgResponse ¶
type ListOrgResponse struct {
OrgList []*Org `yaml:"orgList" json:"orgList"`
}
ListOrgResponse response of list organization
type ListPipelineTemplateResponse ¶
type ListPipelineTemplateResponse struct {
TemplateList []*PipelineTemplate `yaml:"templateList" json:"templateList"`
}
ListPipelineTemplateResponse response of list organization
type ListProjResponse ¶
type ListProjResponse struct {
ProjList []*Proj `yaml:"projList" json:"projList"`
}
ListProjResponse response of list projects
type Org ¶
type Org struct { Meta *repository.Org `yaml:"meta" json:"meta"` ProjIds []int `yaml:"projIds" json:"projIds"` }
Org is model for API response
type PipelineTemplate ¶
type PipelineTemplate struct {
Meta *repository.PipelineTemplate `yaml:"meta" json:"meta"`
}
PipelineTemplate is model for API response
type Proj ¶
type Proj struct {
Meta *repository.Proj `yaml:"meta" json:"meta"`
}
Proj is model for API response
type Repository ¶
type UpdateOrgRequest ¶
type UpdateOrgRequest struct {
Name string `yaml:"name" json:"name"`
}
UpdateOrgRequest request body of update organization
type UpdateOrgResponse ¶
type UpdateOrgResponse struct {
Status bool `yaml:"status" json:"status"`
}
UpdateOrgResponse response of update organization
type UpdateProjRequest ¶
type UpdateProjRequest struct {
Name string `yaml:"name" json:"name"`
}
UpdateProjRequest request body
type UpdateProjResponse ¶
type UpdateProjResponse struct {
Status bool `yaml:"status" json:"status"`
}
UpdateProjResponse response of update project