本文整理匯總了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")
}