Documentation ¶
Overview ¶
Package vtctld contains all the code to expose a vtctld server based on the provided topo.Server.
Package vtctld contains all the code to expose a vtctld server based on the provided topo.Server.
Index ¶
- func InitVtctld(ts *topo.Server) error
- func RegisterDebugHealthHandler(ts *topo.Server)
- type ActionRepository
- func (ar *ActionRepository) ApplyKeyspaceAction(ctx context.Context, actionName, keyspace string) *ActionResult
- func (ar *ActionRepository) ApplyShardAction(ctx context.Context, actionName, keyspace, shard string) *ActionResult
- func (ar *ActionRepository) ApplyTabletAction(ctx context.Context, actionName string, tabletAlias *topodatapb.TabletAlias, ...) *ActionResult
- func (ar *ActionRepository) RegisterKeyspaceAction(name string, method actionKeyspaceMethod)
- func (ar *ActionRepository) RegisterShardAction(name string, method actionShardMethod)
- func (ar *ActionRepository) RegisterTabletAction(name, role string, method actionTabletMethod)
- type ActionResult
- type Result
- type TabletStats
- type TabletWithStatsAndURL
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitVtctld ¶
InitVtctld initializes all the vtctld functionality.
func RegisterDebugHealthHandler ¶
RegisterDebugHealthHandler register a debug health http endpoint for a vtcld server
Types ¶
type ActionRepository ¶
type ActionRepository struct {
// contains filtered or unexported fields
}
ActionRepository is a repository of actions that can be performed on a {Keyspace,Shard,Tablet}.
func NewActionRepository ¶
func NewActionRepository(ts *topo.Server) *ActionRepository
NewActionRepository creates and returns a new ActionRepository, with no actions.
func (*ActionRepository) ApplyKeyspaceAction ¶
func (ar *ActionRepository) ApplyKeyspaceAction(ctx context.Context, actionName, keyspace string) *ActionResult
ApplyKeyspaceAction applies the provided action to the keyspace.
func (*ActionRepository) ApplyShardAction ¶
func (ar *ActionRepository) ApplyShardAction(ctx context.Context, actionName, keyspace, shard string) *ActionResult
ApplyShardAction applies the provided action to the shard.
func (*ActionRepository) ApplyTabletAction ¶
func (ar *ActionRepository) ApplyTabletAction(ctx context.Context, actionName string, tabletAlias *topodatapb.TabletAlias, r *http.Request) *ActionResult
ApplyTabletAction applies the provided action to the tablet.
func (*ActionRepository) RegisterKeyspaceAction ¶
func (ar *ActionRepository) RegisterKeyspaceAction(name string, method actionKeyspaceMethod)
RegisterKeyspaceAction registers a new action on a keyspace.
func (*ActionRepository) RegisterShardAction ¶
func (ar *ActionRepository) RegisterShardAction(name string, method actionShardMethod)
RegisterShardAction registers a new action on a shard.
func (*ActionRepository) RegisterTabletAction ¶
func (ar *ActionRepository) RegisterTabletAction(name, role string, method actionTabletMethod)
RegisterTabletAction registers a new action on a tablet.
type ActionResult ¶
ActionResult contains the result of an action. If Error, the action failed.
type Result ¶
Result is what the backendExplorer returns. It represents one directory node. It is exported so the JSON encoder can print it.
type TabletStats ¶ added in v0.8.0
type TabletStats struct { LastError string `json:"last_error,omitempty"` Realtime *querypb.RealtimeStats `json:"realtime,omitempty"` Serving bool `json:"serving"` Up bool `json:"up"` }
TabletStats represents realtime stats from a discovery.TabletHealth struct.
type TabletWithStatsAndURL ¶ added in v0.8.0
type TabletWithStatsAndURL struct { Alias *topodatapb.TabletAlias `json:"alias,omitempty"` Hostname string `json:"hostname,omitempty"` PortMap map[string]int32 `json:"port_map,omitempty"` Keyspace string `json:"keyspace,omitempty"` Shard string `json:"shard,omitempty"` KeyRange *topodatapb.KeyRange `json:"key_range,omitempty"` Type topodatapb.TabletType `json:"type,omitempty"` DbNameOverride string `json:"db_name_override,omitempty"` Tags map[string]string `json:"tags,omitempty"` MysqlHostname string `json:"mysql_hostname,omitempty"` MysqlPort int32 `json:"mysql_port,omitempty"` PrimaryTermStartTime *vttime.Time `json:"primary_term_start_time,omitempty"` Stats *TabletStats `json:"stats,omitempty"` URL string `json:"url,omitempty"` }
TabletWithStatsAndURL wraps topo.Tablet, adding a URL property and optional realtime stats.