querycmd

package
v0.0.0-...-b800c40 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2017 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Arg2Key

func Arg2Key(arg []byte) []interface{}

Arg2Key convert JSON string to golang-native.

func GetIndex

func GetIndex(
	client *qclient.GsiClient,
	bucket, indexName string) (*mclient.IndexMetadata, bool)

GetIndex for bucket/indexName.

func HandleCommand

func HandleCommand(
	client *qclient.GsiClient,
	cmd *Command,
	verbose bool,
	w io.Writer) (err error)

HandleCommand after parsing it with ParseArgs().

func WaitUntilIndexState

func WaitUntilIndexState(
	client *qclient.GsiClient, defnIDs []uint64,
	state c.IndexState, period, timeout time.Duration) ([]c.IndexState, error)

WaitUntilIndexState comes to desired `state`, retry for every `period` mS until `timeout` mS.

Types

type Command

type Command struct {
	OpType string
	// basic options.
	Server    string
	IndexName string
	Bucket    string
	AdminPort string
	QueryPort string
	Auth      string
	// options for create-index.
	Using     string
	ExprType  string
	PartnStr  string
	WhereStr  string
	SecStrs   []string
	IsPrimary bool
	With      string
	WithPlan  map[string]interface{}
	// options for build index
	Bindexes []string
	// options for Range, Statistics, Count
	Low         c.SecondaryKey
	High        c.SecondaryKey
	Equal       c.SecondaryKey
	Inclusion   qclient.Inclusion
	Limit       int64
	Distinct    bool
	Consistency c.Consistency
	// Configuration
	ConfigKey string
	ConfigVal string
	Help      bool
}

Command object containing parsed result from command-line or program constructued list of args.

func ParseArgs

func ParseArgs(arguments []string) (*Command, []string, *flag.FlagSet, error)

ParseArgs into Command object, return the list of arguments, flagset used for parseing and error if any.

Jump to

Keyboard shortcuts

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