GetAll 获取所有负载列表
()
| 119 | |
| 120 | //GetAll 获取所有负载列表 |
| 121 | func 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 删除负载 |
| 141 | func Delete(name string) (string, error) { |
nothing calls this directly
no test coverage detected