using Core; using KubernetesWorkflow; namespace CodexPlugin { public static class CoreInterfaceExtensions { public static RunningContainers[] StartCodexNodes(this CoreInterface ci, int number, Action setup) { return Plugin(ci).StartCodexNodes(number, setup); } public static ICodexNodeGroup WrapCodexContainers(this CoreInterface ci, RunningContainers[] containers) { return Plugin(ci).WrapCodexContainers(ci, containers); } public static ICodexNode SetupCodexNode(this CoreInterface ci) { return ci.SetupCodexNodes(1)[0]; } public static ICodexNode SetupCodexNode(this CoreInterface ci, Action setup) { return ci.SetupCodexNodes(1, setup)[0]; } public static ICodexNodeGroup SetupCodexNodes(this CoreInterface ci, int number, Action setup) { var rc = ci.StartCodexNodes(number, setup); var result = ci.WrapCodexContainers(rc); Plugin(ci).WireUpMarketplace(result, setup); return result; } public static ICodexNodeGroup SetupCodexNodes(this CoreInterface ci, int number) { return ci.SetupCodexNodes(number, s => { }); } private static CodexPlugin Plugin(CoreInterface ci) { return ci.GetPlugin(); } } }