discovery

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoChannels      = errors.New(`channels not found`)
	ErrChannelNotFound = errors.New(`channel not found`)
	ErrNoChaincodes    = errors.New(`no chaincodes on channel`)
	ErrUnknownProvider = errors.New(`unknown discovery provider (forgotten import?)`)
)

Functions

func NewLocalConfigProvider

func NewLocalConfigProvider(options config.DiscoveryConfigOpts, tlsMapper tlsConfigMapper) (api.DiscoveryProvider, error)

Types

type GossipDiscoveryProvider

type GossipDiscoveryProvider struct {
	// contains filtered or unexported fields
}

func NewGossipDiscoveryProvider

func NewGossipDiscoveryProvider(
	ctx context.Context,
	connCfg config.ConnectionConfig,
	log *zap.Logger,
	identitySigner discClient.Signer,
	clientIdentity []byte,
	tlsMapper tlsConfigMapper,
) (*GossipDiscoveryProvider, error)

func (*GossipDiscoveryProvider) Chaincode

func (d *GossipDiscoveryProvider) Chaincode(ctx context.Context, channelName string, ccName string) (api.ChaincodeDiscoverer, error)

func (*GossipDiscoveryProvider) Channel

func (d *GossipDiscoveryProvider) Channel(ctx context.Context, channelName string) (api.ChannelDiscoverer, error)

func (*GossipDiscoveryProvider) LocalPeers

type LocalConfigProvider

type LocalConfigProvider struct {
	// contains filtered or unexported fields
}

func (*LocalConfigProvider) Chaincode

func (d *LocalConfigProvider) Chaincode(_ context.Context, channelName, ccName string) (api.ChaincodeDiscoverer, error)

func (*LocalConfigProvider) Channel

func (d *LocalConfigProvider) Channel(_ context.Context, channelName string) (api.ChannelDiscoverer, error)

func (*LocalConfigProvider) LocalPeers

type ServiceDiscoveryType

type ServiceDiscoveryType string

ServiceDiscoveryType - what types of discovery we support

const (
	LocalConfigServiceDiscoveryType ServiceDiscoveryType = "local"
	GossipServiceDiscoveryType      ServiceDiscoveryType = "gossip"
)

type TLSCertsMapper

type TLSCertsMapper struct {
	// contains filtered or unexported fields
}

TLSCertsMapper - if tls is enabled with gossip maps provided from cfg TLS certs to discovered peers

func NewTLSCertsMapper

func NewTLSCertsMapper(certsCfg []config.TLSCertsMapperConfig) *TLSCertsMapper

func (*TLSCertsMapper) TlsConfigForAddress

func (m *TLSCertsMapper) TlsConfigForAddress(address string) *config.TlsConfig

tlsConfigForAddress - get tls config for provided address if config wasnt provided on startup time return disabled tls

Jump to

Keyboard shortcuts

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