// DisconnectFromSwitch 指定のインデックス位置のNICをスイッチから切断
969852
func (api *VPCRouterAPI) DisconnectFromSwitch(id int64, nicIndex int) (bool, error) {
	var (
		method = "DELETE"
		uri    = fmt.Sprintf("%s/%d/interface/%d/to/switch", api.getResourceURL(), id, nicIndex)
	)
	return api.modify(method, uri, nil)
}
125056
func (cs *connSwitch) Close() error {
	cs.mu.Lock()
	defer cs.mu.Unlock()
	if cs.c == nil {
		return ErrNotConnected
	}
	err := cs.c.Close()
	cs.c = nil
	return err
}
1360102
func (eng *Engine) Disconnect(err error) {
	_ = eng.Inject(func() { eng.disconnect(err) })
	<-eng.running
}
834191
func (a *Adaptor) Disconnect() error {
	if a.connected {
		if e := a.sp.Close(); e != nil {
			return e
		}
		a.connected = false
	}
	return nil
}
1018959
func (db *DB) Disconnect() error {
	if db.connection != nil {
		if err := db.connection.Close(); err != nil {
			return err
		}
		db.connection = nil
		db.cache = make(map[string]*sql.Stmt)
	}
	return nil
}
1078614
func (t *tree) parseSwitch(token item, end itemType) ast.Node {
	const ctx = "switch"
	var switchValue = t.parseExpr(0)
	t.expect(itemRightDelim, ctx)

	var cases []*ast.SwitchCaseNode
	for {
		switch tok := t.next(); tok.typ {
		case itemLeftDelim:
		case itemText: // ignore spaces between tags. text is an error though.
			if allSpace(tok.val) {
				continue
			}
			t.unexpected(tok, "between switch cases")
		case itemCase, itemDefault:
			cases = append(cases, t.parseCase(tok))
		case end:
			t.expect(itemRightDelim, ctx)
			return &ast.SwitchNode{token.pos, switchValue, cases}
		}
	}
}
805174
func (l Listener) OnDisconnect(e *gumble.DisconnectEvent) {
	if l.Disconnect != nil {
		l.Disconnect(e)
	}
}
1029926
func (a *vppClient) Disconnect() error {
	globalVppClient = nil

	rc := C.govpp_disconnect()
	if rc != 0 {
		return fmt.Errorf("disconnecting from VPP binary API failed (rc=%v)", rc)
	}

	return nil
}
448407
func (c *Client) ForceDisconnect() {
	if !c.IsConnected() {
		WARN.Println(CLI, "already disconnected")
		return
	}
	c.setConnected(false)
	c.conn.Close()
	DEBUG.Println(CLI, "forcefully disconnecting")
	c.disconnect()
}
226462
func (h *Handle) DevLinkSetEswitchMode(Dev *DevlinkDevice, NewMode string) error {
	mode, err := eswitchStringToMode(NewMode)
	if err != nil {
		return err
	}

	_, req, err := h.createCmdReq(nl.DEVLINK_CMD_ESWITCH_SET, Dev.BusName, Dev.DeviceName)
	if err != nil {
		return err
	}

	req.AddData(nl.NewRtAttr(nl.DEVLINK_ATTR_ESWITCH_MODE, nl.Uint16Attr(mode)))

	_, err = req.Execute(unix.NETLINK_GENERIC, 0)
	return err
}
143396
func (s *BigSwitchBCFService) NewDeleteBigSwitchBcfDeviceParams(bcfdeviceid string) *DeleteBigSwitchBcfDeviceParams {
	p := &DeleteBigSwitchBcfDeviceParams{}
	p.p = make(map[string]interface{})
	p.p["bcfdeviceid"] = bcfdeviceid
	return p
}
1374258
func (r *recorder) Disconnect(server string, id uint64) {
	r.mu.Lock()
	defer r.mu.Unlock()
	if !r.enabled {
		return
	}

	if pos := r.findIndex(server, id); pos >= 0 {
		if pos == 0 {
			r.entries = r.entries[1:]
		} else {
			r.entries = append(r.entries[0:pos], r.entries[pos+1:]...)
		}
	}
}
999991
func (daemon *Daemon) DisconnectFromNetwork(container *container.Container, networkName string, force bool) error {
	n, err := daemon.FindNetwork(networkName)
	container.Lock()
	defer container.Unlock()

	if !container.Running || (err != nil && force) {
		if container.RemovalInProgress || container.Dead {
			return errRemovalContainer(container.ID)
		}
		// In case networkName is resolved we will use n.Name()
		// this will cover the case where network id is passed.
		if n != nil {
			networkName = n.Name()
		}
		if _, ok := container.NetworkSettings.Networks[networkName]; !ok {
			return fmt.Errorf("container %s is not connected to the network %s", container.ID, networkName)
		}
		delete(container.NetworkSettings.Networks, networkName)
	} else if err == nil {
		if container.HostConfig.NetworkMode.IsHost() && containertypes.NetworkMode(n.Type()).IsHost() {
			return runconfig.ErrConflictHostNetwork
		}

		if err := daemon.disconnectFromNetwork(container, n, false); err != nil {
			return err
		}
	} else {
		return err
	}

	if err := container.CheckpointTo(daemon.containersReplica); err != nil {
		return err
	}

	if n != nil {
		daemon.LogNetworkEventWithAttributes(n, "disconnect", map[string]string{
			"container": container.ID,
		})
	}

	return nil
}
967666
func (c *Communicator) Disconnect() error {
	c.lock.Lock()
	defer c.lock.Unlock()

	if c.cancelKeepAlive != nil {
		c.cancelKeepAlive()
	}

	if c.config.sshAgent != nil {
		if err := c.config.sshAgent.Close(); err != nil {
			return err
		}
	}

	if c.conn != nil {
		conn := c.conn
		c.conn = nil
		return conn.Close()
	}

	return nil
}
32416
func (o HostNetworkSystem) RemoveVirtualSwitch(ctx context.Context, vswitchName string) error {
	req := types.RemoveVirtualSwitch{
		This:        o.Reference(),
		VswitchName: vswitchName,
	}

	_, err := methods.RemoveVirtualSwitch(ctx, o.c, &req)
	if err != nil {
		return err
	}

	return nil
}
950289
func (c *Client) Disconnect() error {
	if c.State() == StateDisconnected {
		return errors.New("gumble: client is already disconnected")
	}
	c.disconnectEvent.Type = DisconnectUser
	c.Conn.Close()
	return nil
}
1116877
func (c *Client) disconnectChan() <-chan struct{} {
	c.mtx.Lock()
	ch := c.disconnect
	c.mtx.Unlock()
	return ch
}