forked from TrueCloudLab/frostfs-node
[#1933] cli: Support binary sessions
There is a need to support NeoFS-binary sessions along with JSON ones in NeoFS CLI. Provide generic `common.ReadBinaryOrJSON` functions which tries to decode NeoFS-binary structure and falls back to JSON format. Use this function in all places with token reading. Signed-off-by: Leonard Lyubich <ctulhurider@gmail.com>
This commit is contained in:
parent
04b67f3ba5
commit
8bba490c30
24 changed files with 259 additions and 206 deletions
|
@ -45,11 +45,14 @@ func init() {
|
|||
commonflags.InitAPI(containerCommand)
|
||||
}
|
||||
|
||||
for _, cmd := range []*cobra.Command{
|
||||
createContainerCmd,
|
||||
deleteContainerCmd,
|
||||
setExtendedACLCmd,
|
||||
for _, el := range []struct {
|
||||
cmd *cobra.Command
|
||||
verb string
|
||||
}{
|
||||
{createContainerCmd, "PUT"},
|
||||
{deleteContainerCmd, "DELETE"},
|
||||
{setExtendedACLCmd, "SETEACL"},
|
||||
} {
|
||||
commonflags.InitSession(cmd)
|
||||
commonflags.InitSession(el.cmd, "container "+el.verb)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue