MCPcopy Create free account
hub / github.com/tbphp/gpt-load / GetGroupConfigOptions

Method GetGroupConfigOptions

internal/handler/group_handler.go:339–365  ·  view source on GitHub ↗

GetGroupConfigOptions returns a list of available configuration options for groups.

(c *gin.Context)

Source from the content-addressed store, hash-verified

337
338// GetGroupConfigOptions returns a list of available configuration options for groups.
339func (s *Server) GetGroupConfigOptions(c *gin.Context) {
340 options, err := s.GroupService.GetGroupConfigOptions()
341 if s.handleGroupError(c, err) {
342 return
343 }
344
345 translated := make([]ConfigOption, 0, len(options))
346 for _, option := range options {
347 name := option.Name
348 if strings.HasPrefix(name, "config.") {
349 name = i18n.Message(c, name)
350 }
351 description := option.Description
352 if strings.HasPrefix(description, "config.") {
353 description = i18n.Message(c, description)
354 }
355
356 translated = append(translated, ConfigOption{
357 Key: option.Key,
358 Name: name,
359 Description: description,
360 DefaultValue: option.DefaultValue,
361 })
362 }
363
364 response.Success(c, translated)
365}
366
367// calculateRequestStats is a helper to compute request statistics.
368func (s *Server) GetGroupStats(c *gin.Context) {

Callers

nothing calls this directly

Calls 3

handleGroupErrorMethod · 0.95
MessageFunction · 0.92
SuccessFunction · 0.92

Tested by

no test coverage detected