Documentation ¶
Index ¶
- func NewRefCache(refresh time.Duration) *lazycache.Cache
- type CacheKey
- type ChannelCfg
- func (cfg *ChannelCfg) AnchorPeers() []*fab.OrgAnchorPeer
- func (cfg *ChannelCfg) BlockNumber() uint64
- func (cfg *ChannelCfg) HasCapability(group fab.ConfigGroupKey, capability string) bool
- func (cfg *ChannelCfg) ID() string
- func (cfg *ChannelCfg) MSPs() []*mb.MSPConfig
- func (cfg *ChannelCfg) Orderers() []string
- func (cfg *ChannelCfg) Versions() *fab.Versions
- type ChannelConfig
- type Context
- type Option
- type Opts
- type Provider
- type Ref
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CacheKey ¶
type CacheKey interface { lazycache.Key Context() fab.ClientContext ChannelID() string Provider() Provider }
CacheKey channel config reference cache key
func NewCacheKey ¶
NewCacheKey returns a new CacheKey
type ChannelCfg ¶
type ChannelCfg struct {
// contains filtered or unexported fields
}
ChannelCfg contains channel configuration
func NewChannelCfg ¶
func NewChannelCfg(channelID string) *ChannelCfg
NewChannelCfg creates channel cfg TODO: This is temporary, Remove once we have config injected in sdk
func (*ChannelCfg) AnchorPeers ¶
func (cfg *ChannelCfg) AnchorPeers() []*fab.OrgAnchorPeer
AnchorPeers returns anchor peers
func (*ChannelCfg) BlockNumber ¶
func (cfg *ChannelCfg) BlockNumber() uint64
BlockNumber returns the channel config block number
func (*ChannelCfg) HasCapability ¶
func (cfg *ChannelCfg) HasCapability(group fab.ConfigGroupKey, capability string) bool
HasCapability indicates whether or not the given group has the given capability
func (*ChannelCfg) Versions ¶
func (cfg *ChannelCfg) Versions() *fab.Versions
Versions returns versions
type ChannelConfig ¶
type ChannelConfig struct {
// contains filtered or unexported fields
}
ChannelConfig implements query channel configuration
func New ¶
func New(channelID string, options ...Option) (*ChannelConfig, error)
New channel config implementation
func (*ChannelConfig) Query ¶
func (c *ChannelConfig) Query(reqCtx reqContext.Context) (fab.ChannelCfg, error)
Query returns channel configuration
type Option ¶
Option func for each Opts argument
func WithMaxTargets ¶
WithMaxTargets encapsulates minTargets to Option
func WithMinResponses ¶
WithMinResponses encapsulates minimum responses to Option
func WithOrderer ¶
WithOrderer encapsulates orderer to Option
func WithRetryOpts ¶
WithRetryOpts encapsulates retry opts to Option
type Opts ¶
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