RemoveInterface 移除 Interface
(name string)
| 192 | |
| 193 | // RemoveInterface 移除 Interface |
| 194 | func (os *AsterOS) RemoveInterface(name string) error { |
| 195 | os.ifMu.Lock() |
| 196 | defer os.ifMu.Unlock() |
| 197 | |
| 198 | if _, exists := os.interfaces[name]; !exists { |
| 199 | return ErrInterfaceNotFound |
| 200 | } |
| 201 | |
| 202 | delete(os.interfaces, name) |
| 203 | return nil |
| 204 | } |
| 205 | |
| 206 | // Serve 启动 AsterOS |
| 207 | func (os *AsterOS) Serve() error { |