Documentation ¶
Index ¶
- func GetPaginatedResources(dir string, pageSize int64, nextPageKey string, writer common.IFileSystem, ...) (*models.GetResourcesResponse, error)
- func GracefulShutdownMiddleware(wg *sync.WaitGroup) gin.HandlerFunc
- func OnAPIError(c *gin.Context, err error)
- func SetBadRequestErrorResponse(c *gin.Context, msg string)
- func SetConflictErrorResponse(c *gin.Context, msg string)
- func SetFailedDependencyErrorResponse(c *gin.Context, msg string)
- func SetInternalServerErrorResponse(c *gin.Context, msg string)
- func SetNotFoundErrorResponse(c *gin.Context, msg string)
- type BranchConfigurationContext
- type BranchingStageManager
- type DirectoryConfigurationContext
- func (ds DirectoryConfigurationContext) Establish(params common_models.ConfigurationContextParams) (string, error)
- func (ds DirectoryConfigurationContext) GetProjectConfigPath(project string) string
- func (ds DirectoryConfigurationContext) GetServiceConfigPath(project, stage, service string) string
- func (ds DirectoryConfigurationContext) GetStageConfigPath(project, stage string) string
- type DirectoryStageManager
- type HealthHandler
- type IConfigurationContext
- type IHealthHandler
- type IProjectHandler
- type IProjectManager
- type IProjectResourceHandler
- type IResourceManager
- type IServiceHandler
- type IServiceManager
- type IServiceResourceHandler
- type IStageHandler
- type IStageManager
- type IStageResourceHandler
- type PaginationResult
- type ProjectHandler
- type ProjectManager
- type ProjectResourceHandler
- func (ph *ProjectResourceHandler) CreateProjectResources(c *gin.Context)
- func (ph *ProjectResourceHandler) DeleteProjectResource(c *gin.Context)
- func (ph *ProjectResourceHandler) GetProjectResource(c *gin.Context)
- func (ph *ProjectResourceHandler) GetProjectResources(c *gin.Context)
- func (ph *ProjectResourceHandler) UpdateProjectResource(c *gin.Context)
- func (ph *ProjectResourceHandler) UpdateProjectResources(c *gin.Context)
- type ResourceManager
- func (p ResourceManager) CreateResources(params models.CreateResourcesParams) (*models.WriteResourceResponse, error)
- func (p ResourceManager) DeleteResource(params models.DeleteResourceParams) (*models.WriteResourceResponse, error)
- func (p ResourceManager) GetResource(params models.GetResourceParams) (*models.GetResourceResponse, error)
- func (p ResourceManager) GetResources(params models.GetResourcesParams) (*models.GetResourcesResponse, error)
- func (p ResourceManager) UpdateResource(params models.UpdateResourceParams) (*models.WriteResourceResponse, error)
- func (p ResourceManager) UpdateResources(params models.UpdateResourcesParams) (*models.WriteResourceResponse, error)
- type ServiceHandler
- type ServiceManager
- type ServiceResourceHandler
- func (ph *ServiceResourceHandler) CreateServiceResources(c *gin.Context)
- func (ph *ServiceResourceHandler) DeleteServiceResource(c *gin.Context)
- func (ph *ServiceResourceHandler) GetServiceResource(c *gin.Context)
- func (ph *ServiceResourceHandler) GetServiceResources(c *gin.Context)
- func (ph *ServiceResourceHandler) UpdateServiceResource(c *gin.Context)
- func (ph *ServiceResourceHandler) UpdateServiceResources(c *gin.Context)
- type StageHandler
- type StageResourceHandler
- func (ph *StageResourceHandler) CreateStageResources(c *gin.Context)
- func (ph *StageResourceHandler) DeleteStageResource(c *gin.Context)
- func (ph *StageResourceHandler) GetStageResource(c *gin.Context)
- func (ph *StageResourceHandler) GetStageResources(c *gin.Context)
- func (ph *StageResourceHandler) UpdateStageResource(c *gin.Context)
- func (ph *StageResourceHandler) UpdateStageResources(c *gin.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPaginatedResources ¶
func GetPaginatedResources(dir string, pageSize int64, nextPageKey string, writer common.IFileSystem, metadata models.Version) (*models.GetResourcesResponse, error)
GetPaginatedResources returns a paginated resources set
func GracefulShutdownMiddleware ¶
func GracefulShutdownMiddleware(wg *sync.WaitGroup) gin.HandlerFunc
GracefulShutdownMiddleware synchronize active handlers to enable graceful shutdown
func OnAPIError ¶
Types ¶
type BranchConfigurationContext ¶
type BranchConfigurationContext struct {
// contains filtered or unexported fields
}
func NewBranchConfigurationContext ¶
func NewBranchConfigurationContext(git common.IGit, fileSystem common.IFileSystem) *BranchConfigurationContext
func (BranchConfigurationContext) Establish ¶
func (bs BranchConfigurationContext) Establish(params common_models.ConfigurationContextParams) (string, error)
type BranchingStageManager ¶
type BranchingStageManager struct {
// contains filtered or unexported fields
}
func NewStageManager ¶
func NewStageManager(git common.IGit, credentialReader common.CredentialReader) *BranchingStageManager
func (BranchingStageManager) CreateStage ¶
func (s BranchingStageManager) CreateStage(params models.CreateStageParams) error
func (BranchingStageManager) DeleteStage ¶
func (s BranchingStageManager) DeleteStage(params models.DeleteStageParams) error
type DirectoryConfigurationContext ¶
type DirectoryConfigurationContext struct {
// contains filtered or unexported fields
}
func NewDirectoryConfigurationContext ¶
func NewDirectoryConfigurationContext(git common.IGit, fileSystem common.IFileSystem) *DirectoryConfigurationContext
func (DirectoryConfigurationContext) Establish ¶
func (ds DirectoryConfigurationContext) Establish(params common_models.ConfigurationContextParams) (string, error)
func (DirectoryConfigurationContext) GetProjectConfigPath ¶
func (ds DirectoryConfigurationContext) GetProjectConfigPath(project string) string
func (DirectoryConfigurationContext) GetServiceConfigPath ¶
func (ds DirectoryConfigurationContext) GetServiceConfigPath(project, stage, service string) string
func (DirectoryConfigurationContext) GetStageConfigPath ¶
func (ds DirectoryConfigurationContext) GetStageConfigPath(project, stage string) string
type DirectoryStageManager ¶
type DirectoryStageManager struct {
// contains filtered or unexported fields
}
func NewDirectoryStageManager ¶
func NewDirectoryStageManager(configurationContext IConfigurationContext, fileSystem common.IFileSystem, credentialReader common.CredentialReader, git common.IGit) *DirectoryStageManager
func (DirectoryStageManager) CreateStage ¶
func (dm DirectoryStageManager) CreateStage(params models.CreateStageParams) error
func (DirectoryStageManager) DeleteStage ¶
func (dm DirectoryStageManager) DeleteStage(params models.DeleteStageParams) error
type HealthHandler ¶
type HealthHandler struct { }
func NewHealthHandler ¶
func NewHealthHandler() *HealthHandler
func (*HealthHandler) Health ¶
func (h *HealthHandler) Health(c *gin.Context)
type IConfigurationContext ¶
type IConfigurationContext interface {
Establish(params common_models.ConfigurationContextParams) (string, error)
}
type IHealthHandler ¶
type IProjectHandler ¶
type IProjectManager ¶
type IProjectManager interface { CreateProject(project models.CreateProjectParams) error UpdateProject(project models.UpdateProjectParams) error DeleteProject(projectName string) error }
IProjectManager provides an interface for project CRUD operations
type IProjectResourceHandler ¶
type IProjectResourceHandler interface { CreateProjectResources(context *gin.Context) GetProjectResources(context *gin.Context) UpdateProjectResources(context *gin.Context) GetProjectResource(context *gin.Context) UpdateProjectResource(context *gin.Context) DeleteProjectResource(context *gin.Context) }
type IResourceManager ¶
type IResourceManager interface { CreateResources(params models.CreateResourcesParams) (*models.WriteResourceResponse, error) GetResources(params models.GetResourcesParams) (*models.GetResourcesResponse, error) UpdateResources(params models.UpdateResourcesParams) (*models.WriteResourceResponse, error) GetResource(params models.GetResourceParams) (*models.GetResourceResponse, error) UpdateResource(params models.UpdateResourceParams) (*models.WriteResourceResponse, error) DeleteResource(params models.DeleteResourceParams) (*models.WriteResourceResponse, error) }
IResourceManager provides an interface for resource CRUD operations
type IServiceHandler ¶
type IServiceManager ¶
type IServiceManager interface { CreateService(params models.CreateServiceParams) error DeleteService(params models.DeleteServiceParams) error }
IServiceManager provides an interface for stage CRUD operations
type IServiceResourceHandler ¶
type IServiceResourceHandler interface { CreateServiceResources(context *gin.Context) GetServiceResources(context *gin.Context) UpdateServiceResources(context *gin.Context) GetServiceResource(context *gin.Context) UpdateServiceResource(context *gin.Context) DeleteServiceResource(context *gin.Context) }
type IStageHandler ¶
type IStageManager ¶
type IStageManager interface { CreateStage(params models.CreateStageParams) error DeleteStage(params models.DeleteStageParams) error }
IStageManager provides an interface for stage CRUD operations
type IStageResourceHandler ¶
type PaginationResult ¶
type PaginationResult struct { // Pointer to next page, base64 encoded NewNextPageKey string NextPageKey int64 // Size of returned page PageSize float64 // End Index EndIndex int64 }
PaginationResult contains pagination info
type ProjectHandler ¶
type ProjectHandler struct {
ProjectManager IProjectManager
}
func NewProjectHandler ¶
func NewProjectHandler(projectManager IProjectManager) *ProjectHandler
func (*ProjectHandler) CreateProject ¶
func (ph *ProjectHandler) CreateProject(c *gin.Context)
CreateProject godoc @Summary Create a new project @Deprecated true @Description INTERNAL Endpoint: Create a new project @Tags Project @Security ApiKeyAuth @Accept json @Produce json @Param project body models.CreateProjectParams true "Project" @Success 204 {string} string "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project [post]
func (*ProjectHandler) DeleteProject ¶
func (ph *ProjectHandler) DeleteProject(c *gin.Context)
DeleteProject godoc @Summary Updates an existing project @Deprecated true @Description INTERNAL Endpoint: Updates an existing project @Tags Project @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "Project" @Success 204 {string} string "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName} [delete]
func (*ProjectHandler) UpdateProject ¶
func (ph *ProjectHandler) UpdateProject(c *gin.Context)
UpdateProject godoc @Summary Updates an existing project @Deprecated true @Description INTERNAL Endpoint: Updates an existing project @Tags Project @Security ApiKeyAuth @Accept json @Produce json @Param project body models.UpdateProjectParams true "Project" @Success 204 {string} string "ok" @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName} [put]
type ProjectManager ¶
type ProjectManager struct {
// contains filtered or unexported fields
}
func NewProjectManager ¶
func NewProjectManager(git common.IGit, credentialReader common.CredentialReader, fileWriter common.IFileSystem) *ProjectManager
func (ProjectManager) CreateProject ¶
func (p ProjectManager) CreateProject(project models.CreateProjectParams) error
func (ProjectManager) DeleteProject ¶
func (p ProjectManager) DeleteProject(projectName string) error
func (ProjectManager) UpdateProject ¶
func (p ProjectManager) UpdateProject(project models.UpdateProjectParams) error
type ProjectResourceHandler ¶
type ProjectResourceHandler struct {
ProjectResourceManager IResourceManager
}
func NewProjectResourceHandler ¶
func NewProjectResourceHandler(projectResourceManager IResourceManager) *ProjectResourceHandler
func (*ProjectResourceHandler) CreateProjectResources ¶
func (ph *ProjectResourceHandler) CreateProjectResources(c *gin.Context)
CreateProjectResources godoc @Summary Creates project resources @Description Create list of new resources for the project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:write</span> @Tags Project Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param resources body models.CreateResourcesPayload true "List of resources" @Success 201 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/resource [post]
func (*ProjectResourceHandler) DeleteProjectResource ¶
func (ph *ProjectResourceHandler) DeleteProjectResource(c *gin.Context)
DeleteProjectResource godoc @Summary Deletes a project resource @Description Deletes a project resource @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:delete</span> @Tags Project Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param resourceURI path string true "The path of the resource file" @Success 200 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/resource/{resourceURI} [delete]
func (*ProjectResourceHandler) GetProjectResource ¶
func (ph *ProjectResourceHandler) GetProjectResource(c *gin.Context)
GetProjectResource godoc @Summary Get project resource @Description Get project resource @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:read</span> @Tags Project Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param resourceURI path string true "The path of the resource file" @Param gitCommitID query string false "The commit ID to be checked out" @Success 200 {object} models.GetResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/resource/{resourceURI} [get]
func (*ProjectResourceHandler) GetProjectResources ¶
func (ph *ProjectResourceHandler) GetProjectResources(c *gin.Context)
GetProjectResources godoc @Summary Get list of project resources @Description Get list of project resources @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:read</span> @Tags Project Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param pageSize query int false "The number of items to return" @Param nextPageKey query string false "Pointer to the next set of items" @Success 200 {object} models.GetResourcesResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/resource [get]
func (*ProjectResourceHandler) UpdateProjectResource ¶
func (ph *ProjectResourceHandler) UpdateProjectResource(c *gin.Context)
UpdateProjectResource godoc @Summary Updates a project resource @Description Updates a resource for the project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:write</span> @Tags Project Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param resourceURI path string true "The path of the resource file" @Param resources body models.UpdateResourcePayload true "resource" @Success 200 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/resource/{resourceURI} [put]
func (*ProjectResourceHandler) UpdateProjectResources ¶
func (ph *ProjectResourceHandler) UpdateProjectResources(c *gin.Context)
UpdateProjectResources godoc @Summary Updates project resources @Description Update list of new resources for the project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:write</span> @Tags Project Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param resources body models.UpdateResourcesPayload true "List of resources" @Success 200 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/resource [put]
type ResourceManager ¶
type ResourceManager struct {
// contains filtered or unexported fields
}
func NewResourceManager ¶
func NewResourceManager(git common.IGit, credentialReader common.CredentialReader, fileWriter common.IFileSystem, stageContext IConfigurationContext) *ResourceManager
func (ResourceManager) CreateResources ¶
func (p ResourceManager) CreateResources(params models.CreateResourcesParams) (*models.WriteResourceResponse, error)
func (ResourceManager) DeleteResource ¶
func (p ResourceManager) DeleteResource(params models.DeleteResourceParams) (*models.WriteResourceResponse, error)
func (ResourceManager) GetResource ¶
func (p ResourceManager) GetResource(params models.GetResourceParams) (*models.GetResourceResponse, error)
func (ResourceManager) GetResources ¶
func (p ResourceManager) GetResources(params models.GetResourcesParams) (*models.GetResourcesResponse, error)
func (ResourceManager) UpdateResource ¶
func (p ResourceManager) UpdateResource(params models.UpdateResourceParams) (*models.WriteResourceResponse, error)
func (ResourceManager) UpdateResources ¶
func (p ResourceManager) UpdateResources(params models.UpdateResourcesParams) (*models.WriteResourceResponse, error)
type ServiceHandler ¶
type ServiceHandler struct {
ServiceManager IServiceManager
}
func NewServiceHandler ¶
func NewServiceHandler(serviceManager IServiceManager) *ServiceHandler
func (*ServiceHandler) CreateService ¶
func (sh *ServiceHandler) CreateService(c *gin.Context)
func (*ServiceHandler) DeleteService ¶
func (sh *ServiceHandler) DeleteService(c *gin.Context)
type ServiceManager ¶
type ServiceManager struct {
// contains filtered or unexported fields
}
func NewServiceManager ¶
func NewServiceManager(git common.IGit, credentialReader common.CredentialReader, fileWriter common.IFileSystem, stageContext IConfigurationContext) *ServiceManager
func (ServiceManager) CreateService ¶
func (s ServiceManager) CreateService(params models.CreateServiceParams) error
func (ServiceManager) DeleteService ¶
func (s ServiceManager) DeleteService(params models.DeleteServiceParams) error
type ServiceResourceHandler ¶
type ServiceResourceHandler struct {
ServiceResourceManager IResourceManager
}
func NewServiceResourceHandler ¶
func NewServiceResourceHandler(serviceResourceManager IResourceManager) *ServiceResourceHandler
func (*ServiceResourceHandler) CreateServiceResources ¶
func (ph *ServiceResourceHandler) CreateServiceResources(c *gin.Context)
CreateServiceResources godoc @Summary Creates service resources @Description Create list of new resources for the service in the given stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:write</span> @Tags Service Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param serviceName path string true "The name of the service" @Param resources body models.CreateResourcesPayload true "List of resources" @Success 201 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/service/{serviceName}/resource [post]
func (*ServiceResourceHandler) DeleteServiceResource ¶
func (ph *ServiceResourceHandler) DeleteServiceResource(c *gin.Context)
DeleteServiceResource godoc @Summary Deletes a service resource @Description Deletes a resource for the service in the given stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:delete</span> @Tags Service Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param serviceName path string true "The name of the service" @Param resourceURI path string true "The path of the resource file" @Success 200 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/service/{serviceName}/resource/{resourceURI} [delete]
func (*ServiceResourceHandler) GetServiceResource ¶
func (ph *ServiceResourceHandler) GetServiceResource(c *gin.Context)
GetServiceResource godoc @Summary Get service resource @Description Get resource for the service in the given stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:read</span> @Tags Service Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param serviceName path string true "The name of the service" @Param resourceURI path string true "The path of the resource file" @Param gitCommitID query string false "The commit ID to be checked out" @Success 200 {object} models.GetResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/service/{serviceName}/resource/{resourceURI} [get]
func (*ServiceResourceHandler) GetServiceResources ¶
func (ph *ServiceResourceHandler) GetServiceResources(c *gin.Context)
GetServiceResources godoc @Summary Get list of project resources @Description Get list of resources for the service in the given stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:read</span> @Tags Service Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param serviceName path string true "The name of the service" @Param pageSize query int false "The number of items to return" @Param nextPageKey query string false "Pointer to the next set of items" @Success 200 {object} models.GetResourcesResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/service/{serviceName}/resource [get]
func (*ServiceResourceHandler) UpdateServiceResource ¶
func (ph *ServiceResourceHandler) UpdateServiceResource(c *gin.Context)
UpdateServiceResource godoc @Summary Updates a service resource @Description Updates a resource for the service in the given stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:write</span> @Tags Service Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param serviceName path string true "The name of the service" @Param resourceURI path string true "The path of the resource file" @Param resources body models.UpdateResourcePayload true "resource" @Success 200 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/service/{serviceName}/resource/{resourceURI} [put]
func (*ServiceResourceHandler) UpdateServiceResources ¶
func (ph *ServiceResourceHandler) UpdateServiceResources(c *gin.Context)
UpdateServiceResources godoc @Summary Updates service resources @Description Update list of new resources for the service in the given stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:write</span> @Tags Service Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param serviceName path string true "The name of the service" @Param resources body models.UpdateResourcesPayload true "List of resources" @Success 200 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/service/{serviceName}/resource [put]
type StageHandler ¶
type StageHandler struct {
StageManager IStageManager
}
func NewStageHandler ¶
func NewStageHandler(stageManager IStageManager) *StageHandler
func (*StageHandler) CreateStage ¶
func (ph *StageHandler) CreateStage(c *gin.Context)
func (*StageHandler) DeleteStage ¶
func (sh *StageHandler) DeleteStage(c *gin.Context)
type StageResourceHandler ¶
type StageResourceHandler struct {
StageResourceManager IResourceManager
}
func NewStageResourceHandler ¶
func NewStageResourceHandler(stageResourceManager IResourceManager) *StageResourceHandler
func (*StageResourceHandler) CreateStageResources ¶
func (ph *StageResourceHandler) CreateStageResources(c *gin.Context)
CreateStageResources godoc @Summary Creates stage resources @Description Create list of new resources for the stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:write</span> @Tags Stage Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param resources body models.CreateResourcesPayload true "List of resources" @Success 201 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/resource [post]
func (*StageResourceHandler) DeleteStageResource ¶
func (ph *StageResourceHandler) DeleteStageResource(c *gin.Context)
DeleteStageResource godoc @Summary Deletes a stage resource @Description Deletes a resource for the stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:delete</span> @Tags Stage Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param resourceURI path string true "The path of the resource file" @Success 200 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/resource/{resourceURI} [delete]
func (*StageResourceHandler) GetStageResource ¶
func (ph *StageResourceHandler) GetStageResource(c *gin.Context)
GetStageResource godoc @Summary Get stage resource @Description Get resource for the stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:read</span> @Tags Stage Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param resourceURI path string true "The path of the resource file" @Param gitCommitID query string false "The commit ID to be checked out" @Success 200 {object} models.GetResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/resource/{resourceURI} [get]
func (*StageResourceHandler) GetStageResources ¶
func (ph *StageResourceHandler) GetStageResources(c *gin.Context)
GetStageResources godoc @Summary Get list of stage resources @Description Get list of resources for the stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:read</span> @Tags Stage Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param pageSize query int false "The number of items to return" @Param nextPageKey query string false "Pointer to the next set of items" @Success 200 {object} models.GetResourcesResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/resource [get]
func (*StageResourceHandler) UpdateStageResource ¶
func (ph *StageResourceHandler) UpdateStageResource(c *gin.Context)
UpdateStageResource godoc @Summary Updates a stage resource @Description Updates a resource for the stage of a project @Description <span class="oauth-scopes">Required OAuth scopes: ${prefix}resources:write</span> @Tags Stage Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param resourceURI path string true "The path of the resource file" @Param resources body models.UpdateResourcePayload true "resource" @Success 200 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/resource/{resourceURI} [put]
func (*StageResourceHandler) UpdateStageResources ¶
func (ph *StageResourceHandler) UpdateStageResources(c *gin.Context)
UpdateStageResources godoc @Summary Updates stage resources @Description Update list of new resources for the stage of a project @Tags Stage Resource @Security ApiKeyAuth @Accept json @Produce json @Param projectName path string true "The name of the project" @Param stageName path string true "The name of the stage" @Param resources body models.UpdateResourcesPayload true "List of resources" @Success 200 {string} models.WriteResourceResponse @Failure 400 {object} models.Error "Invalid payload" @Failure 500 {object} models.Error "Internal error" @Router /project/{projectName}/stage/{stageName}/resource [put]