common

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Mongo     = "mongo"
	CBMigrate = "cbmigrate"
)
View Source
const (
	CBCluster            = "cb-cluster"
	CBUsername           = "cb-username"
	CBPassword           = "cb-password"
	CBClientCert         = "cb-client-cert"
	CBClientCertPassword = "cb-client-cert-password"
	CBClientKey          = "cb-client-key"
	CBClientKeyPassword  = "cb-client-key-password"
	CBGenerateKey        = "cb-generate-key"
	CBCACert             = "cb-cacert"
	CBNoSSLVerify        = "cb-no-ssl-verify"
	CBBucket             = "cb-bucket"
	CBScope              = "cb-scope"
	CBCollection         = "cb-collection"
	CBBatchSize          = "cb-batch-size"

	CopyIndexes = "copy-indexes"
	BufferSize  = "buffer-size"
)
View Source
const (
	Debug = "debug"
)

Variables

View Source
var BetaCommands = []Command{
	Mongo,
}
View Source
var Version string

Functions

func BuildURI

func BuildURI(host, port string) string

BuildURI assembles a URI from host and port arguments, including a possible replica set name on the host part

func CopyMap

func CopyMap[T1 comparable, T2 any](m map[T1]T2) map[T1]T2

func CouchBaseMissingRequiredOptions

func CouchBaseMissingRequiredOptions(cmd *cobra.Command) []string

func ExecuteCommand

func ExecuteCommand(cmd *cobra.Command, args ...string) (output string, err error)

ExecuteCommand function to run the test cases

func FlattenFlags

func FlattenFlags(flags []flag.Flag) []flag.Flag

FlattenFlags takes a slice of Flag interfaces and returns a deduplicated slice

func GetCBFlags

func GetCBFlags() []flag.Flag

func GetCommonFlags

func GetCommonFlags() []flag.Flag

func GetDebugFlag

func GetDebugFlag() flag.Flag

func NewCommand

func NewCommand(name Command, alias []string, examples []Example, short string, long string, flags []flag.Flag) *cobra.Command

NewCommand command constructor

func ParesCouchbaseOptions

func ParesCouchbaseOptions(cmd *cobra.Command, collection string) (*option.Options, error)

func ReqFieldsError

func ReqFieldsError(missingFields []string) error

func ReqFieldsValidation

func ReqFieldsValidation(cmd *cobra.Command, flags []string) error

func SetVersion

func SetVersion(version string)

func SplitHostArg

func SplitHostArg(connString string) ([]string, string)

Extract the replica set name and the list of hosts from the connection string

func ValidateMustAllOrNotFlag

func ValidateMustAllOrNotFlag(cmd *cobra.Command, flags ...string) error

Types

type Command

type Command string

type Example

type Example struct {
	Value string
	Usage string
}

Example command example

Jump to

Keyboard shortcuts

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