vtctld

package
v2.1.0-rc.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2017 License: BSD-3-Clause Imports: 38 Imported by: 0

Documentation

Overview

Package vtctld contains all the code to expose a vtctld server based on the provided topo.Server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeContent

func DecodeContent(filename string, data []byte) (string, error)

DecodeContent uses the filename to imply a type, and proto-decodes the right object, then echoes it as a string.

func HandleExplorer

func HandleExplorer(name string, exp explorer.Explorer)

HandleExplorer registers the Explorer under url, using the given template. It should be called by a plugin either from init() or from servenv.OnRun(). Only one Explorer can be registered in a given instance of vtctld.

func InitVtctld

func InitVtctld(ts topo.Server)

InitVtctld initializes all the vtctld functionnality.

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}. Note that the registered action methods will be passed an *http.Request on which ParseForm() has already succeeded.

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, r *http.Request) *ActionResult

ApplyKeyspaceAction applies the provided action to the keyspace.

func (*ActionRepository) ApplyShardAction

func (ar *ActionRepository) ApplyShardAction(ctx context.Context, actionName, keyspace, shard string, r *http.Request) *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

type ActionResult struct {
	Name       string
	Parameters string
	Output     string
	Error      bool
}

ActionResult contains the result of an action. If Error, the action failed.

type BackendExplorer

type BackendExplorer struct {
	// contains filtered or unexported fields
}

BackendExplorer is an Explorer implementation that only uses the Backend interface of a server Impl. Eventually, all topology implementations will use this.

FIXME(alainjobart) GetKnownCells is only on topo.Impl at the moment. Soon, when all topo implementations use the 'cells' subdirectory, then we can use topo.Backend, as intended.

func NewBackendExplorer

func NewBackendExplorer(backend topo.Impl) *BackendExplorer

NewBackendExplorer returns an Explorer implementation for topo.Backend.

func (*BackendExplorer) HandlePath

func (ex *BackendExplorer) HandlePath(nodePath string, r *http.Request) *explorer.Result

HandlePath is part of the Explorer interface

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL