cmd

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: Apache-2.0 Imports: 17 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorBindHttp = errors.New("main_cfg:" +
	" couchbase cfg needs network/IP address for bindHttp,\n" +
	"  Please specify a network/IP address for the -bindHttp parameter\n" +
	"  (non-loopback, non-127.0.0.1/localhost, non-0.0.0.0)\n" +
	"  so that this node can be clustered with other nodes.")

Functions

func DumpOnSignal

func DumpOnSignal(signals ...os.Signal)

func DumpOnSignalForPlatform

func DumpOnSignalForPlatform()

func Failover

func Failover(cfg cbgt.Cfg, version string, server string,
	options map[string]string, nodesFailover []string) (bool, error)

Failover promotes replicas to primary for the remaining nodes.

func LogFlags

func LogFlags(flagAliases map[string][]string)

func MainCfg

func MainCfg(baseName, connect, bindHttp,
	register, dataDir string) (cbgt.Cfg, error)

MainCfg connects to a Cfg provider as a server peer (e.g., as a cbgt.Manager).

func MainCfgCB

func MainCfgCB(baseName, urlStr, bindHttp, register, dataDir string) (
	cbgt.Cfg, error)

func MainCfgClient

func MainCfgClient(baseName, cfgConnect string) (cbgt.Cfg, error)

MainCfgClient helper function connects to a Cfg provider as a client (not as a known cbgt.Manager server or peer). This is useful, for example, for tool developers as opposed to server developers.

func MainCfgEx

func MainCfgEx(baseName, connect, bindHttp,
	register, dataDir, uuid string, options map[string]string) (cbgt.Cfg, error)

MainCfgEx connects to a Cfg provider as a server peer (e.g., as a cbgt.Manager), with more options.

func MainCfgMetaKv

func MainCfgMetaKv(baseName, urlStr, bindHttp, register, dataDir, uuid string,
	options map[string]string) (
	cbgt.Cfg, error)

func MainCfgSimple

func MainCfgSimple(baseName, connect, bindHttp, register, dataDir string) (
	cbgt.Cfg, error)

func MainCommon

func MainCommon(version string, flagAliases map[string][]string)

func MainUUID

func MainUUID(baseName, dataDir string) (string, error)

MainUUID is a helper function for cmd-line tool developers, that reuses a previous "baseName.uuid" file from the dataDir if it exists, or generates a brand new UUID (and persists it).

func ParseOptions

func ParseOptions(optionKVs string, envName string,
	options map[string]string) map[string]string

ParseOptions parses an options string and environment variable. The optionKVs string is a comma-separated string formated as "key=val,key=val,...".

func ParseOptionsBool

func ParseOptionsBool(options map[string]string, name, suffix string,
	defaultVal bool) bool

ParseOptionsBool parses the options "name-suffix" and then "name" as boolean (strconv.ParseBool), otherwise returns defaultVal.

func PlannerSteps

func PlannerSteps(steps map[string]bool,
	cfg cbgt.Cfg, version, server string, options map[string]string,
	nodesRemove []string, dryRun bool, plannerFilter cbgt.PlannerFilter) error

PlannerSteps helps command-line tools implement the planner steps: * "unregister" - unregisters nodesRemove from the cfg. * "planner" - runs the planner to save a new plan into the cfg. * "failover" - a composite step, comprised of "unregister" and "failover_". * "failover_" - processes the nodesRemove as nodes to be failover'ed.

The "NODES-REMOVE-ALL" step overrides the nodesRemove with every known and wanted node. This can have a lot of impact, and was meant to be used for cluster cleanup/purging situations.

func RegisterIndexTypes

func RegisterIndexTypes(indexTypes []string)

The user may have informed the cmd about application specific index types, which we need to register (albeit with fake, "error-only" implementations) because the cbgt's planner (cbgt.CalcPlan()) has safety checks which skips any unknown, unregistered index types.

Types

This section is empty.

Directories

Path Synopsis
A fake or mock metakv server for dev/testing purposes.
A fake or mock metakv server for dev/testing purposes.

Jump to

Keyboard shortcuts

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