options

package
v0.0.0-...-c8fc3f1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgOpts

type ArgOpts struct {
	// The -j or --json flag specifies whether or not to use the JSON output format
	JSON bool `short:"j" long:"json" default:"false" description:"use the JSON output format"`

	// The -J or --pretty-json option specifies whether or not to use the formatter JSON output
	Pretty bool `short:"J" long:"pretty-json" default:"false" description:"print the output in a prettier JSON format assumes '-j'"`

	// The -n or --nts flag specifies that your cluster will be using the new NetworkTopologyStrategy
	Nts bool `short:"n" long:"nts" default:"true" description:"Optimize multi-cluster distribution for NetworkTopologyStrategy [default]"`

	// The -o or --onts flag specifies that your cluster will be using the antiquated OldNetworkTopologyStrategy
	Onts bool `short:"o" long:"onts" default:"false" description:"Optimize multi-cluster distribution for OldNetworkTopologyStrategy"`

	// The -r or --ringrange flag specifies the maximum size of the ring
	// This value is a string so that it can be converted to a big.Int value later (too large for uint64)
	RingRangeStr string `` /* 185-byte string literal not displayed */

	// The -d or --dc-count flag specifies the total number of datacenters in the cluster
	DcCountStr string `short:"d" long:"dc-count" default:"0" description:"The number of datacenters to calculate token ranges for"`

	// The -c or --node-count flag is a comma-separated list node counts per DC, For example:
	// ./cassandra-tgen -d 3 -c 3,2,1
	NodeCountStr string `short:"c" long:"node-count" default:"1" description:"Comma-delimited list of datacenter node counts: --count '3,2,1'"`

	// These two options are not use by go-flags, they are some of the
	// values parsed from string => big.Int that are needed later
	DcCount, RingRange *big.Int
	NodeCounts         []*big.Int
}

ArgOpts is a struct for specifying command line options for this utility

func New

func New() *ArgOpts

New returns a pointer to a new ArgOpts struct

func (*ArgOpts) Parse

func (opts *ArgOpts) Parse() error

Parse parses the command line arguments for the option struct. It sets the values directly on the struct, as well as returns a pointer to the struct as well as an error

Jump to

Keyboard shortcuts

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