cs-codex-dist-tests/CodexDistTestCore/OnlineCodexNodes.cs

34 lines
793 B
C#
Raw Normal View History

2023-03-21 14:17:48 +00:00
namespace CodexDistTestCore
{
public interface IOnlineCodexNodes
{
IOfflineCodexNodes BringOffline();
IOnlineCodexNode this[int index] { get; }
}
public class OnlineCodexNodes : IOnlineCodexNodes
{
private readonly IK8sManager k8SManager;
private readonly IOnlineCodexNode[] nodes;
public OnlineCodexNodes(IK8sManager k8SManager, IOnlineCodexNode[] nodes)
{
this.k8SManager = k8SManager;
this.nodes = nodes;
}
public IOnlineCodexNode this[int index]
{
get
{
return nodes[index];
}
}
public IOfflineCodexNodes BringOffline()
{
return k8SManager.BringOffline(this);
}
}
}