server

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: AGPL-3.0 Imports: 24 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 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" @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

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

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" @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 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" @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} 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" @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} DefaultResponseModel @Failure 500 {object} DefaultResponseModel @Router /api/pipeline/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 @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 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"`
	// 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 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 {
	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 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 Options

type Options struct {
	Auth   AuthOptions
	DryRun bool
}

Options holds the server options

func (*Options) Init

func (o *Options) Init()

type Server

type Server struct {
	Options Options
}

func (*Server) Run

func (s *Server) Run() error

@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"`
	// 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.

Jump to

Keyboard shortcuts

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