config

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigUpsertRequest

type ConfigUpsertRequest struct {
	Key   string `json:"key"`   // 配置键
	Value string `json:"value"` // 配置值
}

ConfigUpsertRequest represents the request to create or update a config

type ConfigUpsertResponse

type ConfigUpsertResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

ConfigUpsertResponse represents the response for config upsert

type ConfigVersion

type ConfigVersion struct {
	Key       string `json:"key"`
	Version   int    `json:"version"`
	CreatedBy string `json:"createdBy"`
	CreatedAt string `json:"createdAt"`
	GameID    string `json:"game_id"`
	Env       string `json:"env"`
	Format    string `json:"format"`
	Message   string `json:"message"`
	Value     string `json:"value,omitempty"`
}

ConfigVersion represents a single config version

type ConfigVersionDetailRequest

type ConfigVersionDetailRequest struct {
	Key     string `form:"key"`     // 配置键
	Version int    `form:"version"` // 版本号
}

ConfigVersionDetailRequest represents the request to get a specific config version

type ConfigVersionDetailResponse

type ConfigVersionDetailResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

ConfigVersionDetailResponse represents the response for a specific config version

type ConfigVersionItem

type ConfigVersionItem struct {
	Key       string `json:"key"`
	Version   int    `json:"version"`
	CreatedBy string `json:"createdBy"`
	CreatedAt string `json:"createdAt"`
	GameID    string `json:"game_id"`
	Env       string `json:"env"`
	Format    string `json:"format"`
	Message   string `json:"message"`
	Value     string `json:"value"`
}

ConfigVersionItem represents a simplified config version for list view

type ConfigVersionsRequest

type ConfigVersionsRequest struct {
	Key string `form:"key"` // 配置键
}

ConfigVersionsRequest represents the request to list config versions

type ConfigVersionsResponse

type ConfigVersionsResponse struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data,omitempty"`
}

ConfigVersionsResponse represents the response with config versions list

type GetVersionRequest

type GetVersionRequest struct {
	Key     string `form:"key"`     // config key
	Version int    `form:"version"` // version number
}

GetVersionRequest represents the request to get a specific config version

type GetVersionResponse

type GetVersionResponse struct {
	Version ConfigVersion `json:"version"`
}

GetVersionResponse represents the response for a specific config version

type Handler

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

func NewHandler

func NewHandler(service *Service) *Handler

func (*Handler) GetVersion

func (h *Handler) GetVersion(c *gin.Context)

GetVersion handles the config version detail request

func (*Handler) ListVersions

func (h *Handler) ListVersions(c *gin.Context)

ListVersions handles the config versions list request

func (*Handler) Upsert

func (h *Handler) Upsert(c *gin.Context)

Upsert handles the config create/update request

type ListVersionsRequest

type ListVersionsRequest struct {
	Key string `form:"key"` // config key
}

ListVersionsRequest represents the request to list config versions

type ListVersionsResponse

type ListVersionsResponse struct {
	Key      string              `json:"key"`
	Total    int                 `json:"total"`
	Versions []ConfigVersionItem `json:"versions"`
}

ListVersionsResponse represents the response with config versions list

type Service

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

func NewService

func NewService(svcCtx *svc.ServiceContext) *Service

func (*Service) GetVersion

func (s *Service) GetVersion(ctx context.Context, req *GetVersionRequest) (*GetVersionResponse, error)

GetVersion retrieves a specific version of a config

func (*Service) ListVersions

func (s *Service) ListVersions(ctx context.Context, req *ListVersionsRequest) (*ListVersionsResponse, error)

ListVersions retrieves all versions for a given config key

func (*Service) Upsert

func (s *Service) Upsert(ctx context.Context, req *UpsertRequest) (*UpsertResponse, error)

Upsert creates or updates a config value

type UpsertRequest

type UpsertRequest struct {
	Key   string `json:"key"`   // config key
	Value string `json:"value"` // config value
}

UpsertRequest represents the request to create or update a config

type UpsertResponse

type UpsertResponse struct {
	Version ConfigVersion `json:"version"`
}

UpsertResponse represents the response for config upsert

Jump to

Keyboard shortcuts

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