Documentation ¶
Index ¶
- func InitGlobalFlags(flags *pflag.FlagSet)
- func NewMockPeer(url string, mspID string) apifabclient.Peer
- func YesNoPrompt(prompt string, args ...interface{}) bool
- type Action
- type MockAction
- func (a *MockAction) ChannelClient() (apitxn.ChannelClient, error)
- func (a *MockAction) ConfigKey() (*mgmtapi.ConfigKey, error)
- func (a *MockAction) ExecuteTx(chaincodeID, fctn string, args [][]byte) error
- func (a *MockAction) Initialize() error
- func (a *MockAction) OrgID() string
- func (a *MockAction) Peers() []apifabclient.Peer
- func (a *MockAction) ProposalProcessors() []apitxn.ProposalProcessor
- func (a *MockAction) Query(chaincodeID, fctn string, args [][]byte) ([]byte, error)
- type MockInvoker
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGlobalFlags ¶
InitGlobalFlags initializes the global command flags
func NewMockPeer ¶
func NewMockPeer(url string, mspID string) apifabclient.Peer
NewMockPeer creates a mock peer
func YesNoPrompt ¶
YesNoPrompt prompts the user to enter Y/N. If the user enters 'y' then true is returned.
Types ¶
type Action ¶
type Action interface { Initialize() error ChannelClient() (apitxn.ChannelClient, error) Peers() []apifabclient.Peer ProposalProcessors() []apitxn.ProposalProcessor OrgID() string Query(chaincodeID, fctn string, args [][]byte) ([]byte, error) ExecuteTx(chaincodeID, fctn string, args [][]byte) error ConfigKey() (*mgmtapi.ConfigKey, error) }
Action defines the common methods for an command action
type MockAction ¶
type MockAction struct { Invoker MockInvoker Response []byte // contains filtered or unexported fields }
MockAction provides a mock implementation of Action
func (*MockAction) ChannelClient ¶
func (a *MockAction) ChannelClient() (apitxn.ChannelClient, error)
ChannelClient creates a new channel client
func (*MockAction) ExecuteTx ¶
func (a *MockAction) ExecuteTx(chaincodeID, fctn string, args [][]byte) error
ExecuteTx executes a transaction on the given chaincode with the given function and args
func (*MockAction) Initialize ¶
func (a *MockAction) Initialize() error
Initialize initializes the action
func (*MockAction) OrgID ¶
func (a *MockAction) OrgID() string
OrgID returns the organization ID of the first peer in the list of peers
func (*MockAction) ProposalProcessors ¶
func (a *MockAction) ProposalProcessors() []apitxn.ProposalProcessor
ProposalProcessors returns the proposal processors
Click to show internal directories.
Click to hide internal directories.