dynamicdiscovery

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AccessDenied indicates that the user does not have permission to perform the operation
	AccessDenied = "access denied"
)

Variables

This section is empty.

Functions

func WithErrorHandler

func WithErrorHandler(value fab.ErrorHandler) coptions.Opt

WithErrorHandler sets the error handler

func WithRefreshInterval

func WithRefreshInterval(value time.Duration) coptions.Opt

WithRefreshInterval sets the interval in which the peer cache is refreshed

func WithResponseTimeout

func WithResponseTimeout(value time.Duration) coptions.Opt

WithResponseTimeout sets the Discover service response timeout

Types

type ChannelService

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

ChannelService implements a dynamic Discovery Service that queries Fabric's Discovery service for information about the peers that are currently joined to the given channel.

func NewChannelService

func NewChannelService(ctx contextAPI.Client, membership fab.ChannelMembership, channelID string, opts ...coptions.Opt) (*ChannelService, error)

NewChannelService creates a Discovery Service to query the list of member peers on a given channel.

func (*ChannelService) Close

func (s *ChannelService) Close()

Close releases resources

func (ChannelService) GetPeers

func (s ChannelService) GetPeers() ([]fab.Peer, error)

GetPeers returns the available peers

type DiscoveryError

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

DiscoveryError is an error originating at the Discovery service

func (DiscoveryError) Error

func (e DiscoveryError) Error() string

Error returns string representation with target

func (DiscoveryError) IsAccessDenied

func (e DiscoveryError) IsAccessDenied() bool

IsAccessDenied checks if response contains access denied msg

func (DiscoveryError) Target

func (e DiscoveryError) Target() string

Target returns url of the peer

type LocalProvider

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

LocalProvider implements a local Dynamic Discovery LocalProvider that queries Fabric's Discovery service for information about the peers that are in the local MSP.

func NewLocalProvider

func NewLocalProvider(config fab.EndpointConfig, opts ...coptions.Opt) *LocalProvider

NewLocalProvider creates a new local dynamic discovery provider

func (*LocalProvider) Close

func (p *LocalProvider) Close()

Close will close the cache and all services contained by the cache.

func (*LocalProvider) CloseContext

func (p *LocalProvider) CloseContext(ctx fab.ClientContext)

CloseContext frees resources and caches for the given context.

func (*LocalProvider) CreateLocalDiscoveryService

func (p *LocalProvider) CreateLocalDiscoveryService(mspID string) (fab.DiscoveryService, error)

CreateLocalDiscoveryService returns a local discovery service

type LocalService

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

LocalService implements a dynamic Discovery Service that queries Fabric's Discovery service for the peers that are in the local MSP.

func (*LocalService) Close

func (s *LocalService) Close()

Close releases resources

func (LocalService) GetPeers

func (s LocalService) GetPeers() ([]fab.Peer, error)

GetPeers returns the available peers

func (*LocalService) Initialize

func (s *LocalService) Initialize(ctx contextAPI.Local) error

Initialize initializes the service with local context

Jump to

Keyboard shortcuts

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