commonflags

package
v0.38.5 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TTL          = "ttl"
	TTLShorthand = ""
	TTLDefault   = 2
	TTLUsage     = "TTL value in request meta header"

	XHeadersKey       = "xhdr"
	XHeadersShorthand = "x"
	XHeadersUsage     = "Request X-Headers in form of Key=Value"
)
View Source
const (
	// ExpireAt is a flag for setting last epoch of an object or a token.
	ExpireAt = "expire-at"
	// Lifetime is a flag for setting the lifetime of an object or a token,
	// starting from the current epoch.
	Lifetime = "lifetime"
)
View Source
const (
	GenerateKey = "generate-key"

	WalletPath          = "wallet"
	WalletPathShorthand = "w"
	WalletPathDefault   = ""
	WalletPathUsage     = "Path to the wallet or binary key"

	Account          = "address"
	AccountShorthand = ""
	AccountDefault   = ""
	AccountUsage     = "Address of wallet account"

	RPC          = "rpc-endpoint"
	RPCShorthand = "r"
	RPCDefault   = ""
	RPCUsage     = "Remote node address (as 'multiaddr' or '<host>:<port>')"

	Timeout          = "timeout"
	TimeoutShorthand = "t"
	TimeoutDefault   = 15 * time.Second
	TimeoutUsage     = "Timeout for an operation"

	Verbose          = "verbose"
	VerboseShorthand = "v"
	VerboseUsage     = "Verbose output"

	ForceFlag          = "force"
	ForceFlagShorthand = "f"

	CIDFlag      = "cid"
	CIDFlagUsage = "Container ID."

	OIDFlag      = "oid"
	OIDFlagUsage = "Object ID."

	TracingFlag      = "trace"
	TracingFlagUsage = "Generate trace ID and print it."
)

Common CLI flag keys, shorthands, default values and their usage descriptions.

View Source
const JSON = "json"
View Source
const SessionToken = "session"

Variables

This section is empty.

Functions

func Bind

func Bind(cmd *cobra.Command)

Bind binds common command flags to the viper.

func BindAPI

func BindAPI(cmd *cobra.Command)

BindAPI binds API flags of storage node services to the viper.

func Init

func Init(cmd *cobra.Command)

Init adds common flags to the command: - GenerateKey, - WalletPath, - Account, - RPC, - Tracing, - Timeout.

func InitAPI

func InitAPI(cmd *cobra.Command)

InitAPI inits common flags for storage node services.

func InitSession

func InitSession(cmd *cobra.Command, name string)

InitSession registers SessionToken flag representing file path to the token of the session with the given name. Supports FrostFS-binary and JSON files.

func InitWithoutRPC

func InitWithoutRPC(cmd *cobra.Command)

InitWithoutRPC is similar to Init but doesn't create the RPC flag.

Types

This section is empty.

Jump to

Keyboard shortcuts

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