Documentation
¶
Index ¶
- type ConfigUpsertRequest
- type ConfigUpsertResponse
- type ConfigVersion
- type ConfigVersionDetailRequest
- type ConfigVersionDetailResponse
- type ConfigVersionItem
- type ConfigVersionsRequest
- type ConfigVersionsResponse
- type GetVersionRequest
- type GetVersionResponse
- type Handler
- type ListVersionsRequest
- type ListVersionsResponse
- type Service
- func (s *Service) GetVersion(ctx context.Context, req *GetVersionRequest) (*GetVersionResponse, error)
- func (s *Service) ListVersions(ctx context.Context, req *ListVersionsRequest) (*ListVersionsResponse, error)
- func (s *Service) Upsert(ctx context.Context, req *UpsertRequest) (*UpsertResponse, error)
- type UpsertRequest
- type UpsertResponse
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 (*Handler) GetVersion ¶
GetVersion handles the config version detail request
func (*Handler) ListVersions ¶
ListVersions handles the config versions list 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