MCPcopy
hub / github.com/eolinker/goku_lite / GetAll

Function GetAll

console/module/balance/balance.go:121–138  ·  view source on GitHub ↗

GetAll 获取所有负载列表

()

Source from the content-addressed store, hash-verified

119
120//GetAll 获取所有负载列表
121func GetAll() ([]*Info, error) {
122
123 entities, e := balanceDao.GetAll()
124 if e != nil {
125 return nil, e
126 }
127 infos := make([]*Info, 0, len(entities))
128 useBalances, _ := balanceDao.GetUseBalanceNames()
129 for _, ent := range entities {
130 if useBalances != nil {
131 if _, ok := useBalances[ent.Name]; ok {
132 ent.CanDelete = 0
133 }
134 }
135 infos = append(infos, ReadInfo(ent))
136 }
137 return infos, nil
138}
139
140//Delete 删除负载
141func Delete(name string) (string, error) {

Callers

nothing calls this directly

Calls 4

appendFunction · 0.85
ReadInfoFunction · 0.85
GetAllMethod · 0.65
GetUseBalanceNamesMethod · 0.65

Tested by

no test coverage detected