MCPcopy Create free account
hub / github.com/aiprodcoder/MIXAPI / GetAllChannels

Function GetAllChannels

model/channel.go:239–252  ·  view source on GitHub ↗
(startIdx int, num int, selectAll bool, idSort bool)

Source from the content-addressed store, hash-verified

237}
238
239func GetAllChannels(startIdx int, num int, selectAll bool, idSort bool) ([]*Channel, error) {
240 var channels []*Channel
241 var err error
242 order := "priority desc"
243 if idSort {
244 order = "id desc"
245 }
246 if selectAll {
247 err = DB.Order(order).Find(&channels).Error
248 } else {
249 err = DB.Order(order).Limit(num).Offset(startIdx).Omit("key").Find(&channels).Error
250 }
251 return channels, err
252}
253
254func GetChannelsByTag(tag string, idSort bool) ([]*Channel, error) {
255 var channels []*Channel

Callers 4

testAllChannelsFunction · 0.92
ExportChannelsFunction · 0.92
GetSyncableChannelsFunction · 0.92
updateAllChannelsBalanceFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected