Documentation ¶
Index ¶
- Constants
- func Bind(cmd *cobra.Command)
- func BindAPI(cmd *cobra.Command)
- func GetCommandContext(cmd *cobra.Command) (context.Context, context.CancelFunc)
- func GetCommandContextWithAwait(cmd *cobra.Command, awaitFlag string, awaitTimeout time.Duration) (context.Context, context.CancelFunc)
- func Init(cmd *cobra.Command)
- func InitAPI(cmd *cobra.Command)
- func InitSession(cmd *cobra.Command, name string)
- func InitWithoutRPC(cmd *cobra.Command)
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" 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 the operation" Verbose = "verbose" VerboseShorthand = "v" VerboseUsage = "Verbose output" ForceFlag = "force" ForceFlagShorthand = "f" CIDFlag = "cid" CIDFlagUsage = "Container ID." OIDFlag = "oid" OIDFlagUsage = "Object ID." )
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 GetCommandContext ¶ added in v0.38.0
GetCommandContext returns cmd context with timeout specified in 'timeout' flag if the flag is set.
func GetCommandContextWithAwait ¶ added in v0.38.0
func GetCommandContextWithAwait(cmd *cobra.Command, awaitFlag string, awaitTimeout time.Duration) (context.Context, context.CancelFunc)
GetCommandContextWithAwait works like GetCommandContext but uses specified await timeout if 'timeout' flag is omitted and given boolean await flag is set.
func Init ¶
Init adds common flags to the command: - GenerateKey, - WalletPath, - Account, - RPC, - Timeout.
func InitSession ¶ added in v0.28.3
InitSession registers SessionToken flag representing filepath to the token of the session with the given name. Supports NeoFS-binary and JSON files.
func InitWithoutRPC ¶
InitWithoutRPC is similar to Init but doesn't create the RPC flag.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.