Documentation ¶
Overview ¶
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func AddCommands(cli CommandRegistrar)
- func ExtractUnspentTokensFromOutput(output string) ([]*token.UnspentToken, error)
- func GetSigningIdentity(mspConfigPath, mspID, mspType string) (msp.SigningIdentity, error)
- func LoadConfig(s string) (*client.ClientConfig, error)
- func LoadLocalMSPAt(dir, id, mspType string) (msp.MSP, error)
- func LoadLocalMspRecipient(s string) (*token.TokenOwner, error)
- func LoadSerialisedRecipient(serialisedRecipientPath string) ([]byte, error)
- func LoadShares(s string) ([]*token.RecipientShare, error)
- func LoadTokenIDs(s string) ([]*token.TokenId, error)
- func LoadTokenIDsFromFile(s string) ([]*token.TokenId, error)
- func LoadTokenIDsFromJson(s string) ([]*token.TokenId, error)
- func LoadTokenOwner(s string) (*token.TokenOwner, error)
- func SubstituteShareRecipient(shares []*ShellRecipientShare) ([]*token.RecipientShare, error)
- type BaseCmd
- type CommandRegistrar
- type IssueCmd
- type JsonLoader
- type ListTokensCmd
- type Loader
- type OperationResponse
- type OperationResponseParser
- type RedeemCmd
- type ResponseParser
- type ShellRecipientShare
- type Stub
- type StubResponse
- type TokenClientStub
- func (stub *TokenClientStub) Issue(tokensToIssue []*token.Token, waitTimeout time.Duration) (StubResponse, error)
- func (stub *TokenClientStub) ListTokens() (StubResponse, error)
- func (stub *TokenClientStub) Redeem(tokenIDs []*token.TokenId, quantity string, waitTimeout time.Duration) (StubResponse, error)
- func (stub *TokenClientStub) Setup(configPath, channel, mspPath, mspID string) error
- func (stub *TokenClientStub) Transfer(tokenIDs []*token.TokenId, shares []*token.RecipientShare, ...) (StubResponse, error)
- type TransferCmd
- type UnspentTokenResponse
- type UnspentTokenResponseParser
Constants ¶
View Source
const ( IssueCommand = "issue" TransferCommand = "transfer" ListTokensCommad = "list" RedeemCommand = "redeem" )
Variables ¶
This section is empty.
Functions ¶
func AddCommands ¶
func AddCommands(cli CommandRegistrar)
func ExtractUnspentTokensFromOutput ¶
func ExtractUnspentTokensFromOutput(output string) ([]*token.UnspentToken, error)
func GetSigningIdentity ¶
func GetSigningIdentity(mspConfigPath, mspID, mspType string) (msp.SigningIdentity, error)
func LoadConfig ¶
func LoadConfig(s string) (*client.ClientConfig, error)
func LoadLocalMspRecipient ¶
func LoadLocalMspRecipient(s string) (*token.TokenOwner, error)
func LoadSerialisedRecipient ¶
func LoadShares ¶
func LoadShares(s string) ([]*token.RecipientShare, error)
func LoadTokenOwner ¶
func LoadTokenOwner(s string) (*token.TokenOwner, error)
func SubstituteShareRecipient ¶
func SubstituteShareRecipient(shares []*ShellRecipientShare) ([]*token.RecipientShare, error)
Types ¶
type BaseCmd ¶
type BaseCmd struct {
// contains filtered or unexported fields
}
func (*BaseCmd) SetChannel ¶
func (*BaseCmd) SetMSPPath ¶
type CommandRegistrar ¶
type CommandRegistrar interface {
Command(name, help string, onCommand cmdcommon.CLICommand) *kingpin.CmdClause
}
type IssueCmd ¶
type IssueCmd struct { *BaseCmd // contains filtered or unexported fields }
func NewIssueCmd ¶
func NewIssueCmd(stub Stub, loader Loader, parser ResponseParser) *IssueCmd
func (*IssueCmd) SetClientConfigPath ¶
func (*IssueCmd) SetQuantity ¶
func (*IssueCmd) SetRecipient ¶
type JsonLoader ¶
type JsonLoader struct { }
func (*JsonLoader) Shares ¶
func (*JsonLoader) Shares(s string) ([]*token.RecipientShare, error)
func (*JsonLoader) TokenOwner ¶
func (*JsonLoader) TokenOwner(s string) (*token.TokenOwner, error)
type ListTokensCmd ¶
type ListTokensCmd struct { *BaseCmd // contains filtered or unexported fields }
func NewListTokensCmd ¶
func NewListTokensCmd(stub Stub, parser ResponseParser) *ListTokensCmd
func (*ListTokensCmd) SetClientConfigPath ¶
func (cmd *ListTokensCmd) SetClientConfigPath(clientConfigPath *string)
type OperationResponse ¶
type OperationResponseParser ¶
func (*OperationResponseParser) ParseResponse ¶
func (parser *OperationResponseParser) ParseResponse(response StubResponse) error
type RedeemCmd ¶
type RedeemCmd struct { *BaseCmd // contains filtered or unexported fields }
func NewRedeemCmd ¶
func NewRedeemCmd(stub Stub, loader Loader, parser ResponseParser) *RedeemCmd
func (*RedeemCmd) SetClientConfigPath ¶
func (*RedeemCmd) SetQuantity ¶
func (*RedeemCmd) SetTokenIDs ¶
type ResponseParser ¶
type ResponseParser interface {
ParseResponse(response StubResponse) error
}
type ShellRecipientShare ¶
type ShellRecipientShare struct {}
func LoadSharesFromFile ¶
func LoadSharesFromFile(s string) ([]*ShellRecipientShare, error)
func LoadSharesFromJson ¶
func LoadSharesFromJson(s string) ([]*ShellRecipientShare, error)
type Stub ¶
type Stub interface { Setup(configFilePath, channel, mspPath, mspID string) error Issue(tokensToIssue []*token.Token, waitTimeout time.Duration) (StubResponse, error) Transfer(tokenIDs []*token.TokenId, shares []*token.RecipientShare, waitTimeout time.Duration) (StubResponse, error) Redeem(tokenIDs []*token.TokenId, quantity string, waitTimeout time.Duration) (StubResponse, error) ListTokens() (StubResponse, error) }
type StubResponse ¶
type StubResponse interface { }
type TokenClientStub ¶
type TokenClientStub struct {
// contains filtered or unexported fields
}
func (*TokenClientStub) Issue ¶
func (stub *TokenClientStub) Issue(tokensToIssue []*token.Token, waitTimeout time.Duration) (StubResponse, error)
func (*TokenClientStub) ListTokens ¶
func (stub *TokenClientStub) ListTokens() (StubResponse, error)
func (*TokenClientStub) Redeem ¶
func (stub *TokenClientStub) Redeem(tokenIDs []*token.TokenId, quantity string, waitTimeout time.Duration) (StubResponse, error)
func (*TokenClientStub) Setup ¶
func (stub *TokenClientStub) Setup(configPath, channel, mspPath, mspID string) error
func (*TokenClientStub) Transfer ¶
func (stub *TokenClientStub) Transfer(tokenIDs []*token.TokenId, shares []*token.RecipientShare, waitTimeout time.Duration) (StubResponse, error)
type TransferCmd ¶
type TransferCmd struct { *BaseCmd // contains filtered or unexported fields }
func NewTransferCmd ¶
func NewTransferCmd(stub Stub, loader Loader, parser ResponseParser) *TransferCmd
func (*TransferCmd) SetClientConfigPath ¶
func (cmd *TransferCmd) SetClientConfigPath(clientConfigPath *string)
func (*TransferCmd) SetShares ¶
func (cmd *TransferCmd) SetShares(shares *string)
func (*TransferCmd) SetTokenIDs ¶
func (cmd *TransferCmd) SetTokenIDs(tokenIDs *string)
type UnspentTokenResponse ¶
type UnspentTokenResponse struct {
Tokens []*token.UnspentToken
}
type UnspentTokenResponseParser ¶
func (*UnspentTokenResponseParser) ParseResponse ¶
func (parser *UnspentTokenResponseParser) ParseResponse(response StubResponse) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.