Documentation ¶
Index ¶
- func ExitOnErr(cmd *cobra.Command, errFmt string, err error)
- func ParseEpoch(cmd *cobra.Command, flag string) (uint64, bool, error)
- func PrettyPrintJSON(cmd *cobra.Command, m json.Marshaler, entity string)
- func PrettyPrintNetMap(cmd *cobra.Command, nm netmap.NetMap)
- func PrettyPrintNodeInfo(cmd *cobra.Command, node netmap.NodeInfo, index int, indent string, short bool)
- func PrettyPrintUnixTime(s string) string
- func PrintChecksum(cmd *cobra.Command, name string, recv func() (checksum.Checksum, bool))
- func PrintVerbose(cmd *cobra.Command, format string, a ...interface{})
- func ReadBearerToken(cmd *cobra.Command, flagname string) *bearer.Token
- func ReadBinaryOrJSON(cmd *cobra.Command, dst BinaryOrJSON, fPath string) error
- func ReadEACL(cmd *cobra.Command, eaclPath string) *eacl.Table
- type BinaryOrJSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExitOnErr ¶
ExitOnErr prints error and exits with a code that matches one of the common errors from sdk library. If no errors found, exits with 1 code. Does nothing if passed error in nil.
func ParseEpoch ¶ added in v0.30.0
ParseEpoch parses epoch argument. Second return value is true if the specified epoch is relative, and false otherwise.
func PrettyPrintJSON ¶
PrettyPrintJSON prints m as an indented JSON to the cmd output.
func PrettyPrintNetMap ¶ added in v0.33.0
PrettyPrintNetMap print information about network map.
func PrettyPrintNodeInfo ¶ added in v0.33.0
func PrettyPrintNodeInfo(cmd *cobra.Command, node netmap.NodeInfo, index int, indent string, short bool)
PrettyPrintNodeInfo print information about network node with given indent and index. To avoid printing attribute list use short parameter.
func PrettyPrintUnixTime ¶ added in v0.28.3
PrettyPrintUnixTime interprets s as unix timestamp and prints it as a date. Is s is invalid, "malformed" is returned.
func PrintChecksum ¶ added in v0.29.0
PrintChecksum prints checksum.
func PrintVerbose ¶
PrintVerbose prints to the stdout if the commonflags.Verbose flag is on.
func ReadBearerToken ¶
ReadBearerToken reads bearer token from the path provided in a specified flag.
func ReadBinaryOrJSON ¶ added in v0.34.0
func ReadBinaryOrJSON(cmd *cobra.Command, dst BinaryOrJSON, fPath string) error
ReadBinaryOrJSON reads file data using provided path and decodes BinaryOrJSON from the data.
Types ¶
type BinaryOrJSON ¶ added in v0.34.0
type BinaryOrJSON interface { Unmarshal([]byte) error json.Unmarshaler }
BinaryOrJSON is an interface of entities which provide json.Unmarshaler and NeoFS binary decoder.