Documentation ¶
Index ¶
- func DecodeCommandPacket(data []byte) (interface{}, error)
- func EncodeCommandPacket(command interface{}) ([]byte, error)
- type Client
- type CmdAddBucket
- type CmdAddedBucket
- type CmdCreateCluster
- type CmdCreatedCluster
- type CmdEndTest
- type CmdEndTesting
- type CmdEndedTest
- type CmdEndedTesting
- type CmdHello
- type CmdStartTest
- type CmdStartTesting
- type CmdStartedTest
- type CmdStartedTesting
- type CmdTimeTravel
- type CmdTimeTravelled
- type ConnectAsServerOptions
- type HandlerFunc
- type NewServerOptions
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeCommandPacket ¶
DecodeCommandPacket decodes a packet from bytes to a structure.
func EncodeCommandPacket ¶
EncodeCommandPacket encodes a packet from a structure to bytes bytes.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a connected client.
func ConnectAsServer ¶
func ConnectAsServer(opts ConnectAsServerOptions) (*Client, error)
ConnectAsServer creates a new API client connection, but acts as if we are the server-side. This is used so the client can kill this process automatically.
func (*Client) WaitForClose ¶
func (c *Client) WaitForClose()
WaitForClose will wait until this client disconnects
type CmdAddBucket ¶
type CmdAddBucket struct { ClusterID string `json:"cluster"` BucketName string `json:"name"` NumReplicas uint `json:"replicas"` BucketType string `json:"bucket_type"` }
CmdAddBucket requests a new mock bucket be created.
type CmdAddedBucket ¶
type CmdAddedBucket struct { }
CmdAddedBucket represents the reply to an add bucket request.
type CmdCreateCluster ¶
type CmdCreateCluster struct {
ClusterID string `json:"id"`
}
CmdCreateCluster requests a new mock cluster be created.
type CmdCreatedCluster ¶
type CmdCreatedCluster struct { MgmtAddrs []string `json:"mgmt_addrs"` ConnStr string `json:"connstr"` }
CmdCreatedCluster represents the reply to a create cluster request.
type CmdEndTest ¶
type CmdEndTest struct { RunID string `json:"run"` Result interface{} }
CmdEndTest indicates to end a particular test.
type CmdEndTesting ¶
type CmdEndTesting struct {
RunID string `json:"run"`
}
CmdEndTesting indicates to stop a particular report.
type CmdEndedTest ¶
type CmdEndedTest struct {
Error string
}
CmdEndedTest is returned when a test has been stopped.
type CmdEndedTesting ¶
type CmdEndedTesting struct {
Report interface{} `json:"report"`
}
CmdEndedTesting indicates a particular report has ended.
type CmdStartTest ¶
CmdStartTest indicates to start a particular test.
type CmdStartTesting ¶
CmdStartTesting indicates to start a new report.
type CmdStartedTest ¶
type CmdStartedTest struct { ConnStr string `json:"connstr"` BucketName string `json:"bucket"` ScopeName string `json:"scope"` CollectionName string `json:"collection"` }
CmdStartedTest is returned when a test has been started.
type CmdStartedTesting ¶
type CmdStartedTesting struct { MgmtAddrs []string `json:"mgmt_addrs"` ConnStr string `json:"connstr"` }
CmdStartedTesting indicates a new report was started.
type CmdTimeTravel ¶
type CmdTimeTravel struct { RunID string `json:"run"` ClusterID string `json:"cluster"` Amount uint64 `json:"amount_ms"` }
CmdTimeTravel allows a test run or cluster to be time travelled.
type CmdTimeTravelled ¶
type CmdTimeTravelled struct { }
CmdTimeTravelled represents a reply to time travelling.
type ConnectAsServerOptions ¶
type ConnectAsServerOptions struct { Address string Handler HandlerFunc }
ConnectAsServerOptions provides options when creating an API client.
type HandlerFunc ¶
type HandlerFunc func(command interface{}) interface{}
HandlerFunc provides an interface for handling and replying to messages received via the API server.
type NewServerOptions ¶
type NewServerOptions struct { ListenPort int Handler HandlerFunc }
NewServerOptions provides options when creating an API server.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents an instance of the API server.
func NewServer ¶
func NewServer(opts NewServerOptions) (*Server, error)
NewServer creates a new API server.
func (*Server) ListenPort ¶
ListenPort returns the port this server is listening on.