MCPcopy Create free account
hub / github.com/astercloud/aster / AddInterface

Method AddInterface

pkg/asteros/asteros.go:180–191  ·  view source on GitHub ↗

AddInterface 添加 Interface

(iface Interface)

Source from the content-addressed store, hash-verified

178
179// AddInterface 添加 Interface
180func (os *AsterOS) AddInterface(iface Interface) error {
181 os.ifMu.Lock()
182 defer os.ifMu.Unlock()
183
184 name := iface.Name()
185 if _, exists := os.interfaces[name]; exists {
186 return ErrInterfaceExists
187 }
188
189 os.interfaces[name] = iface
190 return nil
191}
192
193// RemoveInterface 移除 Interface
194func (os *AsterOS) RemoveInterface(name string) error {

Callers 2

TestAddInterfaceFunction · 0.80
mainFunction · 0.80

Calls 1

NameMethod · 0.65

Tested by 1

TestAddInterfaceFunction · 0.64