Documentation ¶
Index ¶
- func ExitOnErr(cmd *cobra.Command, errFmt string, err error)
- func PrettyPrintJSON(cmd *cobra.Command, m json.Marshaler, entity string)
- func PrettyPrintUnixTime(s string) string
- func PrintVerbose(format string, a ...interface{})
- func ReadBearerToken(cmd *cobra.Command, flagname string) *bearer.Token
- func ReadEACL(cmd *cobra.Command, eaclPath string) *eacl.Table
- func ReadSessionToken(cmd *cobra.Command, dst json.Unmarshaler, fPath string)
- func ReadSessionTokenErr(dst json.Unmarshaler, fPath string) error
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 PrettyPrintJSON ¶
PrettyPrintJSON prints m as an indented JSON to the cmd output.
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 PrintVerbose ¶
func PrintVerbose(format string, a ...interface{})
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 ReadSessionToken ¶
func ReadSessionToken(cmd *cobra.Command, dst json.Unmarshaler, fPath string)
ReadSessionToken calls ReadSessionTokenErr and exists on error.
func ReadSessionTokenErr ¶
func ReadSessionTokenErr(dst json.Unmarshaler, fPath string) error
ReadSessionTokenErr reads session token as JSON file with session token from path provided in a specified flag.
Types ¶
This section is empty.