systemconfig

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountSystemConfigResponse

type CountSystemConfigResponse struct {
	Total int `json:"total"`
}

CountSystemConfigResponse represents the count response structure for configuration of a system.

type CreateSystemConfigRequest

type CreateSystemConfigRequest struct {
	// Tenant or organization that the system belongs to
	Tenant string `json:"tenant" binding:"required"`
	// Environment where the system is deployed (e.g. prod, gray)
	Env string `json:"env" binding:"required"`
	// Type or category of the system (e.g. cache, message queue)
	Type string `json:"type" binding:"required"`
	// Configuration data in JSON or YAML format
	Config string `json:"config" binding:"required"`
	// Description or purpose of the system
	Description string `json:"description"`
	// Username or ID of the user who created the system
	Creator string `json:"creator" binding:"required"`
	// Username or ID of the user who last modified the system
	Modifier string `json:"modifier"`
}

CreateSystemConfigRequest represents the create request structure for configuration of a system.

type Handler

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

func NewHandler

func NewHandler(repo repository.SystemConfigRepository) *Handler

func (*Handler) CountSystemConfigs

func (h *Handler) CountSystemConfigs(c *gin.Context, log logrus.FieldLogger) (any, error)

@Summary Count system configs @Description Count the total number of system configs @Produce json @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig/count [get]

func (*Handler) CreateSystemConfig

func (h *Handler) CreateSystemConfig(c *gin.Context, log logrus.FieldLogger) (any, error)

@Summary Create system config @Description Create a new system config instance @Accept json @Produce json @Param system config body CreateSystemConfigRequest true "Created system config" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig [post]

func (*Handler) DeleteSystemConfig

func (h *Handler) DeleteSystemConfig(c *gin.Context, log logrus.FieldLogger) (any, error)

@Summary Delete system config @Description Delete specified system config by ID @Produce json @Param id path int true "SystemConfig ID" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig/{id} [delete]

func (*Handler) FindSystemConfigs

func (h *Handler) FindSystemConfigs(c *gin.Context, log logrus.FieldLogger) (any, error)

@Summary Find system configs @Description Find system configs with query @Accept json @Produce json @Param query body QuerySystemConfigRequest true "query body" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfigs [get]

func (*Handler) GetSystemConfig

func (h *Handler) GetSystemConfig(c *gin.Context, log logrus.FieldLogger) (any, error)

@Summary Get system config @Description Get system config information by system config ID @Produce json @Param id path int true "SystemConfig ID" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig/{id} [get]

func (*Handler) UpdateSystemConfig

func (h *Handler) UpdateSystemConfig(c *gin.Context, log logrus.FieldLogger) (any, error)

@Summary Update system config @Description Update the specified system config @Accept json @Produce json @Param system config body UpdateSystemConfigRequest true "Updated system config" @Success 200 {object} entity.SystemConfig "Success" @Failure 400 {object} errors.DetailError "Bad Request" @Failure 401 {object} errors.DetailError "Unauthorized" @Failure 429 {object} errors.DetailError "Too Many Requests" @Failure 404 {object} errors.DetailError "Not Found" @Failure 500 {object} errors.DetailError "Internal Server Error" @Router /api/v1/systemconfig [put]

type QuerySystemConfigRequest

type QuerySystemConfigRequest struct {
	handler.Pagination
	handler.Search
}

QuerySystemConfigRequest represents the query request structure for configuration of a system.

type UpdateSystemConfigRequest

type UpdateSystemConfigRequest struct {
	// Unique ID of the system
	ID uint `json:"id" binding:"required"`
	// Tenant or organization that the system belongs to
	Tenant string `json:"tenant"`
	// Environment where the system is deployed (e.g. prod, gray)
	Env string `json:"env"`
	// Type or category of the system (e.g. cache, message queue)
	Type string `json:"type"`
	// Configuration data in JSON or YAML format
	Config string `json:"config"`
	// Description or purpose of the system
	Description string `json:"description"`
	// Username or ID of the user who created the system
	Creator string `json:"creator"`
	// Username or ID of the user who last modified the system
	Modifier string `json:"modifier"`
}

UpdateSystemConfigRequest represents the update request structure for configuration of a system.

Jump to

Keyboard shortcuts

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