client

package
v0.4.27 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CfgProvider = func(channelID string) (api.Config, error) {
	return txsnapconfig.NewConfig(PeerConfigPath, channelID)
}

CfgProvider contains the config provider (may be mocked for unit testing)

View Source
var MemServiceProvider = func() (memApi.Service, error) {
	return memservice.Get()
}

MemServiceProvider returns the membership service provider NOTE: Should only be modified by unit tests

View Source
var PeerConfigPath = ""

PeerConfigPath use for testing

View Source
var ServiceProviderFactory apisdk.ServiceProviderFactory

ServiceProviderFactory use to pass service provider factory(mock for unit test)

Functions

func EnableBlockEvents added in v0.4.3

func EnableBlockEvents(enable bool)

EnableBlockEvents turns on block event publishing in the event service. By default, filtered block events are published.

func GetInstance

func GetInstance(channelID string, metrics *Metrics) (api.Client, error)

GetInstance returns an instance of the fabric client for the given channel.

Types

type CacheKey added in v0.2.0

type CacheKey interface {
	lazycache.Key
	ChannelID() string
	ServiceProviderFactory() apisdk.ServiceProviderFactory
	ConfigProvider() ConfigProvider
	MetricsProvider() *Metrics
}

CacheKey config cache reference cache key

type ConfigProvider added in v0.2.6

type ConfigProvider func(channelID string) (api.Config, error)

ConfigProvider returns the config for the given channel

type CustomConfig

type CustomConfig struct {
	fabApi.EndpointConfig
	// contains filtered or unexported fields
}

CustomConfig override client config

func (*CustomConfig) ChannelPeers

func (c *CustomConfig) ChannelPeers(name string) []fabApi.ChannelPeer

ChannelPeers returns the channel peers configuration

type DynamicProviderFactory

type DynamicProviderFactory struct {
	defsvc.ProviderFactory
	// contains filtered or unexported fields
}

DynamicProviderFactory returns a Channel Provider that uses a dynamic discovery provider based on the local Membership Snap, dynamic selection provider, and the local Event Snap

func (*DynamicProviderFactory) CreateChannelProvider added in v0.2.0

func (f *DynamicProviderFactory) CreateChannelProvider(config fabApi.EndpointConfig, opts ...options.Opt) (fabApi.ChannelProvider, error)

CreateChannelProvider returns a new default implementation of channel provider

type Metrics added in v0.4.0

type Metrics struct {
	TransactionRetryCounter fabricmetrics.Counter
}

Metrics contain graphs

func NewMetrics added in v0.4.0

func NewMetrics(p fabricmetrics.Provider) *Metrics

NewMetrics create new instance of metrics

Directories

Path Synopsis
msp

Jump to

Keyboard shortcuts

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