本文整理匯總了Golang中github.com/containernetworking/cni/pkg/skel.PluginMain函數的典型用法代碼示例。如果您正苦於以下問題:Golang PluginMain函數的具體用法?Golang PluginMain怎麽用?Golang PluginMain使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了PluginMain函數的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: main
func main() {
if len(os.Args) > 1 && os.Args[1] == "daemon" {
runDaemon()
} else {
skel.PluginMain(cmdAdd, cmdDel)
}
}
示例2: main
func main() {
// Display the version on "-v", otherwise just delegate to the skel code.
// Use a new flag set so as not to conflict with existing libraries which use "flag"
flagSet := flag.NewFlagSet("calico-ipam", flag.ExitOnError)
version := flagSet.Bool("v", false, "Display version")
err := flagSet.Parse(os.Args[1:])
if err != nil {
fmt.Println(err)
os.Exit(1)
}
if *version {
fmt.Println(VERSION)
os.Exit(0)
}
skel.PluginMain(cmdAdd, cmdDel)
}
示例3: main
func main() {
skel.PluginMain(cmdAdd, cmdDel, version.Legacy)
}
示例4: main
func main() {
skel.PluginMain(cmdAdd, cmdDel)
}
示例5: main
func main() {
rand.Seed(time.Now().UTC().UnixNano())
p := NewCNIPlugin(cniserver.CNIServerSocketPath)
skel.PluginMain(p.skelCmdAdd, p.CmdDel, version.Legacy)
}
示例6: main
func main() {
p := NewCNIPlugin(cniserver.CNIServerSocketPath)
skel.PluginMain(p.skelCmdAdd, p.CmdDel, version.Legacy)
}
示例7: main
func main() {
skel.PluginMain(cmdAdd, cmdDel, version.PluginSupports("0.1.0", "0.2.0"))
}