workspace

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(
	workspaceManager *workspacemanager.WorkspaceManager,
) (*Handler, error)

func (*Handler) CreateWorkspace

func (h *Handler) CreateWorkspace() http.HandlerFunc

@Id createWorkspace @Summary Create workspace @Description Create a new workspace @Tags workspace @Accept json @Produce json @Param workspace body request.CreateWorkspaceRequest true "Created workspace" @Success 200 {object} handler.Response{data=entity.Workspace} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/workspaces [post]

func (*Handler) CreateWorkspaceModDeps added in v0.14.0

func (h *Handler) CreateWorkspaceModDeps() http.HandlerFunc

@Id createWorkspaceModDeps @Summary Create the module dependencies of the workspace @Description Create the module dependencies in kcl.mod of the specified workspace @Tags workspace @Accept json @Produce plain @Param workspaceID path int true "Workspace ID" @Success 200 {object} string "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/workspaces/{workspaceID}/configs/mod-deps [post]

func (*Handler) DeleteWorkspace

func (h *Handler) DeleteWorkspace() http.HandlerFunc

@Id deleteWorkspace @Summary Delete workspace @Description Delete specified workspace by ID @Tags workspace @Produce json @Param workspaceID path int true "Workspace ID" @Success 200 {object} handler.Response{data=string} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/workspaces/{workspaceID} [delete]

func (*Handler) GetWorkspace

func (h *Handler) GetWorkspace() http.HandlerFunc

@Id getWorkspace @Summary Get workspace @Description Get workspace information by workspace ID @Tags workspace @Produce json @Param workspaceID path int true "Workspace ID" @Success 200 {object} handler.Response{data=entity.Workspace} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/workspaces/{workspaceID} [get]

func (*Handler) GetWorkspaceConfigs added in v0.14.0

func (h *Handler) GetWorkspaceConfigs() http.HandlerFunc

@Id getWorkspaceConfigs @Summary get workspace configurations @Description Get configurations in the specified workspace @Tags workspace @Accept json @Produce json @Param workspaceID path int true "Workspace ID" @Success 200 {object} request.WorkspaceConfigs "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/workspaces/{workspaceID}/configs [get]

func (*Handler) ListWorkspaces

func (h *Handler) ListWorkspaces() http.HandlerFunc

@Id listWorkspace @Summary List workspaces @Description List all workspaces @Tags workspace @Produce json @Param backendID query uint false "BackendID to filter workspaces by. Default to all" @Param page query uint false "The current page to fetch. Default to 1" @Param pageSize query uint false "The size of the page. Default to 10" @Param sortBy query string false "Which field to sort the list by. Default to id" @Param ascending query bool false "Whether to sort the list in ascending order. Default to false" @Success 200 {object} handler.Response{data=response.PaginatedWorkspaceResponse} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/workspaces [get]

func (*Handler) UpdateWorkspace

func (h *Handler) UpdateWorkspace() http.HandlerFunc

@Id updateWorkspace @Summary Update workspace @Description Update the specified workspace @Tags workspace @Accept json @Produce json @Param workspaceID path int true "Workspace ID" @Param workspace body request.UpdateWorkspaceRequest true "Updated workspace" @Success 200 {object} handler.Response{data=entity.Workspace} "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/workspaces/{workspaceID} [put]

func (*Handler) UpdateWorkspaceConfigs added in v0.14.0

func (h *Handler) UpdateWorkspaceConfigs() http.HandlerFunc

@Id updateWorkspaceConfigs @Summary Update workspace configurations @Description Update the configurations in the specified workspace @Tags workspace @Accept json @Produce json @Param workspaceID path int true "Workspace ID" @Param workspace body request.WorkspaceConfigs true "Updated workspace configurations" @Success 200 {object} request.WorkspaceConfigs "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/workspaces/{workspaceID}/configs [put]

func (*Handler) ValidateWorkspaceConfigs added in v0.14.0

func (h *Handler) ValidateWorkspaceConfigs() http.HandlerFunc

@Id validateWorkspaceConfigs @Summary Validate workspace configurations @Description Validate the configurations in the specified workspace @Tags workspace @Accept json @Produce json @Param workspace body request.WorkspaceConfigs true "Workspace configurations to be validated" @Success 200 {object} request.WorkspaceConfigs "Success" @Failure 400 {object} error "Bad Request" @Failure 401 {object} error "Unauthorized" @Failure 429 {object} error "Too Many Requests" @Failure 404 {object} error "Not Found" @Failure 500 {object} error "Internal Server Error" @Router /api/v1/workspaces/configs/validate [post]

type WorkspaceRequestParams

type WorkspaceRequestParams struct {
	WorkspaceID uint
}

Jump to

Keyboard shortcuts

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