github.com/hechain20/hechain@v0.0.0-20220316014945-b544036ba106/integration/nwo/commands/osnadmin.go (about) 1 /* 2 Copyright hechain. All Rights Reserved. 3 4 SPDX-License-Identifier: Apache-2.0 5 */ 6 7 package commands 8 9 type ChannelList struct { 10 OrdererAddress string 11 CAFile string 12 ClientCert string 13 ClientKey string 14 ChannelID string 15 } 16 17 func (c ChannelList) SessionName() string { 18 return "osnadmin-channel-list" 19 } 20 21 func (c ChannelList) Args() []string { 22 args := []string{ 23 "channel", "list", 24 "--no-status", 25 "--orderer-address", c.OrdererAddress, 26 } 27 if c.CAFile != "" { 28 args = append(args, "--ca-file", c.CAFile) 29 } 30 if c.ClientCert != "" { 31 args = append(args, "--client-cert", c.ClientCert) 32 } 33 if c.ClientKey != "" { 34 args = append(args, "--client-key", c.ClientKey) 35 } 36 if c.ChannelID != "" { 37 args = append(args, "--channelID", c.ChannelID) 38 } 39 return args 40 }