Documentation
¶
Index ¶
- Constants
- func About(c *gin.Context)
- func CreatePipelineReport(c *gin.Context)
- func DeleteConfigCondition(c *gin.Context)
- func DeleteConfigSource(c *gin.Context)
- func DeleteConfigTarget(c *gin.Context)
- func DeletePipelineReport(c *gin.Context)
- func GetPipelineReportByID(c *gin.Context)
- func Landing(c *gin.Context)
- func ListConfigConditions(c *gin.Context)
- func ListConfigSources(c *gin.Context)
- func ListConfigTargets(c *gin.Context)
- func ListLabels(c *gin.Context)
- func ListPipelineReports(c *gin.Context)
- func ListSCMs(c *gin.Context)
- func Ping(c *gin.Context)
- func SearchConfigConditions(c *gin.Context)
- func SearchConfigKinds(c *gin.Context)
- func SearchConfigSources(c *gin.Context)
- func SearchConfigTargets(c *gin.Context)
- func SearchLabels(c *gin.Context)
- func SearchPipelineReports(c *gin.Context)
- func SearchSCMs(c *gin.Context)
- func UpdatePipelineReport(c *gin.Context)
- type AboutResponseModel
- type AuthOptions
- type ConditionConfigResponse
- type ConfigKindResponse
- type CreatePipelineReportResponse
- type CustomClaims
- type DefaultResponseModel
- type FindSCMSummaryResponse
- type GetPipelineReportByIDResponse
- type GetPipelineReportsResponse
- type Interceptor
- type ListLabelKeyOnlyResponse
- type ListLabelsResponse
- type ListSCMsResponse
- type OauthOptions
- type Options
- type SearchSCMsRequest
- type Server
- type SourceConfigResponse
- type TargetConfigResponse
- type ZitadelOptions
Constants ¶
const ( // VisibilityPublic indicates a public API VisibilityPublic string = "public" // VisibilityPrivate indicates a private API VisibilityPrivate string = "private" // visibilityDefault indicate Default visibility VisibilityDefault = VisibilityPublic // ModeZitadel indicates Zitadel authentication ModeZitadel = "zitadel" // ModeOauth indicates Oauth authentication ModeOauth = "oauth" // ModeNone indicates no authentication ModeNone = "none" )
Variables ¶
This section is empty.
Functions ¶
func About ¶
About returns the version information of the API. @Summary About the API @Description Get version information of the API @Tags About @Success 200 {object} AboutResponseModel
func CreatePipelineReport ¶
CreatePipelineReport insert a new report into the database @Summary Create a new pipeline report @Description Create a new pipeline report in the database @Tags Pipeline Reports @Accept json @Produce json @Success 201 {object} CreatePipelineReportResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/reports [post]
func DeleteConfigCondition ¶ added in v0.9.0
DeleteConfigCondition deletes a resource configuration from the database. @Summary Delete a configuration condition @Description Delete a configuration condition from the database @Tags Configuration Conditions @Param id query string true "ID of the configuration condition to delete" @Success 200 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/conditions [delete]
func DeleteConfigSource ¶ added in v0.9.0
DeleteConfigSource deletes a resource configuration from the database. @Summary Delete a configuration source @Description Delete a configuration source from the database @Tags Configuration Sources @Param id query string true "ID of the configuration source to delete" @Success 200 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/sources [delete]
func DeleteConfigTarget ¶ added in v0.9.0
DeleteConfigTarget deletes a resource configuration from the database. @Summary Delete a configuration target @Description Delete a configuration target from the database @Tags Configuration Targets @Param id query string true "ID of the configuration target to delete" @Success 200 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/targets [delete]
func DeletePipelineReport ¶
DeletePipelineReport removes a pipeline report from the database @Summary Delete a pipeline report @Description Delete a pipeline report from the database @Tags Pipeline Reports @Param id path string true "Report ID" @Success 200 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/reports/{id} [delete]
func GetPipelineReportByID ¶ added in v0.9.0
GetPipelineReportByID returns the latest pipeline report for a specific ID @Summary Get a pipeline report by ID @Description Get the latest pipeline report for a specific ID @Tags Pipeline Reports @Param id path string true "Report ID" @Success 200 {object} GetPipelineReportByIDResponse @Failure 404 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/reports/{id} [get]
func Landing ¶
Landing is the landing page handler. @Summary Landing page @Description Landing page of the API @Tags Landing @Success 200 @Router /api/ [get]
func ListConfigConditions ¶ added in v0.9.0
ListConfigConditions returns condition configurations from the database. @Summary List all configuration conditions @Description List all configuration conditions from the database @Tags Configuration Conditions @Param id query string false "ID of the configuration condition" @Param kind query string false "Kind of the configuration condition" @Param config query string false "Configuration of the condition" @Param limit query string false "Limit the number of reports returned, default is 100" @Param page query string false "Page number for pagination, default is 1" @Success 200 {object} ConditionConfigResponse @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/conditions [get]
func ListConfigSources ¶ added in v0.9.0
ListConfigSources returns a resource configuration from the database. @Summary List all configuration sources @Description List all configuration sources from the database @Tags Configuration Sources @Param id query string false "ID of the configuration source" @Param kind query string false "Kind of the configuration source" @Param config query string false "Configuration of the source" @Param limit query string false "Limit the number of reports returned, default is 100" @Param page query string false "Page number for pagination, default is 1" @Success 200 {object} SourceConfigResponse @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/sources [get]
func ListConfigTargets ¶ added in v0.9.0
ListConfigTargets returns target configurations from the database. @Summary List all target configurations. @Description List all configuration targets from the database @Tags Configuration Targets @Param id query string false "ID of the configuration target" @Param kind query string false "Kind of the configuration target" @Param config query string false "Configuration of the target" @Param limit query string false "Limit the number of reports returned, default is 100" @Param page query string false "Page number for pagination, default is 1" @Success 200 {object} TargetConfigResponse @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/targets [get]
func ListLabels ¶ added in v0.14.0
ListLabels returns a list of labels from the database. @Summary List labels @Description List labels data from the database with optional filtering @Tags Labels @Param id query string false "Filter by label ID" @Param key query string false "Filter by label key" @Param value query string false "Filter by label value" @Param keyonly query string false "Return only unique label keys (true/false)" @Param limit query string false "Limit the number of labels returned, default is 100" @Param page query string false "Page number for pagination, default is 1" @Param start_time query string false "Start time for filtering labels (RFC3339 format)" @Param end_time query string false "End time for filtering labels (RFC3339 format)" @Success 200 {object} ListLabelsResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/labels [get]
func ListPipelineReports ¶ added in v0.9.0
ListPipelineReports returns all pipeline reports from the database @Summary List all pipeline reports @Description List all pipeline reports from the database @Tags Pipeline Reports @Param scmid query string false "SCM ID" @Param limit query string false "Limit the number of reports returned, default is 100" @Param page query string false "Page number for pagination, default is 1" @Param start_time query string false "Start time for filtering reports (RFC3339 format)" @Param end_time query string false "End time for filtering reports (RFC3339 format)" @Accept json @Produce json @Success 200 {object} GetPipelineReportsResponse @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/reports [get]
func ListSCMs ¶ added in v0.9.0
ListSCMs returns a list of SCMs from the database. @Summary List SCMs @Description List SCMs data from the database @Tags SCMs @Param scmid query string false "ID of the SCM" @Param url query string false "URL of the SCM" @Param branch query string false "Branch of the SCM" @Param summary query bool false "Return a summary of the SCMs" @Param limit query string false "Limit the number of reports returned, default is 100" @Param page query string false "Page number for pagination, default is 1" @Param start_time query string false "Start time for filtering SCMs (RFC3339 format)" @Param end_time query string false "End time for filtering SCMs (RFC3339 format)" @Success 200 {object} ListSCMsResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/scms [get]
func Ping ¶
Ping is a simple endpoint to check if the server is running. @Summary Ping the API @Description Ping the API to check if it's running @Tags Ping @Success 200 {object} DefaultResponseModel @Router /api/ping [get]
func SearchConfigConditions ¶ added in v0.9.0
SearchConfigConditions returns condition configurations from the database. @Summary Search configuration conditions @Description Search for configuration conditions in the database @Tags Configuration Conditions @Accept json @Produce json @Success 200 {object} ConditionConfigResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/conditions/search [post]
func SearchConfigKinds ¶ added in v0.9.0
SearchConfigKinds returns a resource configuration from the database. @Summary Search configuration by kind @Description Search for configuration by kind in the database @Tags Configuration @Accept json @Produce json @Success 200 {object} ConfigKindResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/kinds [post]
func SearchConfigSources ¶ added in v0.9.0
SearchConfigSources returns a resource configuration from the database. @Summary Search configuration sources @Description Search for configuration sources in the database @Tags Configuration Sources @Accept json @Produce json @Success 200 {object} SourceConfigResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/sources/search [post]
func SearchConfigTargets ¶ added in v0.9.0
SearchConfigTargets returns target configurations from the database. @Summary Search configuration targets @Description Search for configuration targets in the database @Tags Configuration Targets @Accept json @Produce json @Success 200 {object} TargetConfigResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/targets/search [post]
func SearchLabels ¶ added in v0.14.0
SearchLabels searches labels from the database using advanced filtering @Summary Search labels @Description Search labels in the database using advanced filtering @Param body body queryData true "Search parameters" @Tags Labels @Accept json @Produce json @Success 200 {object} ListLabelsResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/labels/search [post]
func SearchPipelineReports ¶ added in v0.9.0
SearchPipelineReports returns all pipeline reports from the database using advanced filtering @Summary Search pipeline reports @Description Search pipeline reports in the database using advanced filtering @Param limit query string false "Limit the number of reports returned, default is 100" @Param page query string false "Page number for pagination, default is 1" @Tags Pipeline Reports @Accept json @Produce json @Success 200 {object} GetPipelineReportsResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/reports/search [post]
func SearchSCMs ¶ added in v0.14.0
SearchSCMs searches SCMs using JSON filters. @Summary Search SCMs @Description Search SCM data using JSON filters. When summary is true, the response contains SCM summary data for all matching SCMs. @Tags SCMs @Accept json @Produce json @Param body body SearchSCMsRequest true "SCM search filters" @Success 200 {object} ListSCMsResponse @Failure 400 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/scms/search [post]
func UpdatePipelineReport ¶
UpdatePipelineReport updates a pipeline report in the database Note: This endpoint is not supported yet. @Summary Update a pipeline report @Description Update a pipeline report in the database. Please note that this endpoint is not supported yet. @Tags Pipeline Reports @Param id path string true "Report ID" @Accept json @Produce json @Success 200 {object} DefaultResponseModel @Router /api/pipeline/reports/{id} [put]
Types ¶
type AboutResponseModel ¶ added in v0.9.0
type AuthOptions ¶
type AuthOptions struct {
// Mode enable auth0 authentication
// Accepted values are: "auth0", "zitadel", "none"
// Default to "none"
Mode string
// Zitadel holds Zitadel specific options
Zitadel ZitadelOptions
// Oauth holds Oauth specific options
Oauth OauthOptions
// Visibility defines the visibility of the API
// Accepted values are: "public", "private"
// Default to "public"
Visibility string
}
func (*AuthOptions) Init ¶
func (a *AuthOptions) Init()
type ConditionConfigResponse ¶ added in v0.9.0
type ConditionConfigResponse struct {
// Configs is a list of configuration conditions.
Configs []model.ConfigCondition `json:"configs"`
// TotalCount is the total number of conditions for pagination.
TotalCount int `json:"total_count"`
}
ConditionConfigResponse represents a response containing configuration conditions.
type ConfigKindResponse ¶ added in v0.9.0
type ConfigKindResponse struct {
Data []string `json:"data"`
}
ConfigKindResponse represents a response containing configuration kinds.
type CreatePipelineReportResponse ¶ added in v0.9.0
type CustomClaims ¶
type CustomClaims struct {
Name string `json:"name"`
Username string `json:"username"`
ShouldReject bool `json:"shouldReject,omitempty"`
}
CustomClaims contains custom data we want from the jwt token.
type DefaultResponseModel ¶ added in v0.9.0
type FindSCMSummaryResponse ¶ added in v0.9.0
type FindSCMSummaryResponse struct {
TotalCount int `json:"total_count"`
Data map[string]database.SCMBranchDataset `json:"data"`
}
FindSCMSummaryResponse represents the response for the FindSCMSummary endpoint.
type GetPipelineReportByIDResponse ¶ added in v0.9.0
type GetPipelineReportByIDResponse struct {
Message string `json:"message"`
Data model.PipelineReport `json:"data"`
NBReportsByID int `json:"nbReportsByID"`
LatestReportByID model.PipelineReport `json:"latestReportByID"`
}
type GetPipelineReportsResponse ¶ added in v0.9.0
type GetPipelineReportsResponse struct {
Data []database.SearchLatestReportData `json:"data"`
TotalCount int `json:"total_count"`
}
type Interceptor ¶ added in v0.12.0
type Interceptor[T authorization.Ctx] struct { // contains filtered or unexported fields }
func NewZitadelGin ¶ added in v0.12.0
func NewZitadelGin[T authorization.Ctx](authorizer *authorization.Authorizer[T]) *Interceptor[T]
func (*Interceptor[T]) Context ¶ added in v0.12.0
func (i *Interceptor[T]) Context(ctx context.Context) T
func (*Interceptor[T]) RequireAuthorization ¶ added in v0.12.0
func (i *Interceptor[T]) RequireAuthorization(options ...authorization.CheckOption) gin.HandlerFunc
type ListLabelKeyOnlyResponse ¶ added in v0.14.0
type ListLabelKeyOnlyResponse struct {
// Labels is a list of labels.
Labels []string `json:"labels"`
// TotalCount is the total number of labels matching the query.
TotalCount int `json:"total_count"`
}
ListLabelKeyOnlyResponse represents the response for listing all available labels
type ListLabelsResponse ¶ added in v0.14.0
type ListLabelsResponse struct {
// Labels is a list of labels.
Labels []model.Label `json:"labels"`
// TotalCount is the total number of labels matching the query.
TotalCount int `json:"total_count"`
}
ListLabelsResponse represents the response for the ListLabels endpoint.
type ListSCMsResponse ¶ added in v0.9.0
type ListSCMsResponse struct {
// SCMs is a list of SCMs.
SCMs []model.SCM `json:"scms"`
// TotalCount is the total number of SCMs matching the query.
TotalCount int `json:"total_count"`
}
ListSCMsResponse represents the response for the ListSCMs endpoint.
type OauthOptions ¶ added in v0.12.0
type SearchSCMsRequest ¶ added in v0.14.0
type SearchSCMsRequest struct {
// ScmID is the ID of the SCM to filter by.
ScmID string `json:"scmid"`
// StartTime is the start time for the time range filter.
// Time format is RFC3339: 2006-01-02T15:04:05Z07:00
StartTime string `json:"start_time"`
// EndTime is the end time for the time range filter.
// Time format is RFC3339: 2006-01-02T15:04:05Z07:00
EndTime string `json:"end_time"`
// Labels filters SCM summaries by report labels.
Labels map[string]string `json:"labels,omitempty"`
// URL is the SCM URL to filter by.
URL string `json:"url,omitempty"`
// Branch is the SCM branch to filter by.
Branch string `json:"branch,omitempty"`
// Summary indicates if the response should contain SCM summary data.
Summary bool `json:"summary,omitempty"`
// Limit is the maximum number of SCMs to return.
Limit int `json:"limit,omitempty"`
// Page is the page number for pagination.
Page int `json:"page,omitempty"`
}
SearchSCMsRequest represents the filters used to search SCM records.
type SourceConfigResponse ¶ added in v0.9.0
type SourceConfigResponse struct {
// Configs is a list of configuration sources.
Configs []model.ConfigSource `json:"configs"`
// TotalCount is the total number of sources for pagination.
TotalCount int `json:"total_count"`
}
SourceConfigResponse represents a response containing configuration sources.
type TargetConfigResponse ¶ added in v0.9.0
type TargetConfigResponse struct {
// Configs is a list of configuration targets.
Configs []model.ConfigTarget `json:"configs"`
// TotalCount is the total number of targets for pagination.
TotalCount int `json:"total_count"`
}
TargetConfigResponse represents a response containing configuration targets.
type ZitadelOptions ¶ added in v0.12.0
type ZitadelOptions struct {
// Domain is the Zitadel domain
// example: xxx.region.zitadel.cloud
Domain string
// KeyFile is the path to the service account key file
// example: /path/to/key.json
KeyFile string
// Role is the required role to access the API
Role string
}
ZitadelOptions defines Zitadel specific options for authentication