variable

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

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(
	variableManager *variable.VariableManager,
) (*Handler, error)

func (*Handler) CreateVariable

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

@Id createVariable @Summary Create variable @Description Create a new variable @Tags variable @Accept json @Produce json @Param variable body request.CreateVariableRequest true "Created variable" @Success 200 {object} handler.Response{data=entity.Variable} "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/variables [post]

func (*Handler) DeleteVariable

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

@Id deleteVariable @Summary Delete variable @Description Delete the specified variable by name and the variable set it belongs to @Tags variable @Produce json @Param variableSetName path string true "Variable Set Name" @Param variableName path string true "Variable Name" @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/variables/{variableSetName}/{variableName} [delete]

func (*Handler) GetVariable

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

@Id getVariable @Summary Get variable @Description Get variable information by variable name and the variable set it belongs @Tags variable @Produce json @Param variableSetName path string true "Variable Set Name" @Param variableName path string true "Variable Name" @Success 200 {object} handler.Response{data=entity.Variable} "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/variables/{variableSetName}/{variableName} [get]

func (*Handler) ListVariables

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

@Id listVariables @Summary List variables @Description List variable information @Tags variable @Produce json @Param variableName query string false "Variable Name" @Param variableSetName query string false "Variable Set Name" @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 descending query bool false "Whether to sort the list in descending order. Default to false" @Param fetchAll query bool false "Whether to list all the variables" @Success 200 {object} handler.Response{data=response.PaginatedVariableResponse} "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/variables [get]

func (*Handler) UpdateVariable

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

@Id updateVariable @Summary Update variable @Description Update the specified variable with name and the variable set it belongs to @Tags variable @Accept json @Produce json @Param variableSetName path string true "Variable Set Name" @Param variableName path string true "Variable Name" @Param variable body request.UpdateVariableRequest true "Updated variable" @Success 200 {object} handler.Response{data=entity.Variable} "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/variables/{variableSetName}/{variableName} [put]

type VariableRequestParams

type VariableRequestParams struct {
	VariableSetName string
	VariableName    string
}

Jump to

Keyboard shortcuts

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