resmgmtclient

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InstallCCRequest

type InstallCCRequest struct {
	Name    string
	Path    string
	Version string
	Package *fab.CCPackage
}

InstallCCRequest contains install chaincode request parameters

type InstallCCResponse

type InstallCCResponse struct {
	Target string
	Status int32
	Info   string
}

InstallCCResponse contains install chaincode response status

type InstantiateCCRequest

type InstantiateCCRequest struct {
	Name       string
	Path       string
	Version    string
	Args       [][]byte
	Policy     *common.SignaturePolicyEnvelope
	CollConfig []*common.CollectionConfig
}

InstantiateCCRequest contains instantiate chaincode request parameters

type Option

type Option func(opts *Opts) error

Option func for each Opts argument

func WithTargetFilter

func WithTargetFilter(targetFilter TargetFilter) Option

WithTargetFilter encapsulates resmgmtclient TargetFilter targets to resmgmtclient Option

func WithTargets

func WithTargets(targets ...fab.Peer) Option

WithTargets encapsulates fab.Peer targets to resmgmtclient Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

WithTimeout encapsulates time.Duration to resmgmtclient Option

type Opts

type Opts struct {
	Targets      []fab.Peer    // target peers
	TargetFilter TargetFilter  // target filter
	Timeout      time.Duration //timeout options for instantiate and upgrade CC
}

Opts contains options for operations performed by ResourceMgmtClient

type ResourceMgmtClient

type ResourceMgmtClient interface {

	// InstallCC installs chaincode with optional custom options (specific peers, filtered peers)
	InstallCC(req InstallCCRequest, options ...Option) ([]InstallCCResponse, error)

	// InstantiateCC instantiates chaincode with optional custom options (specific peers, filtered peers, timeout)
	InstantiateCC(channelID string, req InstantiateCCRequest, options ...Option) error

	// UpgradeCC upgrades chaincode  with optional custom options (specific peers, filtered peers, timeout)
	UpgradeCC(channelID string, req UpgradeCCRequest, options ...Option) error

	// JoinChannel allows for peers to join existing channel with optional custom options (specific peers, filtered peers)
	JoinChannel(channelID string, options ...Option) error
}

ResourceMgmtClient is responsible for managing resources: peers joining channels, and installing and instantiating chaincodes(TODO).

type TargetFilter

type TargetFilter interface {
	// Accept returns true if peer should be included in the list of target peers
	Accept(peer fab.Peer) bool
}

TargetFilter allows for filtering target peers

type UpgradeCCRequest

type UpgradeCCRequest struct {
	Name       string
	Path       string
	Version    string
	Args       [][]byte
	Policy     *common.SignaturePolicyEnvelope
	CollConfig []*common.CollectionConfig
}

UpgradeCCRequest contains upgrade chaincode request parameters

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL