Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) Cleanup(ctx context.Context) error
- func (c *Cluster) NewNodes(ctx context.Context, n int) (clusteriface.Nodes, error)
- func (c *Cluster) WithBaseImage(img string) *Cluster
- func (c *Cluster) WithCreateContainerConfig(f func(*CreateContainerConfig) error) *Cluster
- func (c *Cluster) WithLogger(l *zap.SugaredLogger) *Cluster
- func (c *Cluster) WithNodeAgentBin(p string) *Cluster
- type CreateContainerConfig
- type Node
- func (n *Node) Dial(ctx context.Context, network, addr string) (net.Conn, error)
- func (n *Node) ReadFile(ctx context.Context, path string) (io.ReadCloser, error)
- func (n *Node) SendFile(ctx context.Context, filePath string, contents io.Reader) error
- func (n *Node) StartProc(ctx context.Context, req clusteriface.StartProcRequest) (clusteriface.Process, error)
- func (n *Node) Stop(ctx context.Context) error
- func (n *Node) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Log *zap.SugaredLogger Certs *agent.Certs NodeAgentBin string BaseImage string ContainerPrefix string DockerClient *client.Client RemoveContainers bool CreateContainerConfig func(*CreateContainerConfig) error Nodes []*Node // contains filtered or unexported fields }
Cluster is a local Cluster that runs nodes as Docker containers. The underlying host must have a Docker daemon running. This supports standard environment variables for configuring the Docker client (DOCKER_HOST etc.).
func MustNewCluster ¶
func MustNewCluster() *Cluster
func NewCluster ¶
NewCluster creates a new local Docker cluster. By default, this looks for the node agent binary by searching up from PWD for a "nodeagent" file.
func (*Cluster) WithBaseImage ¶
func (*Cluster) WithCreateContainerConfig ¶
func (c *Cluster) WithCreateContainerConfig(f func(*CreateContainerConfig) error) *Cluster
func (*Cluster) WithLogger ¶
func (c *Cluster) WithLogger(l *zap.SugaredLogger) *Cluster
func (*Cluster) WithNodeAgentBin ¶
type CreateContainerConfig ¶
type CreateContainerConfig struct { Name string ContainerConfig *container.Config HostConfig *container.HostConfig NetworkingConfig *network.NetworkingConfig Platform *specs.Platform }
type Node ¶
type Node struct { ID int ContainerName string ContainerID string HostPort int Env map[string]string // contains filtered or unexported fields }
func (*Node) StartProc ¶
func (n *Node) StartProc(ctx context.Context, req clusteriface.StartProcRequest) (clusteriface.Process, error)
Click to show internal directories.
Click to hide internal directories.