MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / GetSettingItemsByGroup

Function GetSettingItemsByGroup

internal/op/setting.go:114–128  ·  view source on GitHub ↗
(group int)

Source from the content-addressed store, hash-verified

112}
113
114func GetSettingItemsByGroup(group int) ([]model.SettingItem, error) {
115 key := fmt.Sprintf("GROUP_%d", group)
116 if items, exists := Cache.GetSettingGroup(key); exists {
117 return items, nil
118 }
119 items, err, _ := settingGroupG.Do(key, func() ([]model.SettingItem, error) {
120 _items, err := db.GetSettingItemsByGroup(group)
121 if err != nil {
122 return nil, err
123 }
124 settingGroupCacheF(key, _items)
125 return _items, nil
126 })
127 return items, err
128}
129
130func GetSettingItemsInGroups(groups []int) ([]model.SettingItem, error) {
131 sort.Ints(groups)

Callers

nothing calls this directly

Calls 3

GetSettingItemsByGroupFunction · 0.92
GetSettingGroupMethod · 0.80
DoMethod · 0.65

Tested by

no test coverage detected