Documentation
¶
Index ¶
- Constants
- func ConfigureReplication(t *testing.T, rx *reindexer.Reindexer, role string, ns []string, ...)
- func CreateCluster(t *testing.T, servers []*TestServer, nsName string, nsItem interface{})
- func CreateReplication(t *testing.T, master *TestServer, slaves []*TestServer, nsName string, ...)
- func WaitForSyncWithMaster(t *testing.T, master *reindexer.Reindexer, slave *reindexer.Reindexer)
- func WriteShardingConfig(t *testing.T, cfg *TestShardingConfig)
- type ClusterConf
- type ClusterNodeConfig
- type ReplicationConf
- type TestServer
- func (srv *TestServer) Clean() error
- func (srv *TestServer) DB() *reindexer.Reindexer
- func (srv *TestServer) GetDSN() string
- func (srv *TestServer) GetDbName() string
- func (srv *TestServer) GetFullStoragePath() string
- func (srv *TestServer) GetHttpAddr() string
- func (srv *TestServer) GetRpcAddr() string
- func (srv *TestServer) Run() error
- func (srv *TestServer) Stop() error
- type TestShardConfig
- type TestShardKeyConfig
- type TestShardedNamespaceConfig
- type TestShardingConfig
- type TestShardingSerializableConfig
Constants ¶
View Source
const ( ServerTypeStandalone = "standalone" ServerTypeBuiltin = "builtin" )
Variables ¶
This section is empty.
Functions ¶
func ConfigureReplication ¶
func CreateCluster ¶
func CreateCluster(t *testing.T, servers []*TestServer, nsName string, nsItem interface{})
func CreateReplication ¶
func CreateReplication(t *testing.T, master *TestServer, slaves []*TestServer, nsName string, nsItem interface{})
func WaitForSyncWithMaster ¶
func WriteShardingConfig ¶
func WriteShardingConfig(t *testing.T, cfg *TestShardingConfig)
Types ¶
type ClusterConf ¶
type ClusterConf struct { AppName string `yaml:"app_name"` Namespaces []string `yaml:"namespaces"` UpdatesTimeoutSec int `yaml:"updates_timeout_sec"` EnableCompression bool `yaml:"enable_compression"` SyncThreads int `yaml:"sync_threads"` SyncsPerThread int `yaml:"syncs_per_thread"` RetrySyncIntervalMsec int `yaml:"retry_sync_interval_msec"` Nodes []ClusterNodeConfig `yaml:"nodes"` }
func DefaultClusterConf ¶
func DefaultClusterConf() *ClusterConf
func (*ClusterConf) ToFile ¶
func (cc *ClusterConf) ToFile(path, filename string) error
type ClusterNodeConfig ¶
type ReplicationConf ¶
func (*ReplicationConf) ToFile ¶
func (rc *ReplicationConf) ToFile(path, filename string) error
type TestServer ¶
type TestServer struct { T *testing.T RpcPort string HttpPort string DbName string SrvType string EnableCluster bool // contains filtered or unexported fields }
func (*TestServer) Clean ¶
func (srv *TestServer) Clean() error
func (*TestServer) DB ¶
func (srv *TestServer) DB() *reindexer.Reindexer
func (*TestServer) GetDSN ¶
func (srv *TestServer) GetDSN() string
func (*TestServer) GetDbName ¶
func (srv *TestServer) GetDbName() string
func (*TestServer) GetFullStoragePath ¶
func (srv *TestServer) GetFullStoragePath() string
func (*TestServer) GetHttpAddr ¶
func (srv *TestServer) GetHttpAddr() string
func (*TestServer) GetRpcAddr ¶
func (srv *TestServer) GetRpcAddr() string
func (*TestServer) Run ¶
func (srv *TestServer) Run() error
func (*TestServer) Stop ¶
func (srv *TestServer) Stop() error
type TestShardConfig ¶
type TestShardConfig struct { ShardID int `yaml:"shard_id"` DSNS []yaml.Node `yaml:"dsns"` }
type TestShardKeyConfig ¶
type TestShardedNamespaceConfig ¶
type TestShardedNamespaceConfig struct { Name string `yaml:"namespace"` DefaultShard int `yaml:"default_shard"` Index string `yaml:"index"` Keys []TestShardKeyConfig `yaml:"keys"` }
type TestShardingConfig ¶
type TestShardingConfig struct { Namespaces []TestShardedNamespaceConfig Shards []*TestServer }
type TestShardingSerializableConfig ¶
type TestShardingSerializableConfig struct { Version int `yaml:"version"` Namespaces []TestShardedNamespaceConfig `yaml:"namespaces"` Shards []TestShardConfig `yaml:"shards"` ThisShardID int `yaml:"this_shard_id"` }
Click to show internal directories.
Click to hide internal directories.