2023-09-12 12:50:18 +00:00
|
|
|
|
using Core;
|
|
|
|
|
using KubernetesWorkflow;
|
|
|
|
|
|
|
|
|
|
namespace CodexPlugin
|
|
|
|
|
{
|
|
|
|
|
public static class CoreInterfaceExtensions
|
|
|
|
|
{
|
|
|
|
|
public static RunningContainers[] StartCodexNodes(this CoreInterface ci, int number, Action<ICodexSetup> setup)
|
|
|
|
|
{
|
|
|
|
|
return Plugin(ci).StartCodexNodes(number, setup);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static ICodexNodeGroup WrapCodexContainers(this CoreInterface ci, RunningContainers[] containers)
|
|
|
|
|
{
|
2023-09-19 11:58:45 +00:00
|
|
|
|
return Plugin(ci).WrapCodexContainers(ci, containers);
|
2023-09-12 12:50:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-19 09:51:59 +00:00
|
|
|
|
public static ICodexNode SetupCodexNode(this CoreInterface ci)
|
2023-09-12 13:43:30 +00:00
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
return ci.SetupCodexNodes(1)[0];
|
2023-09-12 13:43:30 +00:00
|
|
|
|
}
|
|
|
|
|
|
2023-09-19 09:51:59 +00:00
|
|
|
|
public static ICodexNode SetupCodexNode(this CoreInterface ci, Action<ICodexSetup> setup)
|
2023-09-12 12:50:18 +00:00
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
return ci.SetupCodexNodes(1, setup)[0];
|
2023-09-12 12:50:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static ICodexNodeGroup SetupCodexNodes(this CoreInterface ci, int number, Action<ICodexSetup> setup)
|
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
var rc = ci.StartCodexNodes(number, setup);
|
|
|
|
|
return ci.WrapCodexContainers(rc);
|
2023-09-12 12:50:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static ICodexNodeGroup SetupCodexNodes(this CoreInterface ci, int number)
|
|
|
|
|
{
|
2023-09-13 06:55:04 +00:00
|
|
|
|
return ci.SetupCodexNodes(number, s => { });
|
2023-09-12 12:50:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static CodexPlugin Plugin(CoreInterface ci)
|
|
|
|
|
{
|
|
|
|
|
return ci.GetPlugin<CodexPlugin>();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|