server

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2025 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func About

func About(c *gin.Context)

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

func CreatePipelineReport(c *gin.Context)

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 500 {object} DefaultResponseModel @Router /api/pipeline/reports [post]

func DeleteConfigCondition added in v0.9.0

func DeleteConfigCondition(c *gin.Context)

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

func DeleteConfigSource(c *gin.Context)

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

func DeleteConfigTarget(c *gin.Context)

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

func DeletePipelineReport(c *gin.Context)

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 201 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/reports/{id} [delete]

func FindSCMSummary added in v0.6.0

func FindSCMSummary(c *gin.Context, scmRows []model.SCM)

FindSCMSummary returns a summary of all git repositories detected. @Summary Find SCM Summary @Description Find SCM Summary of all git repositories detected @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" @Success 200 {object} FindSCMSummaryResponse @Failure 500 {object} DefaultResponseModel @Router /api/scms/summary [get]

func GetPipelineReportByID added in v0.9.0

func GetPipelineReportByID(c *gin.Context)

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 201 {object} GetPipelineReportByIDResponse @Failure 404 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/reports/{id} [get]

func Landing

func Landing(c *gin.Context)

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

func ListConfigConditions(c *gin.Context)

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" @Success 200 {object} ConditionConfigResponse @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/conditions [get]

func ListConfigSources added in v0.9.0

func ListConfigSources(c *gin.Context)

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" @Success 200 {object} SourceConfigResponse @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/sources [get]

func ListConfigTargets added in v0.9.0

func ListConfigTargets(c *gin.Context)

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" @Success 200 {object} TargetConfigResponse @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/config/targets [get]

func ListPipelineReports added in v0.9.0

func ListPipelineReports(c *gin.Context)

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" @Success 200 {object} GetPipelineReportsResponse @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/reports [get]

func ListSCMs added in v0.9.0

func ListSCMs(c *gin.Context)

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" @Success 200 {object} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/scms [get]

func Ping

func Ping(c *gin.Context)

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

func SearchConfigConditions(c *gin.Context)

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

func SearchConfigKinds(c *gin.Context)

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

func SearchConfigSources(c *gin.Context)

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

func SearchConfigTargets(c *gin.Context)

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 SearchPipelineReports added in v0.9.0

func SearchPipelineReports(c *gin.Context)

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 @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 UpdatePipelineReport

func UpdatePipelineReport(c *gin.Context)

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 AboutResponseModel struct {
	Version struct {
		Golang    string `json:"golang,omitempty"`
		API       string `json:"api,omitempty"`
		BuildTime string `json:"buildTime,omitempty"`
	} `json:"version,omitempty"`
}

type AuthOptions

type AuthOptions struct {
	// The issuer of our token.
	Issuer string

	// The audience of our token.
	Audience []string

	// Mode enable auth0 authentication
	Mode 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"`
}

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 CreatePipelineReportResponse struct {
	Message  string `json:"message"`
	ReportID string `json:"reportid"`
}

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.

func (*CustomClaims) Validate

func (c *CustomClaims) Validate(ctx context.Context) error

Validate errors out if `ShouldReject` is true.

type DefaultResponseModel added in v0.9.0

type DefaultResponseModel struct {
	Message string `json:"message,omitempty"`
	Err     string `json:"error,omitempty"`
}

type FindSCMSummaryResponse added in v0.9.0

type FindSCMSummaryResponse struct {
	Data map[string]ScmBranchData `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 []respSearchLatestReportData `json:"data"`
}

type ListSCMsResponse added in v0.9.0

type ListSCMsResponse struct {
	// SCMs is a list of SCMs.
	SCMs []model.SCM `json:"scms"`
}

type Options

type Options struct {
	Auth   AuthOptions
	DryRun bool
}

Options holds the server options

func (*Options) Init

func (o *Options) Init()

type ScmBranchData added in v0.9.0

type ScmBranchData map[string]ScmSummaryData

ScmBranchData represents a map of branches and their summary data for a single SCM URL.

type ScmSummaryData added in v0.9.0

type ScmSummaryData struct {
	// ID is the unique identifier of the SCM.
	ID string `json:"id"`
	// TotalResultByType is a map of result types and their counts.
	TotalResultByType map[string]int `json:"total_result_by_type"`
	// TotalResult is the total number of results for this SCM.
	TotalResult int `json:"total_result"`
}

ScmSummaryData represents the summary data for a single SCM.

type Server

type Server struct {
	Options Options
}

func (*Server) Run

func (s *Server) Run()

@title Udash API @version 1.0 @description API for managing Updatecli pipeline reports. @BasePath /api/

type SourceConfigResponse added in v0.9.0

type SourceConfigResponse struct {
	// Configs is a list of configuration sources.
	Configs []model.ConfigSource `json:"configs"`
}

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"`
}

TargetConfigResponse represents a response containing configuration targets.

Jump to

Keyboard shortcuts

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