本文整理汇总了Golang中github.com/contiv/netplugin/drivers.OvsCfgNetworkState类的典型用法代码示例。如果您正苦于以下问题:Golang OvsCfgNetworkState类的具体用法?Golang OvsCfgNetworkState怎么用?Golang OvsCfgNetworkState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OvsCfgNetworkState类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: handleNetworkEvents
func handleNetworkEvents(netPlugin *plugin.NetPlugin, crt *crt.CRT,
opts cliOpts, retErr chan error) {
rsps := make(chan core.WatchState)
go processStateEvent(netPlugin, crt, opts, rsps)
cfg := drivers.OvsCfgNetworkState{}
cfg.StateDriver = netPlugin.StateDriver
retErr <- cfg.WatchAll(rsps)
return
}
示例2: networks
// XXX: This function should be returning logical state instead of driver state
func (d *daemon) networks(id string) ([]core.State, error) {
var (
err error
nw *drivers.OvsCfgNetworkState
)
nw = &drivers.OvsCfgNetworkState{}
if nw.StateDriver, err = utils.GetStateDriver(); err != nil {
return nil, err
}
if id == "all" {
return nw.ReadAll()
} else if err := nw.Read(id); err == nil {
return []core.State{core.State(nw)}, nil
}
return nil, core.Errorf("Unexpected code path")
}