Documentation ¶
Index ¶
- type Cluster
- func (c *Cluster) CreateFile(fileName string, node int) (*os.File, error)
- func (c *Cluster) DeleteFile(fileName string, node int) error
- func (c *Cluster) Destroy() error
- func (c *Cluster) FileContains(fileName string, contents []byte) Diff
- func (c *Cluster) FileDoesntExist(fileName string) Diff
- func (c *Cluster) FileExists(fileName string) Diff
- func (c *Cluster) OpenFile(fileName string, node int) (*os.File, error)
- func (c *Cluster) RenameFile(fileName, newName string, node int) error
- func (c *Cluster) Start() error
- func (c *Cluster) StartNode(node int) error
- func (c *Cluster) StopNode(node int) error
- func (c *Cluster) WaitReady(duration time.Duration) error
- type Diff
- type Node
- func (n *Node) CreateFile(fileName string) (*os.File, error)
- func (n *Node) DeleteFile(fileName string) error
- func (n *Node) Destroy() error
- func (n *Node) FileDiff(fileName string, contents []byte) Diff
- func (n *Node) FileDoesntExist(fileName string) Diff
- func (n *Node) FileExists(fileName string) Diff
- func (n *Node) OpenFile(fileName string) (*os.File, error)
- func (n *Node) Ready() <-chan struct{}
- func (n *Node) RenameFile(fileName, newName string) error
- func (n *Node) Start() error
- func (n *Node) Stop() error
- func (n *Node) Stopped() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func NewCluster ¶
func (*Cluster) CreateFile ¶
CreateFIle creates a file for reading and writing with the node with index node (which starts from 0).
func (*Cluster) FileContains ¶
FileContains checks if all the nodes in the cluster have the same contents for a file. If the files aren't consistent with what is expected within the checkTimout, an error is returned.
func (*Cluster) FileDoesntExist ¶
func (*Cluster) FileExists ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func NewNode ¶
NewNode returns a node that uses the spork binary to run nodes. The binary's stdout & stderr are redirected into out.
func (*Node) DeleteFile ¶
func (*Node) FileDoesntExist ¶
func (*Node) FileExists ¶
func (*Node) Ready ¶
func (n *Node) Ready() <-chan struct{}
Ready returns a channel that will be closed iff the node hasn't had any log activity in the last two seconds (= activityTimeout)
func (*Node) RenameFile ¶
Click to show internal directories.
Click to hide internal directories.