Documentation ¶
Index ¶
- func Register(tenant string, namespace *Namespace) error
- func Unregister(tenant, namespace string) error
- type Command
- func RemoveDB(group, id string) Command
- func RemoveGroup(group string) Command
- func RemoveNode(group, node string) Command
- func UpdateParameters(parameters config.ParametersMap) Command
- func UpdateRule(rule *rule.Rule) Command
- func UpdateSlowLogger(path string, cfg *log.Config) Command
- func UpdateSlowThreshold() Command
- func UpdateWeight(group, id string, weight proto.Weight) Command
- func UpsertDB(group string, ds proto.DB) Command
- type Namespace
- func (ns *Namespace) Close() error
- func (ns *Namespace) DB(ctx context.Context, group string) proto.DB
- func (ns *Namespace) DB0(ctx context.Context) proto.DB
- func (ns *Namespace) DBGroups() []string
- func (ns *Namespace) DBMaster(_ context.Context, group string) proto.DB
- func (ns *Namespace) DBSlave(_ context.Context, group string) proto.DB
- func (ns *Namespace) DBs(group string) []proto.DB
- func (ns *Namespace) EnqueueCommand(cmd Command) error
- func (ns *Namespace) Name() string
- func (ns *Namespace) Parameters() config.ParametersMap
- func (ns *Namespace) Rule() *rule.Rule
- func (ns *Namespace) SlowLogger() log.Logger
- func (ns *Namespace) SlowThreshold() time.Duration
- func (ns *Namespace) SysDB() proto.DB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Unregister ¶
Unregister unregisters a namespace.
Types ¶
type Command ¶
Command represents the command to control Namespace.
func RemoveGroup ¶
RemoveGroup returns a command to remove an existing DB group.
func RemoveNode ¶
RemoveNode returns a command to remove an existing node from namespace.
func UpdateParameters ¶
func UpdateParameters(parameters config.ParametersMap) Command
func UpdateSlowThreshold ¶
func UpdateSlowThreshold() Command
func UpdateWeight ¶
UpdateWeight returns a command to update the weight of DB.
type Namespace ¶
Namespace represents a logical database with all resources.
func (*Namespace) EnqueueCommand ¶
EnqueueCommand enqueues the next command, it will be executed async.
func (*Namespace) Parameters ¶
func (ns *Namespace) Parameters() config.ParametersMap
func (*Namespace) SlowLogger ¶
func (*Namespace) SlowThreshold ¶
Click to show internal directories.
Click to hide internal directories.