fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/fab/chconfig Index | Files

package chconfig

import "github.com/hyperledger/fabric-sdk-go/pkg/fab/chconfig"

Index

Package Files

cache.go chconfig.go opts.go reference.go

func NewRefCache Uses

func NewRefCache(opts ...options.Opt) *lazycache.Cache

NewRefCache a cache of channel config references that refreshed with the given interval

func WithErrorHandler Uses

func WithErrorHandler(value fab.ErrorHandler) coptions.Opt

WithErrorHandler sets the error handler

func WithRefreshInterval Uses

func WithRefreshInterval(value time.Duration) coptions.Opt

WithRefreshInterval sets the interval in which the channel config cache is refreshed

type CacheKey Uses

type CacheKey interface {
    lazycache.Key
    Context() fab.ClientContext
    ChannelID() string
    Provider() Provider
}

CacheKey channel config reference cache key

func NewCacheKey Uses

func NewCacheKey(ctx fab.ClientContext, pvdr Provider, channelID string) (CacheKey, error)

NewCacheKey returns a new CacheKey

type ChannelCfg Uses

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

ChannelCfg contains channel configuration

func NewChannelCfg Uses

func NewChannelCfg(channelID string) *ChannelCfg

NewChannelCfg creates channel cfg TODO: This is temporary, Remove once we have config injected in sdk

func (*ChannelCfg) AnchorPeers Uses

func (cfg *ChannelCfg) AnchorPeers() []*fab.OrgAnchorPeer

AnchorPeers returns anchor peers

func (*ChannelCfg) BlockNumber Uses

func (cfg *ChannelCfg) BlockNumber() uint64

BlockNumber returns the channel config block number

func (*ChannelCfg) HasCapability Uses

func (cfg *ChannelCfg) HasCapability(group fab.ConfigGroupKey, capability string) bool

HasCapability indicates whether or not the given group has the given capability

func (*ChannelCfg) ID Uses

func (cfg *ChannelCfg) ID() string

ID returns the channel ID

func (*ChannelCfg) MSPs Uses

func (cfg *ChannelCfg) MSPs() []*mb.MSPConfig

MSPs returns msps

func (*ChannelCfg) Orderers Uses

func (cfg *ChannelCfg) Orderers() []string

Orderers returns orderers

func (*ChannelCfg) Versions Uses

func (cfg *ChannelCfg) Versions() *fab.Versions

Versions returns versions

type ChannelConfig Uses

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

ChannelConfig implements query channel configuration

func New Uses

func New(channelID string, options ...Option) (*ChannelConfig, error)

New channel config implementation

func (*ChannelConfig) Query Uses

func (c *ChannelConfig) Query(reqCtx reqContext.Context) (fab.ChannelCfg, error)

Query returns channel configuration

func (*ChannelConfig) QueryBlock Uses

func (c *ChannelConfig) QueryBlock(reqCtx reqContext.Context) (*common.Block, error)

QueryBlock returns channel configuration

type ChannelConfigError Uses

type ChannelConfigError error

ChannelConfigError is returned when the channel config could not be refreshed

type Context Uses

type Context struct {
    context.Providers
    msp.Identity
}

Context holds the providers and identity

type Option Uses

type Option func(opts *Opts) error

Option func for each Opts argument

func WithMaxTargets Uses

func WithMaxTargets(maxTargets int) Option

WithMaxTargets encapsulates minTargets to Option

func WithMinResponses Uses

func WithMinResponses(min int) Option

WithMinResponses encapsulates minimum responses to Option

func WithOrderer Uses

func WithOrderer(orderer fab.Orderer) Option

WithOrderer encapsulates orderer to Option

func WithPeers Uses

func WithPeers(peers []fab.Peer) Option

WithPeers encapsulates peers to Option

func WithRetryOpts Uses

func WithRetryOpts(retryOpts retry.Opts) Option

WithRetryOpts encapsulates retry opts to Option

type Opts Uses

type Opts struct {
    Orderer      fab.Orderer // if configured, channel config will be retrieved from this orderer
    Targets      []fab.Peer  // if configured, channel config will be retrieved from peers (targets)
    MinResponses int         // used with targets option; min number of success responses (from targets/peers)
    MaxTargets   int         //if configured, channel config will be retrieved for these number of random targets
    RetryOpts    retry.Opts  //opts for channel query retry handler
}

Opts contains options for retrieving channel configuration

type Provider Uses

type Provider func(channelID string) (fab.ChannelConfig, error)

Provider provides ChannelConfig

type Ref Uses

type Ref struct {
    *lazyref.Reference
    // contains filtered or unexported fields
}

Ref channel configuration lazy reference

func NewRef Uses

func NewRef(ctx fab.ClientContext, pvdr Provider, channel string, opts ...options.Opt) *Ref

NewRef returns a new channel config reference

Package chconfig imports 22 packages (graph) and is imported by 3 packages. Updated 2019-08-25. Refresh now. Tools for package owners.