id int32 0 167k | repo stringlengths 5 54 | path stringlengths 4 155 | func_name stringlengths 1 118 | original_string stringlengths 52 85.5k | language stringclasses 1
value | code stringlengths 52 85.5k | code_tokens listlengths 21 1.41k | docstring stringlengths 6 2.61k | docstring_tokens listlengths 3 215 | sha stringlengths 40 40 | url stringlengths 85 252 |
|---|---|---|---|---|---|---|---|---|---|---|---|
29,900 | hyperledger/fabric-sdk-go | pkg/fab/events/deliverclient/opts.go | SetConnectionProvider | func (p *params) SetConnectionProvider(connProvider api.ConnectionProvider) {
logger.Debugf("ConnectionProvider: %#v", connProvider)
p.connProvider = connProvider
} | go | func (p *params) SetConnectionProvider(connProvider api.ConnectionProvider) {
logger.Debugf("ConnectionProvider: %#v", connProvider)
p.connProvider = connProvider
} | [
"func",
"(",
"p",
"*",
"params",
")",
"SetConnectionProvider",
"(",
"connProvider",
"api",
".",
"ConnectionProvider",
")",
"{",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"connProvider",
")",
"\n",
"p",
".",
"connProvider",
"=",
"connProvider",
"\n",
"... | // SetConnectionProvider is only used in unit tests | [
"SetConnectionProvider",
"is",
"only",
"used",
"in",
"unit",
"tests"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/deliverclient/opts.go#L65-L68 |
29,901 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockledger.go | NewMockLedger | func NewMockLedger(eventFactory EventFactory, sourceURL string) *MockLedger {
return &MockLedger{
eventFactory: eventFactory,
blockProducer: NewBlockProducer(),
sourceURL: sourceURL,
}
} | go | func NewMockLedger(eventFactory EventFactory, sourceURL string) *MockLedger {
return &MockLedger{
eventFactory: eventFactory,
blockProducer: NewBlockProducer(),
sourceURL: sourceURL,
}
} | [
"func",
"NewMockLedger",
"(",
"eventFactory",
"EventFactory",
",",
"sourceURL",
"string",
")",
"*",
"MockLedger",
"{",
"return",
"&",
"MockLedger",
"{",
"eventFactory",
":",
"eventFactory",
",",
"blockProducer",
":",
"NewBlockProducer",
"(",
")",
",",
"sourceURL",... | // NewMockLedger creates a new MockLedger | [
"NewMockLedger",
"creates",
"a",
"new",
"MockLedger"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockledger.go#L62-L68 |
29,902 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockledger.go | Register | func (l *MockLedger) Register(consumer Consumer) {
l.Lock()
defer l.Unlock()
l.consumers = append(l.consumers, consumer)
} | go | func (l *MockLedger) Register(consumer Consumer) {
l.Lock()
defer l.Unlock()
l.consumers = append(l.consumers, consumer)
} | [
"func",
"(",
"l",
"*",
"MockLedger",
")",
"Register",
"(",
"consumer",
"Consumer",
")",
"{",
"l",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"Unlock",
"(",
")",
"\n",
"l",
".",
"consumers",
"=",
"append",
"(",
"l",
".",
"consumers",
",",
"co... | // Register registers an event consumer | [
"Register",
"registers",
"an",
"event",
"consumer"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockledger.go#L76-L80 |
29,903 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockledger.go | Unregister | func (l *MockLedger) Unregister(Consumer Consumer) {
l.Lock()
defer l.Unlock()
for i, p := range l.consumers {
if p == Consumer {
if i != 0 {
l.consumers = l.consumers[1:]
}
l.consumers = l.consumers[1:]
break
}
}
} | go | func (l *MockLedger) Unregister(Consumer Consumer) {
l.Lock()
defer l.Unlock()
for i, p := range l.consumers {
if p == Consumer {
if i != 0 {
l.consumers = l.consumers[1:]
}
l.consumers = l.consumers[1:]
break
}
}
} | [
"func",
"(",
"l",
"*",
"MockLedger",
")",
"Unregister",
"(",
"Consumer",
"Consumer",
")",
"{",
"l",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"Unlock",
"(",
")",
"\n\n",
"for",
"i",
",",
"p",
":=",
"range",
"l",
".",
"consumers",
"{",
"if",... | // Unregister unregisters the given consumer | [
"Unregister",
"unregisters",
"the",
"given",
"consumer"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockledger.go#L83-L96 |
29,904 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockledger.go | NewBlock | func (l *MockLedger) NewBlock(channelID string, transactions ...*TxInfo) Block {
l.Lock()
defer l.Unlock()
block := NewBlockWrapper(l.blockProducer.NewBlock(channelID, transactions...))
l.Store(block)
return block
} | go | func (l *MockLedger) NewBlock(channelID string, transactions ...*TxInfo) Block {
l.Lock()
defer l.Unlock()
block := NewBlockWrapper(l.blockProducer.NewBlock(channelID, transactions...))
l.Store(block)
return block
} | [
"func",
"(",
"l",
"*",
"MockLedger",
")",
"NewBlock",
"(",
"channelID",
"string",
",",
"transactions",
"...",
"*",
"TxInfo",
")",
"Block",
"{",
"l",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"Unlock",
"(",
")",
"\n",
"block",
":=",
"NewBlockWra... | // NewBlock stores a new block on the ledger | [
"NewBlock",
"stores",
"a",
"new",
"block",
"on",
"the",
"ledger"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockledger.go#L99-L105 |
29,905 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockledger.go | NewFilteredBlock | func (l *MockLedger) NewFilteredBlock(channelID string, filteredTx ...*pb.FilteredTransaction) {
l.Lock()
defer l.Unlock()
l.Store(NewFilteredBlockWrapper(l.blockProducer.NewFilteredBlock(channelID, filteredTx...)))
} | go | func (l *MockLedger) NewFilteredBlock(channelID string, filteredTx ...*pb.FilteredTransaction) {
l.Lock()
defer l.Unlock()
l.Store(NewFilteredBlockWrapper(l.blockProducer.NewFilteredBlock(channelID, filteredTx...)))
} | [
"func",
"(",
"l",
"*",
"MockLedger",
")",
"NewFilteredBlock",
"(",
"channelID",
"string",
",",
"filteredTx",
"...",
"*",
"pb",
".",
"FilteredTransaction",
")",
"{",
"l",
".",
"Lock",
"(",
")",
"\n",
"defer",
"l",
".",
"Unlock",
"(",
")",
"\n",
"l",
"... | // NewFilteredBlock stores a new filtered block on the ledger | [
"NewFilteredBlock",
"stores",
"a",
"new",
"filtered",
"block",
"on",
"the",
"ledger"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockledger.go#L108-L112 |
29,906 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockledger.go | Store | func (l *MockLedger) Store(block Block) {
l.blocks = append(l.blocks, block)
for _, p := range l.consumers {
blockEvent := l.eventFactory(block, l.sourceURL)
p <- blockEvent
}
} | go | func (l *MockLedger) Store(block Block) {
l.blocks = append(l.blocks, block)
for _, p := range l.consumers {
blockEvent := l.eventFactory(block, l.sourceURL)
p <- blockEvent
}
} | [
"func",
"(",
"l",
"*",
"MockLedger",
")",
"Store",
"(",
"block",
"Block",
")",
"{",
"l",
".",
"blocks",
"=",
"append",
"(",
"l",
".",
"blocks",
",",
"block",
")",
"\n\n",
"for",
"_",
",",
"p",
":=",
"range",
"l",
".",
"consumers",
"{",
"blockEven... | // Store stores the given block to the ledger | [
"Store",
"stores",
"the",
"given",
"block",
"to",
"the",
"ledger"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockledger.go#L115-L122 |
29,907 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockledger.go | SendFrom | func (l *MockLedger) SendFrom(blockNum uint64) {
l.RLock()
defer l.RUnlock()
if blockNum >= uint64(len(l.blocks)) {
return
}
for _, block := range l.blocks[blockNum:] {
for _, p := range l.consumers {
p <- l.eventFactory(block, l.sourceURL)
}
}
} | go | func (l *MockLedger) SendFrom(blockNum uint64) {
l.RLock()
defer l.RUnlock()
if blockNum >= uint64(len(l.blocks)) {
return
}
for _, block := range l.blocks[blockNum:] {
for _, p := range l.consumers {
p <- l.eventFactory(block, l.sourceURL)
}
}
} | [
"func",
"(",
"l",
"*",
"MockLedger",
")",
"SendFrom",
"(",
"blockNum",
"uint64",
")",
"{",
"l",
".",
"RLock",
"(",
")",
"\n",
"defer",
"l",
".",
"RUnlock",
"(",
")",
"\n\n",
"if",
"blockNum",
">=",
"uint64",
"(",
"len",
"(",
"l",
".",
"blocks",
"... | // SendFrom sends block events to all registered consumers from the
// given block number | [
"SendFrom",
"sends",
"block",
"events",
"to",
"all",
"registered",
"consumers",
"from",
"the",
"given",
"block",
"number"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockledger.go#L126-L139 |
29,908 | hyperledger/fabric-sdk-go | pkg/client/common/discovery/dynamicdiscovery/localservice.go | newLocalService | func newLocalService(config fab.EndpointConfig, mspID string, opts ...coptions.Opt) *LocalService {
logger.Debug("Creating new local discovery service")
s := &LocalService{mspID: mspID}
s.service = newService(config, s.queryPeers, opts...)
return s
} | go | func newLocalService(config fab.EndpointConfig, mspID string, opts ...coptions.Opt) *LocalService {
logger.Debug("Creating new local discovery service")
s := &LocalService{mspID: mspID}
s.service = newService(config, s.queryPeers, opts...)
return s
} | [
"func",
"newLocalService",
"(",
"config",
"fab",
".",
"EndpointConfig",
",",
"mspID",
"string",
",",
"opts",
"...",
"coptions",
".",
"Opt",
")",
"*",
"LocalService",
"{",
"logger",
".",
"Debug",
"(",
"\"",
"\"",
")",
"\n\n",
"s",
":=",
"&",
"LocalService... | // newLocalService creates a Local Discovery Service to query the list of member peers in the local MSP. | [
"newLocalService",
"creates",
"a",
"Local",
"Discovery",
"Service",
"to",
"query",
"the",
"list",
"of",
"member",
"peers",
"in",
"the",
"local",
"MSP",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/discovery/dynamicdiscovery/localservice.go#L26-L32 |
29,909 | hyperledger/fabric-sdk-go | pkg/client/common/discovery/dynamicdiscovery/localservice.go | Initialize | func (s *LocalService) Initialize(ctx contextAPI.Local) error {
if ctx.Identifier().MSPID != s.mspID {
return errors.Errorf("expecting context for MSP [%s] but got [%s]", s.mspID, ctx.Identifier().MSPID)
}
return s.service.initialize(ctx)
} | go | func (s *LocalService) Initialize(ctx contextAPI.Local) error {
if ctx.Identifier().MSPID != s.mspID {
return errors.Errorf("expecting context for MSP [%s] but got [%s]", s.mspID, ctx.Identifier().MSPID)
}
return s.service.initialize(ctx)
} | [
"func",
"(",
"s",
"*",
"LocalService",
")",
"Initialize",
"(",
"ctx",
"contextAPI",
".",
"Local",
")",
"error",
"{",
"if",
"ctx",
".",
"Identifier",
"(",
")",
".",
"MSPID",
"!=",
"s",
".",
"mspID",
"{",
"return",
"errors",
".",
"Errorf",
"(",
"\"",
... | // Initialize initializes the service with local context | [
"Initialize",
"initializes",
"the",
"service",
"with",
"local",
"context"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/discovery/dynamicdiscovery/localservice.go#L35-L40 |
29,910 | hyperledger/fabric-sdk-go | pkg/client/common/discovery/dynamicdiscovery/localservice.go | filterLocalMSP | func (s *LocalService) filterLocalMSP(peers []fab.Peer) []fab.Peer {
localMSPID := s.ctx.Identifier().MSPID
var filteredPeers []fab.Peer
for _, p := range peers {
if p.MSPID() != localMSPID {
logger.Debugf("Peer [%s] is not part of the local MSP [%s] but in MSP [%s]", p.URL(), localMSPID, p.MSPID())
} else {
... | go | func (s *LocalService) filterLocalMSP(peers []fab.Peer) []fab.Peer {
localMSPID := s.ctx.Identifier().MSPID
var filteredPeers []fab.Peer
for _, p := range peers {
if p.MSPID() != localMSPID {
logger.Debugf("Peer [%s] is not part of the local MSP [%s] but in MSP [%s]", p.URL(), localMSPID, p.MSPID())
} else {
... | [
"func",
"(",
"s",
"*",
"LocalService",
")",
"filterLocalMSP",
"(",
"peers",
"[",
"]",
"fab",
".",
"Peer",
")",
"[",
"]",
"fab",
".",
"Peer",
"{",
"localMSPID",
":=",
"s",
".",
"ctx",
".",
"Identifier",
"(",
")",
".",
"MSPID",
"\n",
"var",
"filtered... | // Even though the local peer query should only return peers in the local
// MSP, this function double checks and logs a warning if this is not the case. | [
"Even",
"though",
"the",
"local",
"peer",
"query",
"should",
"only",
"return",
"peers",
"in",
"the",
"local",
"MSP",
"this",
"function",
"double",
"checks",
"and",
"logs",
"a",
"warning",
"if",
"this",
"is",
"not",
"the",
"case",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/discovery/dynamicdiscovery/localservice.go#L111-L122 |
29,911 | hyperledger/fabric-sdk-go | pkg/fab/channel/transactor.go | NewTransactor | func NewTransactor(reqCtx reqContext.Context, cfg fab.ChannelCfg) (*Transactor, error) {
ctx, ok := contextImpl.RequestClientContext(reqCtx)
if !ok {
return nil, errors.New("failed get client context from reqContext for create new transactor")
}
orderers, err := orderersFromChannelCfg(ctx, cfg)
if err != nil {... | go | func NewTransactor(reqCtx reqContext.Context, cfg fab.ChannelCfg) (*Transactor, error) {
ctx, ok := contextImpl.RequestClientContext(reqCtx)
if !ok {
return nil, errors.New("failed get client context from reqContext for create new transactor")
}
orderers, err := orderersFromChannelCfg(ctx, cfg)
if err != nil {... | [
"func",
"NewTransactor",
"(",
"reqCtx",
"reqContext",
".",
"Context",
",",
"cfg",
"fab",
".",
"ChannelCfg",
")",
"(",
"*",
"Transactor",
",",
"error",
")",
"{",
"ctx",
",",
"ok",
":=",
"contextImpl",
".",
"RequestClientContext",
"(",
"reqCtx",
")",
"\n",
... | // NewTransactor returns a Transactor for the current context and channel config. | [
"NewTransactor",
"returns",
"a",
"Transactor",
"for",
"the",
"current",
"context",
"and",
"channel",
"config",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/channel/transactor.go#L30-L52 |
29,912 | hyperledger/fabric-sdk-go | pkg/fab/channel/transactor.go | orderersFromChannel | func orderersFromChannel(ctx context.Client, channelID string) ([]fab.Orderer, error) {
chNetworkConfig := ctx.EndpointConfig().ChannelConfig(channelID)
orderers := []fab.Orderer{}
for _, chOrderer := range chNetworkConfig.Orderers {
ordererConfig, found := ctx.EndpointConfig().OrdererConfig(chOrderer)
if !fou... | go | func orderersFromChannel(ctx context.Client, channelID string) ([]fab.Orderer, error) {
chNetworkConfig := ctx.EndpointConfig().ChannelConfig(channelID)
orderers := []fab.Orderer{}
for _, chOrderer := range chNetworkConfig.Orderers {
ordererConfig, found := ctx.EndpointConfig().OrdererConfig(chOrderer)
if !fou... | [
"func",
"orderersFromChannel",
"(",
"ctx",
"context",
".",
"Client",
",",
"channelID",
"string",
")",
"(",
"[",
"]",
"fab",
".",
"Orderer",
",",
"error",
")",
"{",
"chNetworkConfig",
":=",
"ctx",
".",
"EndpointConfig",
"(",
")",
".",
"ChannelConfig",
"(",
... | //deprecated
//orderersFromChannel returns list of fab.Orderer by channel id
//will return empty list when orderers are not found in endpoint config | [
"deprecated",
"orderersFromChannel",
"returns",
"list",
"of",
"fab",
".",
"Orderer",
"by",
"channel",
"id",
"will",
"return",
"empty",
"list",
"when",
"orderers",
"are",
"not",
"found",
"in",
"endpoint",
"config"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/channel/transactor.go#L109-L129 |
29,913 | hyperledger/fabric-sdk-go | pkg/client/common/selection/options/opts.go | NewParams | func NewParams(opts []copts.Opt) *Params {
params := &Params{}
copts.Apply(params, opts)
return params
} | go | func NewParams(opts []copts.Opt) *Params {
params := &Params{}
copts.Apply(params, opts)
return params
} | [
"func",
"NewParams",
"(",
"opts",
"[",
"]",
"copts",
".",
"Opt",
")",
"*",
"Params",
"{",
"params",
":=",
"&",
"Params",
"{",
"}",
"\n",
"copts",
".",
"Apply",
"(",
"params",
",",
"opts",
")",
"\n",
"return",
"params",
"\n",
"}"
] | // NewParams creates new parameters based on the provided options | [
"NewParams",
"creates",
"new",
"parameters",
"based",
"on",
"the",
"provided",
"options"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/options/opts.go#L41-L45 |
29,914 | hyperledger/fabric-sdk-go | pkg/client/common/selection/options/opts.go | WithPeerFilter | func WithPeerFilter(value PeerFilter) copts.Opt {
return func(p copts.Params) {
logger.Debugf("Checking PeerFilter: %#+v", value)
if setter, ok := p.(peerFilterSetter); ok {
setter.SetPeerFilter(value)
}
}
} | go | func WithPeerFilter(value PeerFilter) copts.Opt {
return func(p copts.Params) {
logger.Debugf("Checking PeerFilter: %#+v", value)
if setter, ok := p.(peerFilterSetter); ok {
setter.SetPeerFilter(value)
}
}
} | [
"func",
"WithPeerFilter",
"(",
"value",
"PeerFilter",
")",
"copts",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"copts",
".",
"Params",
")",
"{",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"value",
")",
"\n",
"if",
"setter",
",",
"ok",
":=",
"... | // WithPeerFilter sets a peer filter which provides per-request filtering of peers | [
"WithPeerFilter",
"sets",
"a",
"peer",
"filter",
"which",
"provides",
"per",
"-",
"request",
"filtering",
"of",
"peers"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/options/opts.go#L48-L55 |
29,915 | hyperledger/fabric-sdk-go | pkg/client/common/selection/options/opts.go | WithPeerSorter | func WithPeerSorter(value PeerSorter) copts.Opt {
return func(p copts.Params) {
if setter, ok := p.(peerSorterSetter); ok {
setter.SetPeerSorter(value)
}
}
} | go | func WithPeerSorter(value PeerSorter) copts.Opt {
return func(p copts.Params) {
if setter, ok := p.(peerSorterSetter); ok {
setter.SetPeerSorter(value)
}
}
} | [
"func",
"WithPeerSorter",
"(",
"value",
"PeerSorter",
")",
"copts",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"copts",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"peerSorterSetter",
")",
";",
"ok",
"{",
"setter",
".",... | // WithPeerSorter sets a peer sorter function which provides per-request
// sorting of peers | [
"WithPeerSorter",
"sets",
"a",
"peer",
"sorter",
"function",
"which",
"provides",
"per",
"-",
"request",
"sorting",
"of",
"peers"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/options/opts.go#L59-L65 |
29,916 | hyperledger/fabric-sdk-go | pkg/client/common/selection/options/opts.go | WithPrioritySelector | func WithPrioritySelector(value PrioritySelector) copts.Opt {
return WithPeerSorter(func(peers []fab.Peer) []fab.Peer {
return sortPeers(peers, value)
})
} | go | func WithPrioritySelector(value PrioritySelector) copts.Opt {
return WithPeerSorter(func(peers []fab.Peer) []fab.Peer {
return sortPeers(peers, value)
})
} | [
"func",
"WithPrioritySelector",
"(",
"value",
"PrioritySelector",
")",
"copts",
".",
"Opt",
"{",
"return",
"WithPeerSorter",
"(",
"func",
"(",
"peers",
"[",
"]",
"fab",
".",
"Peer",
")",
"[",
"]",
"fab",
".",
"Peer",
"{",
"return",
"sortPeers",
"(",
"pee... | // WithPrioritySelector sets a priority selector function which provides per-request
// prioritization of peers | [
"WithPrioritySelector",
"sets",
"a",
"priority",
"selector",
"function",
"which",
"provides",
"per",
"-",
"request",
"prioritization",
"of",
"peers"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/options/opts.go#L69-L73 |
29,917 | hyperledger/fabric-sdk-go | pkg/client/common/selection/options/opts.go | WithRetryOpts | func WithRetryOpts(value retry.Opts) copts.Opt {
return func(p copts.Params) {
if setter, ok := p.(retryOptsSetter); ok {
setter.SetRetryOpts(value)
}
}
} | go | func WithRetryOpts(value retry.Opts) copts.Opt {
return func(p copts.Params) {
if setter, ok := p.(retryOptsSetter); ok {
setter.SetRetryOpts(value)
}
}
} | [
"func",
"WithRetryOpts",
"(",
"value",
"retry",
".",
"Opts",
")",
"copts",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"copts",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"retryOptsSetter",
")",
";",
"ok",
"{",
"sette... | // WithRetryOpts sets the retry options | [
"WithRetryOpts",
"sets",
"the",
"retry",
"options"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/options/opts.go#L76-L82 |
29,918 | hyperledger/fabric-sdk-go | pkg/client/common/selection/options/opts.go | SetPeerFilter | func (p *Params) SetPeerFilter(value PeerFilter) {
logger.Debugf("PeerFilter: %#+v", value)
p.PeerFilter = value
} | go | func (p *Params) SetPeerFilter(value PeerFilter) {
logger.Debugf("PeerFilter: %#+v", value)
p.PeerFilter = value
} | [
"func",
"(",
"p",
"*",
"Params",
")",
"SetPeerFilter",
"(",
"value",
"PeerFilter",
")",
"{",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"value",
")",
"\n",
"p",
".",
"PeerFilter",
"=",
"value",
"\n",
"}"
] | // SetPeerFilter sets the peer filter | [
"SetPeerFilter",
"sets",
"the",
"peer",
"filter"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/options/opts.go#L89-L92 |
29,919 | hyperledger/fabric-sdk-go | pkg/client/common/selection/options/opts.go | SetPeerSorter | func (p *Params) SetPeerSorter(value PeerSorter) {
logger.Debugf("PeerSorter: %#+v", value)
p.PeerSorter = value
} | go | func (p *Params) SetPeerSorter(value PeerSorter) {
logger.Debugf("PeerSorter: %#+v", value)
p.PeerSorter = value
} | [
"func",
"(",
"p",
"*",
"Params",
")",
"SetPeerSorter",
"(",
"value",
"PeerSorter",
")",
"{",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"value",
")",
"\n",
"p",
".",
"PeerSorter",
"=",
"value",
"\n",
"}"
] | // SetPeerSorter sets the priority selector | [
"SetPeerSorter",
"sets",
"the",
"priority",
"selector"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/options/opts.go#L99-L102 |
29,920 | hyperledger/fabric-sdk-go | pkg/client/common/selection/options/opts.go | SetRetryOpts | func (p *Params) SetRetryOpts(value retry.Opts) {
logger.Debugf("RetryOpts: %#+v", value)
p.RetryOpts = value
} | go | func (p *Params) SetRetryOpts(value retry.Opts) {
logger.Debugf("RetryOpts: %#+v", value)
p.RetryOpts = value
} | [
"func",
"(",
"p",
"*",
"Params",
")",
"SetRetryOpts",
"(",
"value",
"retry",
".",
"Opts",
")",
"{",
"logger",
".",
"Debugf",
"(",
"\"",
"\"",
",",
"value",
")",
"\n",
"p",
".",
"RetryOpts",
"=",
"value",
"\n",
"}"
] | // SetRetryOpts sets the priority selector | [
"SetRetryOpts",
"sets",
"the",
"priority",
"selector"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/options/opts.go#L109-L112 |
29,921 | hyperledger/fabric-sdk-go | pkg/common/errors/retry/invoker.go | NewInvoker | func NewInvoker(handler Handler, opts ...InvokerOpt) *RetryableInvoker {
invoker := &RetryableInvoker{
handler: handler,
}
for _, opt := range opts {
opt(invoker)
}
return invoker
} | go | func NewInvoker(handler Handler, opts ...InvokerOpt) *RetryableInvoker {
invoker := &RetryableInvoker{
handler: handler,
}
for _, opt := range opts {
opt(invoker)
}
return invoker
} | [
"func",
"NewInvoker",
"(",
"handler",
"Handler",
",",
"opts",
"...",
"InvokerOpt",
")",
"*",
"RetryableInvoker",
"{",
"invoker",
":=",
"&",
"RetryableInvoker",
"{",
"handler",
":",
"handler",
",",
"}",
"\n",
"for",
"_",
",",
"opt",
":=",
"range",
"opts",
... | // NewInvoker creates a new RetryableInvoker | [
"NewInvoker",
"creates",
"a",
"new",
"RetryableInvoker"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/common/errors/retry/invoker.go#L41-L49 |
29,922 | hyperledger/fabric-sdk-go | pkg/common/errors/retry/invoker.go | Invoke | func (ri *RetryableInvoker) Invoke(invocation Invocation) (interface{}, error) {
attemptNum := 0
var lastErr error
for {
attemptNum++
if attemptNum > 1 {
logger.Debugf("Retry attempt #%d on error [%s]", attemptNum, lastErr)
}
retval, err := invocation()
if err == nil {
if attemptNum > 1 {
logge... | go | func (ri *RetryableInvoker) Invoke(invocation Invocation) (interface{}, error) {
attemptNum := 0
var lastErr error
for {
attemptNum++
if attemptNum > 1 {
logger.Debugf("Retry attempt #%d on error [%s]", attemptNum, lastErr)
}
retval, err := invocation()
if err == nil {
if attemptNum > 1 {
logge... | [
"func",
"(",
"ri",
"*",
"RetryableInvoker",
")",
"Invoke",
"(",
"invocation",
"Invocation",
")",
"(",
"interface",
"{",
"}",
",",
"error",
")",
"{",
"attemptNum",
":=",
"0",
"\n",
"var",
"lastErr",
"error",
"\n\n",
"for",
"{",
"attemptNum",
"++",
"\n",
... | // Invoke invokes the given function and performs retries according
// to the retry options. | [
"Invoke",
"invokes",
"the",
"given",
"function",
"and",
"performs",
"retries",
"according",
"to",
"the",
"retry",
"options",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/common/errors/retry/invoker.go#L53-L83 |
29,923 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | GetLogger | func (p *Provider) GetLogger(module string) api.Logger {
newDefLogger := log.New(os.Stdout, fmt.Sprintf(logPrefixFormatter, module), log.Ldate|log.Ltime|log.LUTC)
return &Log{deflogger: newDefLogger, module: module}
} | go | func (p *Provider) GetLogger(module string) api.Logger {
newDefLogger := log.New(os.Stdout, fmt.Sprintf(logPrefixFormatter, module), log.Ldate|log.Ltime|log.LUTC)
return &Log{deflogger: newDefLogger, module: module}
} | [
"func",
"(",
"p",
"*",
"Provider",
")",
"GetLogger",
"(",
"module",
"string",
")",
"api",
".",
"Logger",
"{",
"newDefLogger",
":=",
"log",
".",
"New",
"(",
"os",
".",
"Stdout",
",",
"fmt",
".",
"Sprintf",
"(",
"logPrefixFormatter",
",",
"module",
")",
... | //GetLogger returns SDK logger implementation | [
"GetLogger",
"returns",
"SDK",
"logger",
"implementation"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L38-L41 |
29,924 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | InitLogger | func InitLogger(l api.LoggerProvider) {
loggerProviderOnce.Do(func() {
loggerProviderInstance = l
atomic.StoreInt32(&useCustomLogger, 1)
})
} | go | func InitLogger(l api.LoggerProvider) {
loggerProviderOnce.Do(func() {
loggerProviderInstance = l
atomic.StoreInt32(&useCustomLogger, 1)
})
} | [
"func",
"InitLogger",
"(",
"l",
"api",
".",
"LoggerProvider",
")",
"{",
"loggerProviderOnce",
".",
"Do",
"(",
"func",
"(",
")",
"{",
"loggerProviderInstance",
"=",
"l",
"\n",
"atomic",
".",
"StoreInt32",
"(",
"&",
"useCustomLogger",
",",
"1",
")",
"\n",
... | //InitLogger sets custom logger which will be used over deflogger.
//It is required to call this function before making any loggings. | [
"InitLogger",
"sets",
"custom",
"logger",
"which",
"will",
"be",
"used",
"over",
"deflogger",
".",
"It",
"is",
"required",
"to",
"call",
"this",
"function",
"before",
"making",
"any",
"loggings",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L50-L55 |
29,925 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | SetLevel | func SetLevel(module string, level api.Level) {
rwmutex.Lock()
defer rwmutex.Unlock()
moduleLevels.SetLevel(module, level)
} | go | func SetLevel(module string, level api.Level) {
rwmutex.Lock()
defer rwmutex.Unlock()
moduleLevels.SetLevel(module, level)
} | [
"func",
"SetLevel",
"(",
"module",
"string",
",",
"level",
"api",
".",
"Level",
")",
"{",
"rwmutex",
".",
"Lock",
"(",
")",
"\n",
"defer",
"rwmutex",
".",
"Unlock",
"(",
")",
"\n",
"moduleLevels",
".",
"SetLevel",
"(",
"module",
",",
"level",
")",
"\... | //SetLevel - setting log level for given module | [
"SetLevel",
"-",
"setting",
"log",
"level",
"for",
"given",
"module"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L79-L83 |
29,926 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | GetLevel | func GetLevel(module string) api.Level {
rwmutex.RLock()
defer rwmutex.RUnlock()
return moduleLevels.GetLevel(module)
} | go | func GetLevel(module string) api.Level {
rwmutex.RLock()
defer rwmutex.RUnlock()
return moduleLevels.GetLevel(module)
} | [
"func",
"GetLevel",
"(",
"module",
"string",
")",
"api",
".",
"Level",
"{",
"rwmutex",
".",
"RLock",
"(",
")",
"\n",
"defer",
"rwmutex",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"moduleLevels",
".",
"GetLevel",
"(",
"module",
")",
"\n",
"}"
] | //GetLevel - getting log level for given module | [
"GetLevel",
"-",
"getting",
"log",
"level",
"for",
"given",
"module"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L86-L90 |
29,927 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | IsEnabledFor | func IsEnabledFor(module string, level api.Level) bool {
rwmutex.RLock()
defer rwmutex.RUnlock()
return moduleLevels.IsEnabledFor(module, level)
} | go | func IsEnabledFor(module string, level api.Level) bool {
rwmutex.RLock()
defer rwmutex.RUnlock()
return moduleLevels.IsEnabledFor(module, level)
} | [
"func",
"IsEnabledFor",
"(",
"module",
"string",
",",
"level",
"api",
".",
"Level",
")",
"bool",
"{",
"rwmutex",
".",
"RLock",
"(",
")",
"\n",
"defer",
"rwmutex",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"moduleLevels",
".",
"IsEnabledFor",
"(",
"module... | //IsEnabledFor - Check if given log level is enabled for given module | [
"IsEnabledFor",
"-",
"Check",
"if",
"given",
"log",
"level",
"is",
"enabled",
"for",
"given",
"module"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L93-L97 |
29,928 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | HideCallerInfo | func HideCallerInfo(module string, level api.Level) {
rwmutex.Lock()
defer rwmutex.Unlock()
callerInfos.HideCallerInfo(module, level)
} | go | func HideCallerInfo(module string, level api.Level) {
rwmutex.Lock()
defer rwmutex.Unlock()
callerInfos.HideCallerInfo(module, level)
} | [
"func",
"HideCallerInfo",
"(",
"module",
"string",
",",
"level",
"api",
".",
"Level",
")",
"{",
"rwmutex",
".",
"Lock",
"(",
")",
"\n",
"defer",
"rwmutex",
".",
"Unlock",
"(",
")",
"\n",
"callerInfos",
".",
"HideCallerInfo",
"(",
"module",
",",
"level",
... | //HideCallerInfo - Do not show caller info in log lines for given log level | [
"HideCallerInfo",
"-",
"Do",
"not",
"show",
"caller",
"info",
"in",
"log",
"lines",
"for",
"given",
"log",
"level"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L107-L111 |
29,929 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | getLoggerOpts | func getLoggerOpts(module string, level api.Level) *loggerOpts {
rwmutex.RLock()
defer rwmutex.RUnlock()
return &loggerOpts{
levelEnabled: moduleLevels.IsEnabledFor(module, level),
callerInfoEnabled: callerInfos.IsCallerInfoEnabled(module, level),
}
} | go | func getLoggerOpts(module string, level api.Level) *loggerOpts {
rwmutex.RLock()
defer rwmutex.RUnlock()
return &loggerOpts{
levelEnabled: moduleLevels.IsEnabledFor(module, level),
callerInfoEnabled: callerInfos.IsCallerInfoEnabled(module, level),
}
} | [
"func",
"getLoggerOpts",
"(",
"module",
"string",
",",
"level",
"api",
".",
"Level",
")",
"*",
"loggerOpts",
"{",
"rwmutex",
".",
"RLock",
"(",
")",
"\n",
"defer",
"rwmutex",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"&",
"loggerOpts",
"{",
"levelEnabled... | //getLoggerOpts - returns LoggerOpts which can be used for customization | [
"getLoggerOpts",
"-",
"returns",
"LoggerOpts",
"which",
"can",
"be",
"used",
"for",
"customization"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L114-L121 |
29,930 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Print | func (l *Log) Print(args ...interface{}) {
if l.loadCustomLogger() {
l.customLogger.Print(args...)
return
}
l.deflogger.Print(args...)
} | go | func (l *Log) Print(args ...interface{}) {
if l.loadCustomLogger() {
l.customLogger.Print(args...)
return
}
l.deflogger.Print(args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Print",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"if",
"l",
".",
"loadCustomLogger",
"(",
")",
"{",
"l",
".",
"customLogger",
".",
"Print",
"(",
"args",
"...",
")",
"\n",
"return",
"\n",
"}",
"\n",
... | // Print calls go log.Output.
// Arguments are handled in the manner of fmt.Print. | [
"Print",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Print",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L191-L197 |
29,931 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Printf | func (l *Log) Printf(format string, args ...interface{}) {
if l.loadCustomLogger() {
l.customLogger.Printf(format, args...)
return
}
l.deflogger.Printf(format, args...)
} | go | func (l *Log) Printf(format string, args ...interface{}) {
if l.loadCustomLogger() {
l.customLogger.Printf(format, args...)
return
}
l.deflogger.Printf(format, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Printf",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"if",
"l",
".",
"loadCustomLogger",
"(",
")",
"{",
"l",
".",
"customLogger",
".",
"Printf",
"(",
"format",
",",
"args",
"..."... | // Printf calls go log.Output.
// Arguments are handled in the manner of fmt.Printf. | [
"Printf",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Printf",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L201-L207 |
29,932 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Println | func (l *Log) Println(args ...interface{}) {
if l.loadCustomLogger() {
l.customLogger.Println(args...)
return
}
l.deflogger.Println(args...)
} | go | func (l *Log) Println(args ...interface{}) {
if l.loadCustomLogger() {
l.customLogger.Println(args...)
return
}
l.deflogger.Println(args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Println",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"if",
"l",
".",
"loadCustomLogger",
"(",
")",
"{",
"l",
".",
"customLogger",
".",
"Println",
"(",
"args",
"...",
")",
"\n",
"return",
"\n",
"}",
"\... | // Println calls go log.Output.
// Arguments are handled in the manner of fmt.Println. | [
"Println",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Println",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L211-L217 |
29,933 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Debug | func (l *Log) Debug(args ...interface{}) {
opts := getLoggerOpts(l.module, api.DEBUG)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Debug(args...)
return
}
l.log(opts, api.DEBUG, args...)
} | go | func (l *Log) Debug(args ...interface{}) {
opts := getLoggerOpts(l.module, api.DEBUG)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Debug(args...)
return
}
l.log(opts, api.DEBUG, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Debug",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"DEBUG",
")",
"\n",
"if",
"!",
"opts",
".",
"levelEnabled",
"{",
"return",
"... | // Debug calls go log.Output.
// Arguments are handled in the manner of fmt.Print. | [
"Debug",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Print",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L221-L231 |
29,934 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Debugf | func (l *Log) Debugf(format string, args ...interface{}) {
opts := getLoggerOpts(l.module, api.DEBUG)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Debugf(format, args...)
return
}
l.logf(opts, api.DEBUG, format, args...)
} | go | func (l *Log) Debugf(format string, args ...interface{}) {
opts := getLoggerOpts(l.module, api.DEBUG)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Debugf(format, args...)
return
}
l.logf(opts, api.DEBUG, format, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Debugf",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"DEBUG",
")",
"\n",
"if",
"!",
"opts",
".",
"level... | // Debugf calls go log.Output.
// Arguments are handled in the manner of fmt.Printf. | [
"Debugf",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Printf",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L235-L245 |
29,935 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Debugln | func (l *Log) Debugln(args ...interface{}) {
opts := getLoggerOpts(l.module, api.DEBUG)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Debugln(args...)
return
}
l.logln(opts, api.DEBUG, args...)
} | go | func (l *Log) Debugln(args ...interface{}) {
opts := getLoggerOpts(l.module, api.DEBUG)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Debugln(args...)
return
}
l.logln(opts, api.DEBUG, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Debugln",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"DEBUG",
")",
"\n",
"if",
"!",
"opts",
".",
"levelEnabled",
"{",
"return",
... | // Debugln calls go log.Output.
// Arguments are handled in the manner of fmt.Println. | [
"Debugln",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Println",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L249-L259 |
29,936 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Info | func (l *Log) Info(args ...interface{}) {
opts := getLoggerOpts(l.module, api.INFO)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Info(args...)
return
}
l.log(opts, api.INFO, args...)
} | go | func (l *Log) Info(args ...interface{}) {
opts := getLoggerOpts(l.module, api.INFO)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Info(args...)
return
}
l.log(opts, api.INFO, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Info",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"INFO",
")",
"\n",
"if",
"!",
"opts",
".",
"levelEnabled",
"{",
"return",
"\n... | // Info calls go log.Output.
// Arguments are handled in the manner of fmt.Print. | [
"Info",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Print",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L263-L273 |
29,937 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Infof | func (l *Log) Infof(format string, args ...interface{}) {
opts := getLoggerOpts(l.module, api.INFO)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Infof(format, args...)
return
}
l.logf(opts, api.INFO, format, args...)
} | go | func (l *Log) Infof(format string, args ...interface{}) {
opts := getLoggerOpts(l.module, api.INFO)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Infof(format, args...)
return
}
l.logf(opts, api.INFO, format, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Infof",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"INFO",
")",
"\n",
"if",
"!",
"opts",
".",
"levelEn... | // Infof calls go log.Output.
// Arguments are handled in the manner of fmt.Printf. | [
"Infof",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Printf",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L277-L287 |
29,938 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Infoln | func (l *Log) Infoln(args ...interface{}) {
opts := getLoggerOpts(l.module, api.INFO)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Infoln(args...)
return
}
l.logln(opts, api.INFO, args...)
} | go | func (l *Log) Infoln(args ...interface{}) {
opts := getLoggerOpts(l.module, api.INFO)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Infoln(args...)
return
}
l.logln(opts, api.INFO, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Infoln",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"INFO",
")",
"\n",
"if",
"!",
"opts",
".",
"levelEnabled",
"{",
"return",
"... | // Infoln calls go log.Output.
// Arguments are handled in the manner of fmt.Println. | [
"Infoln",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Println",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L291-L301 |
29,939 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Warn | func (l *Log) Warn(args ...interface{}) {
opts := getLoggerOpts(l.module, api.WARNING)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Warn(args...)
return
}
l.log(opts, api.WARNING, args...)
} | go | func (l *Log) Warn(args ...interface{}) {
opts := getLoggerOpts(l.module, api.WARNING)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Warn(args...)
return
}
l.log(opts, api.WARNING, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Warn",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"WARNING",
")",
"\n",
"if",
"!",
"opts",
".",
"levelEnabled",
"{",
"return",
... | // Warn calls go log.Output.
// Arguments are handled in the manner of fmt.Print. | [
"Warn",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Print",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L305-L315 |
29,940 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Warnf | func (l *Log) Warnf(format string, args ...interface{}) {
opts := getLoggerOpts(l.module, api.WARNING)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Warnf(format, args...)
return
}
l.logf(opts, api.WARNING, format, args...)
} | go | func (l *Log) Warnf(format string, args ...interface{}) {
opts := getLoggerOpts(l.module, api.WARNING)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Warnf(format, args...)
return
}
l.logf(opts, api.WARNING, format, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Warnf",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"WARNING",
")",
"\n",
"if",
"!",
"opts",
".",
"leve... | // Warnf calls go log.Output.
// Arguments are handled in the manner of fmt.Printf. | [
"Warnf",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Printf",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L319-L329 |
29,941 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Warnln | func (l *Log) Warnln(args ...interface{}) {
opts := getLoggerOpts(l.module, api.WARNING)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Warnln(args...)
return
}
l.logln(opts, api.WARNING, args...)
} | go | func (l *Log) Warnln(args ...interface{}) {
opts := getLoggerOpts(l.module, api.WARNING)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Warnln(args...)
return
}
l.logln(opts, api.WARNING, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Warnln",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"WARNING",
")",
"\n",
"if",
"!",
"opts",
".",
"levelEnabled",
"{",
"return",
... | // Warnln calls go log.Output.
// Arguments are handled in the manner of fmt.Println. | [
"Warnln",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Println",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L333-L343 |
29,942 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Error | func (l *Log) Error(args ...interface{}) {
opts := getLoggerOpts(l.module, api.ERROR)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Error(args...)
return
}
l.log(opts, api.ERROR, args...)
} | go | func (l *Log) Error(args ...interface{}) {
opts := getLoggerOpts(l.module, api.ERROR)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Error(args...)
return
}
l.log(opts, api.ERROR, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Error",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"ERROR",
")",
"\n",
"if",
"!",
"opts",
".",
"levelEnabled",
"{",
"return",
"... | // Error calls go log.Output.
// Arguments are handled in the manner of fmt.Print. | [
"Error",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Print",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L347-L357 |
29,943 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Errorf | func (l *Log) Errorf(format string, args ...interface{}) {
opts := getLoggerOpts(l.module, api.ERROR)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Errorf(format, args...)
return
}
l.logf(opts, api.ERROR, format, args...)
} | go | func (l *Log) Errorf(format string, args ...interface{}) {
opts := getLoggerOpts(l.module, api.ERROR)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Errorf(format, args...)
return
}
l.logf(opts, api.ERROR, format, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Errorf",
"(",
"format",
"string",
",",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"ERROR",
")",
"\n",
"if",
"!",
"opts",
".",
"level... | // Errorf calls go log.Output.
// Arguments are handled in the manner of fmt.Printf. | [
"Errorf",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Printf",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L361-L371 |
29,944 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | Errorln | func (l *Log) Errorln(args ...interface{}) {
opts := getLoggerOpts(l.module, api.ERROR)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Errorln(args...)
return
}
l.logln(opts, api.ERROR, args...)
} | go | func (l *Log) Errorln(args ...interface{}) {
opts := getLoggerOpts(l.module, api.ERROR)
if !opts.levelEnabled {
return
}
if l.loadCustomLogger() {
l.customLogger.Errorln(args...)
return
}
l.logln(opts, api.ERROR, args...)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"Errorln",
"(",
"args",
"...",
"interface",
"{",
"}",
")",
"{",
"opts",
":=",
"getLoggerOpts",
"(",
"l",
".",
"module",
",",
"api",
".",
"ERROR",
")",
"\n",
"if",
"!",
"opts",
".",
"levelEnabled",
"{",
"return",
... | // Errorln calls go log.Output.
// Arguments are handled in the manner of fmt.Println. | [
"Errorln",
"calls",
"go",
"log",
".",
"Output",
".",
"Arguments",
"are",
"handled",
"in",
"the",
"manner",
"of",
"fmt",
".",
"Println",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L375-L385 |
29,945 | hyperledger/fabric-sdk-go | pkg/core/logging/modlog/modlog.go | ChangeOutput | func (l *Log) ChangeOutput(output io.Writer) {
l.deflogger.SetOutput(output)
} | go | func (l *Log) ChangeOutput(output io.Writer) {
l.deflogger.SetOutput(output)
} | [
"func",
"(",
"l",
"*",
"Log",
")",
"ChangeOutput",
"(",
"output",
"io",
".",
"Writer",
")",
"{",
"l",
".",
"deflogger",
".",
"SetOutput",
"(",
"output",
")",
"\n",
"}"
] | //ChangeOutput for changing output destination for the logger. | [
"ChangeOutput",
"for",
"changing",
"output",
"destination",
"for",
"the",
"logger",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/logging/modlog/modlog.go#L388-L390 |
29,946 | hyperledger/fabric-sdk-go | pkg/client/common/discovery/greylist/greylist.go | Accept | func (b *Filter) Accept(peer fab.Peer) bool {
peerAddress := endpoint.ToAddress(peer.URL())
value, ok := b.greylistURLs.Load(peerAddress)
if ok {
timeAdded, ok := value.(time.Time)
if ok && timeAdded.Add(b.expiryInterval).After(time.Now()) {
logger.Infof("Rejecting peer %s", peer.URL())
return false
}
... | go | func (b *Filter) Accept(peer fab.Peer) bool {
peerAddress := endpoint.ToAddress(peer.URL())
value, ok := b.greylistURLs.Load(peerAddress)
if ok {
timeAdded, ok := value.(time.Time)
if ok && timeAdded.Add(b.expiryInterval).After(time.Now()) {
logger.Infof("Rejecting peer %s", peer.URL())
return false
}
... | [
"func",
"(",
"b",
"*",
"Filter",
")",
"Accept",
"(",
"peer",
"fab",
".",
"Peer",
")",
"bool",
"{",
"peerAddress",
":=",
"endpoint",
".",
"ToAddress",
"(",
"peer",
".",
"URL",
"(",
")",
")",
"\n",
"value",
",",
"ok",
":=",
"b",
".",
"greylistURLs",
... | // Accept returns whether or not to Accept a peer as a canditate for endorsement | [
"Accept",
"returns",
"whether",
"or",
"not",
"to",
"Accept",
"a",
"peer",
"as",
"a",
"canditate",
"for",
"endorsement"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/discovery/greylist/greylist.go#L36-L49 |
29,947 | hyperledger/fabric-sdk-go | pkg/client/common/discovery/greylist/greylist.go | Greylist | func (b *Filter) Greylist(err error) {
s, ok := status.FromError(err)
if !ok {
return
}
if ok, peerURL := required(s); ok && peerURL != "" {
logger.Infof("Greylisting peer %s", peerURL)
b.greylistURLs.Store(peerURL, time.Now())
}
} | go | func (b *Filter) Greylist(err error) {
s, ok := status.FromError(err)
if !ok {
return
}
if ok, peerURL := required(s); ok && peerURL != "" {
logger.Infof("Greylisting peer %s", peerURL)
b.greylistURLs.Store(peerURL, time.Now())
}
} | [
"func",
"(",
"b",
"*",
"Filter",
")",
"Greylist",
"(",
"err",
"error",
")",
"{",
"s",
",",
"ok",
":=",
"status",
".",
"FromError",
"(",
"err",
")",
"\n",
"if",
"!",
"ok",
"{",
"return",
"\n",
"}",
"\n",
"if",
"ok",
",",
"peerURL",
":=",
"requir... | // Greylist the given peer URL | [
"Greylist",
"the",
"given",
"peer",
"URL"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/discovery/greylist/greylist.go#L52-L61 |
29,948 | hyperledger/fabric-sdk-go | pkg/client/common/discovery/greylist/greylist.go | required | func required(s *status.Status) (bool, string) {
if s.Group == status.EndorserClientStatus && s.Code == status.ConnectionFailed.ToInt32() {
return true, peerURLFromConnectionFailedStatus(s.Details)
}
return false, ""
} | go | func required(s *status.Status) (bool, string) {
if s.Group == status.EndorserClientStatus && s.Code == status.ConnectionFailed.ToInt32() {
return true, peerURLFromConnectionFailedStatus(s.Details)
}
return false, ""
} | [
"func",
"required",
"(",
"s",
"*",
"status",
".",
"Status",
")",
"(",
"bool",
",",
"string",
")",
"{",
"if",
"s",
".",
"Group",
"==",
"status",
".",
"EndorserClientStatus",
"&&",
"s",
".",
"Code",
"==",
"status",
".",
"ConnectionFailed",
".",
"ToInt32"... | // required decides whether the given status error warrants a greylist
// on the peer causing the error | [
"required",
"decides",
"whether",
"the",
"given",
"status",
"error",
"warrants",
"a",
"greylist",
"on",
"the",
"peer",
"causing",
"the",
"error"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/discovery/greylist/greylist.go#L65-L70 |
29,949 | hyperledger/fabric-sdk-go | pkg/client/common/discovery/greylist/greylist.go | peerURLFromConnectionFailedStatus | func peerURLFromConnectionFailedStatus(details []interface{}) string {
if len(details) != 0 {
url, ok := details[0].(string)
if ok {
return endpoint.ToAddress(url)
}
}
return ""
} | go | func peerURLFromConnectionFailedStatus(details []interface{}) string {
if len(details) != 0 {
url, ok := details[0].(string)
if ok {
return endpoint.ToAddress(url)
}
}
return ""
} | [
"func",
"peerURLFromConnectionFailedStatus",
"(",
"details",
"[",
"]",
"interface",
"{",
"}",
")",
"string",
"{",
"if",
"len",
"(",
"details",
")",
"!=",
"0",
"{",
"url",
",",
"ok",
":=",
"details",
"[",
"0",
"]",
".",
"(",
"string",
")",
"\n",
"if",... | // peerURLFromConnectionFailedStatus extracts the peer url from the status error
// details | [
"peerURLFromConnectionFailedStatus",
"extracts",
"the",
"peer",
"url",
"from",
"the",
"status",
"error",
"details"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/discovery/greylist/greylist.go#L74-L82 |
29,950 | hyperledger/fabric-sdk-go | pkg/client/common/discovery/dynamicdiscovery/service.go | initialize | func (s *service) initialize(ctx contextAPI.Client) error {
s.lock.Lock()
defer s.lock.Unlock()
if s.ctx != nil {
// Already initialized
logger.Debugf("Already initialized with context: %#v", s.ctx)
return nil
}
discoveryClient, err := clientProvider(ctx)
if err != nil {
return errors.Wrap(err, "error c... | go | func (s *service) initialize(ctx contextAPI.Client) error {
s.lock.Lock()
defer s.lock.Unlock()
if s.ctx != nil {
// Already initialized
logger.Debugf("Already initialized with context: %#v", s.ctx)
return nil
}
discoveryClient, err := clientProvider(ctx)
if err != nil {
return errors.Wrap(err, "error c... | [
"func",
"(",
"s",
"*",
"service",
")",
"initialize",
"(",
"ctx",
"contextAPI",
".",
"Client",
")",
"error",
"{",
"s",
".",
"lock",
".",
"Lock",
"(",
")",
"\n",
"defer",
"s",
".",
"lock",
".",
"Unlock",
"(",
")",
"\n\n",
"if",
"s",
".",
"ctx",
"... | // initialize initializes the service with client context | [
"initialize",
"initializes",
"the",
"service",
"with",
"client",
"context"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/discovery/dynamicdiscovery/service.go#L83-L102 |
29,951 | hyperledger/fabric-sdk-go | pkg/client/common/discovery/dynamicdiscovery/service.go | GetPeers | func (s *service) GetPeers() ([]fab.Peer, error) {
if s.peersRef.IsClosed() {
return nil, errors.Errorf("Discovery client has been closed")
}
refValue, err := s.peersRef.Get()
if err != nil {
return nil, err
}
peers, ok := refValue.([]fab.Peer)
if !ok {
return nil, errors.New("get peersRef didn't return P... | go | func (s *service) GetPeers() ([]fab.Peer, error) {
if s.peersRef.IsClosed() {
return nil, errors.Errorf("Discovery client has been closed")
}
refValue, err := s.peersRef.Get()
if err != nil {
return nil, err
}
peers, ok := refValue.([]fab.Peer)
if !ok {
return nil, errors.New("get peersRef didn't return P... | [
"func",
"(",
"s",
"*",
"service",
")",
"GetPeers",
"(",
")",
"(",
"[",
"]",
"fab",
".",
"Peer",
",",
"error",
")",
"{",
"if",
"s",
".",
"peersRef",
".",
"IsClosed",
"(",
")",
"{",
"return",
"nil",
",",
"errors",
".",
"Errorf",
"(",
"\"",
"\"",
... | // GetPeers returns the available peers | [
"GetPeers",
"returns",
"the",
"available",
"peers"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/discovery/dynamicdiscovery/service.go#L111-L125 |
29,952 | hyperledger/fabric-sdk-go | pkg/client/resmgmt/lscc.go | createChaincodeDeployProposal | func createChaincodeDeployProposal(txh fab.TransactionHeader, deploy chaincodeProposalType, channelID string, chaincode chaincodeDeployRequest) (*fab.TransactionProposal, error) {
// Generate arguments for deploy (channel, marshaled CCDS, marshaled chaincode policy, marshaled collection policy)
args := [][]byte{}
a... | go | func createChaincodeDeployProposal(txh fab.TransactionHeader, deploy chaincodeProposalType, channelID string, chaincode chaincodeDeployRequest) (*fab.TransactionProposal, error) {
// Generate arguments for deploy (channel, marshaled CCDS, marshaled chaincode policy, marshaled collection policy)
args := [][]byte{}
a... | [
"func",
"createChaincodeDeployProposal",
"(",
"txh",
"fab",
".",
"TransactionHeader",
",",
"deploy",
"chaincodeProposalType",
",",
"channelID",
"string",
",",
"chaincode",
"chaincodeDeployRequest",
")",
"(",
"*",
"fab",
".",
"TransactionProposal",
",",
"error",
")",
... | // createChaincodeDeployProposal creates an instantiate or upgrade chaincode proposal. | [
"createChaincodeDeployProposal",
"creates",
"an",
"instantiate",
"or",
"upgrade",
"chaincode",
"proposal",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/resmgmt/lscc.go#L48-L97 |
29,953 | hyperledger/fabric-sdk-go | pkg/fab/mocks/mockchannel.go | NewMockChannel | func NewMockChannel(channelID string) (*Channel, error) {
ctx := &mockClientContext{
Providers: NewMockProviderContext(),
SigningIdentity: mspmocks.NewMockSigningIdentity("user", "Org1MSP"),
}
// Set up mock channel service
chProvider, err := NewMockChannelProvider(ctx)
if err != nil {
return nil, er... | go | func NewMockChannel(channelID string) (*Channel, error) {
ctx := &mockClientContext{
Providers: NewMockProviderContext(),
SigningIdentity: mspmocks.NewMockSigningIdentity("user", "Org1MSP"),
}
// Set up mock channel service
chProvider, err := NewMockChannelProvider(ctx)
if err != nil {
return nil, er... | [
"func",
"NewMockChannel",
"(",
"channelID",
"string",
")",
"(",
"*",
"Channel",
",",
"error",
")",
"{",
"ctx",
":=",
"&",
"mockClientContext",
"{",
"Providers",
":",
"NewMockProviderContext",
"(",
")",
",",
"SigningIdentity",
":",
"mspmocks",
".",
"NewMockSign... | //NewMockChannel creates new mock channel | [
"NewMockChannel",
"creates",
"new",
"mock",
"channel"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/mocks/mockchannel.go#L46-L75 |
29,954 | hyperledger/fabric-sdk-go | pkg/common/errors/status/codes.go | String | func (c Code) String() string {
if s, ok := CodeName[c.ToInt32()]; ok {
return s
}
return strconv.Itoa(int(c))
} | go | func (c Code) String() string {
if s, ok := CodeName[c.ToInt32()]; ok {
return s
}
return strconv.Itoa(int(c))
} | [
"func",
"(",
"c",
"Code",
")",
"String",
"(",
")",
"string",
"{",
"if",
"s",
",",
"ok",
":=",
"CodeName",
"[",
"c",
".",
"ToInt32",
"(",
")",
"]",
";",
"ok",
"{",
"return",
"s",
"\n",
"}",
"\n",
"return",
"strconv",
".",
"Itoa",
"(",
"int",
"... | // String representation of the code | [
"String",
"representation",
"of",
"the",
"code"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/common/errors/status/codes.go#L94-L99 |
29,955 | hyperledger/fabric-sdk-go | pkg/core/cryptosuite/cryptosuite.go | GetDefault | func GetDefault() core.CryptoSuite {
if atomic.LoadInt32(&initialized) > 0 {
return defaultCryptoSuite
}
//Set default suite
logger.Info("No default cryptosuite found, using default SW implementation")
// Use SW as the default cryptosuite when not initialized properly - should be for testing only
s, err := sw.... | go | func GetDefault() core.CryptoSuite {
if atomic.LoadInt32(&initialized) > 0 {
return defaultCryptoSuite
}
//Set default suite
logger.Info("No default cryptosuite found, using default SW implementation")
// Use SW as the default cryptosuite when not initialized properly - should be for testing only
s, err := sw.... | [
"func",
"GetDefault",
"(",
")",
"core",
".",
"CryptoSuite",
"{",
"if",
"atomic",
".",
"LoadInt32",
"(",
"&",
"initialized",
")",
">",
"0",
"{",
"return",
"defaultCryptoSuite",
"\n",
"}",
"\n",
"//Set default suite",
"logger",
".",
"Info",
"(",
"\"",
"\"",
... | //GetDefault returns default core | [
"GetDefault",
"returns",
"default",
"core"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/core/cryptosuite/cryptosuite.go#L40-L58 |
29,956 | hyperledger/fabric-sdk-go | pkg/fab/resource/resource.go | WithRetry | func WithRetry(retry retry.Opts) Opt {
return func(options *options) {
options.retry = retry
}
} | go | func WithRetry(retry retry.Opts) Opt {
return func(options *options) {
options.retry = retry
}
} | [
"func",
"WithRetry",
"(",
"retry",
"retry",
".",
"Opts",
")",
"Opt",
"{",
"return",
"func",
"(",
"options",
"*",
"options",
")",
"{",
"options",
".",
"retry",
"=",
"retry",
"\n",
"}",
"\n",
"}"
] | // WithRetry supplies retry options | [
"WithRetry",
"supplies",
"retry",
"options"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/resource/resource.go#L46-L50 |
29,957 | hyperledger/fabric-sdk-go | pkg/fab/resource/resource.go | SignChannelConfig | func SignChannelConfig(ctx context.Client, config []byte, signer msp.SigningIdentity) (*common.ConfigSignature, error) {
logger.Debug("SignChannelConfig - start")
if config == nil {
return nil, errors.New("channel configuration required")
}
signingUser := signer
// If signing user is not provided default to cl... | go | func SignChannelConfig(ctx context.Client, config []byte, signer msp.SigningIdentity) (*common.ConfigSignature, error) {
logger.Debug("SignChannelConfig - start")
if config == nil {
return nil, errors.New("channel configuration required")
}
signingUser := signer
// If signing user is not provided default to cl... | [
"func",
"SignChannelConfig",
"(",
"ctx",
"context",
".",
"Client",
",",
"config",
"[",
"]",
"byte",
",",
"signer",
"msp",
".",
"SigningIdentity",
")",
"(",
"*",
"common",
".",
"ConfigSignature",
",",
"error",
")",
"{",
"logger",
".",
"Debug",
"(",
"\"",
... | // SignChannelConfig signs a configuration. | [
"SignChannelConfig",
"signs",
"a",
"configuration",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/resource/resource.go#L53-L76 |
29,958 | hyperledger/fabric-sdk-go | pkg/fab/resource/resource.go | CreateChannel | func CreateChannel(reqCtx reqContext.Context, request CreateChannelRequest, opts ...Opt) (fab.TransactionID, error) {
if request.Orderer == nil {
return fab.EmptyTransactionID, errors.New("missing orderer request parameter for the initialize channel")
}
if request.Name == "" {
return fab.EmptyTransactionID, err... | go | func CreateChannel(reqCtx reqContext.Context, request CreateChannelRequest, opts ...Opt) (fab.TransactionID, error) {
if request.Orderer == nil {
return fab.EmptyTransactionID, errors.New("missing orderer request parameter for the initialize channel")
}
if request.Name == "" {
return fab.EmptyTransactionID, err... | [
"func",
"CreateChannel",
"(",
"reqCtx",
"reqContext",
".",
"Context",
",",
"request",
"CreateChannelRequest",
",",
"opts",
"...",
"Opt",
")",
"(",
"fab",
".",
"TransactionID",
",",
"error",
")",
"{",
"if",
"request",
".",
"Orderer",
"==",
"nil",
"{",
"retu... | // CreateChannel calls the orderer to start building the new channel. | [
"CreateChannel",
"calls",
"the",
"orderer",
"to",
"start",
"building",
"the",
"new",
"channel",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/resource/resource.go#L79-L117 |
29,959 | hyperledger/fabric-sdk-go | pkg/fab/resource/resource.go | GenesisBlockFromOrderer | func GenesisBlockFromOrderer(reqCtx reqContext.Context, channelName string, orderer fab.Orderer, opts ...Opt) (*common.Block, error) {
optionsValue := getOpts(opts...)
return retrieveBlock(reqCtx, []fab.Orderer{orderer}, channelName, newSpecificSeekPosition(0), optionsValue)
} | go | func GenesisBlockFromOrderer(reqCtx reqContext.Context, channelName string, orderer fab.Orderer, opts ...Opt) (*common.Block, error) {
optionsValue := getOpts(opts...)
return retrieveBlock(reqCtx, []fab.Orderer{orderer}, channelName, newSpecificSeekPosition(0), optionsValue)
} | [
"func",
"GenesisBlockFromOrderer",
"(",
"reqCtx",
"reqContext",
".",
"Context",
",",
"channelName",
"string",
",",
"orderer",
"fab",
".",
"Orderer",
",",
"opts",
"...",
"Opt",
")",
"(",
"*",
"common",
".",
"Block",
",",
"error",
")",
"{",
"optionsValue",
"... | // GenesisBlockFromOrderer returns the genesis block from the defined orderer that may be
// used in a join request | [
"GenesisBlockFromOrderer",
"returns",
"the",
"genesis",
"block",
"from",
"the",
"defined",
"orderer",
"that",
"may",
"be",
"used",
"in",
"a",
"join",
"request"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/resource/resource.go#L135-L138 |
29,960 | hyperledger/fabric-sdk-go | pkg/fab/resource/resource.go | LastConfigFromOrderer | func LastConfigFromOrderer(reqCtx reqContext.Context, channelName string, orderer fab.Orderer, opts ...Opt) (*common.Block, error) {
logger.Debugf("channelConfig - start for channel %s", channelName)
optionsValue := getOpts(opts...)
// Get the newest block
block, err := retrieveBlock(reqCtx, []fab.Orderer{orderer... | go | func LastConfigFromOrderer(reqCtx reqContext.Context, channelName string, orderer fab.Orderer, opts ...Opt) (*common.Block, error) {
logger.Debugf("channelConfig - start for channel %s", channelName)
optionsValue := getOpts(opts...)
// Get the newest block
block, err := retrieveBlock(reqCtx, []fab.Orderer{orderer... | [
"func",
"LastConfigFromOrderer",
"(",
"reqCtx",
"reqContext",
".",
"Context",
",",
"channelName",
"string",
",",
"orderer",
"fab",
".",
"Orderer",
",",
"opts",
"...",
"Opt",
")",
"(",
"*",
"common",
".",
"Block",
",",
"error",
")",
"{",
"logger",
".",
"D... | // LastConfigFromOrderer fetches the current configuration block for the specified channel
// from the given orderer | [
"LastConfigFromOrderer",
"fetches",
"the",
"current",
"configuration",
"block",
"for",
"the",
"specified",
"channel",
"from",
"the",
"given",
"orderer"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/resource/resource.go#L142-L173 |
29,961 | hyperledger/fabric-sdk-go | pkg/fab/resource/resource.go | createOrUpdateChannel | func createOrUpdateChannel(reqCtx reqContext.Context, txh *txn.TransactionHeader, request CreateChannelRequest) error {
configUpdateEnvelope := &common.ConfigUpdateEnvelope{
ConfigUpdate: request.Config,
Signatures: request.Signatures,
}
configUpdateEnvelopeBytes, err := proto.Marshal(configUpdateEnvelope)
i... | go | func createOrUpdateChannel(reqCtx reqContext.Context, txh *txn.TransactionHeader, request CreateChannelRequest) error {
configUpdateEnvelope := &common.ConfigUpdateEnvelope{
ConfigUpdate: request.Config,
Signatures: request.Signatures,
}
configUpdateEnvelopeBytes, err := proto.Marshal(configUpdateEnvelope)
i... | [
"func",
"createOrUpdateChannel",
"(",
"reqCtx",
"reqContext",
".",
"Context",
",",
"txh",
"*",
"txn",
".",
"TransactionHeader",
",",
"request",
"CreateChannelRequest",
")",
"error",
"{",
"configUpdateEnvelope",
":=",
"&",
"common",
".",
"ConfigUpdateEnvelope",
"{",
... | // createOrUpdateChannel creates a new channel or updates an existing channel. | [
"createOrUpdateChannel",
"creates",
"a",
"new",
"channel",
"or",
"updates",
"an",
"existing",
"channel",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/resource/resource.go#L228-L268 |
29,962 | hyperledger/fabric-sdk-go | pkg/fab/resource/resource.go | QueryChannels | func QueryChannels(reqCtx reqContext.Context, peer fab.ProposalProcessor, opts ...Opt) (*pb.ChannelQueryResponse, error) {
if peer == nil {
return nil, errors.New("peer required")
}
optionsValue := getOpts(opts...)
cir := createChannelsInvokeRequest()
payload, err := queryChaincodeWithTarget(reqCtx, cir, peer... | go | func QueryChannels(reqCtx reqContext.Context, peer fab.ProposalProcessor, opts ...Opt) (*pb.ChannelQueryResponse, error) {
if peer == nil {
return nil, errors.New("peer required")
}
optionsValue := getOpts(opts...)
cir := createChannelsInvokeRequest()
payload, err := queryChaincodeWithTarget(reqCtx, cir, peer... | [
"func",
"QueryChannels",
"(",
"reqCtx",
"reqContext",
".",
"Context",
",",
"peer",
"fab",
".",
"ProposalProcessor",
",",
"opts",
"...",
"Opt",
")",
"(",
"*",
"pb",
".",
"ChannelQueryResponse",
",",
"error",
")",
"{",
"if",
"peer",
"==",
"nil",
"{",
"retu... | // QueryChannels queries the names of all the channels that a peer has joined. | [
"QueryChannels",
"queries",
"the",
"names",
"of",
"all",
"the",
"channels",
"that",
"a",
"peer",
"has",
"joined",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/resource/resource.go#L271-L291 |
29,963 | hyperledger/fabric-sdk-go | pkg/fab/resource/resource.go | InstallChaincode | func InstallChaincode(reqCtx reqContext.Context, req InstallChaincodeRequest, targets []fab.ProposalProcessor, opts ...Opt) ([]*fab.TransactionProposalResponse, fab.TransactionID, error) {
if req.Name == "" {
return nil, fab.EmptyTransactionID, errors.New("chaincode name required")
}
if req.Path == "" {
return ... | go | func InstallChaincode(reqCtx reqContext.Context, req InstallChaincodeRequest, targets []fab.ProposalProcessor, opts ...Opt) ([]*fab.TransactionProposalResponse, fab.TransactionID, error) {
if req.Name == "" {
return nil, fab.EmptyTransactionID, errors.New("chaincode name required")
}
if req.Path == "" {
return ... | [
"func",
"InstallChaincode",
"(",
"reqCtx",
"reqContext",
".",
"Context",
",",
"req",
"InstallChaincodeRequest",
",",
"targets",
"[",
"]",
"fab",
".",
"ProposalProcessor",
",",
"opts",
"...",
"Opt",
")",
"(",
"[",
"]",
"*",
"fab",
".",
"TransactionProposalRespo... | // InstallChaincode sends an install proposal to one or more endorsing peers. | [
"InstallChaincode",
"sends",
"an",
"install",
"proposal",
"to",
"one",
"or",
"more",
"endorsing",
"peers",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/resource/resource.go#L319-L371 |
29,964 | hyperledger/fabric-sdk-go | pkg/fab/comm/connectionopts.go | WithHostOverride | func WithHostOverride(value string) options.Opt {
return func(p options.Params) {
if setter, ok := p.(hostOverrideSetter); ok {
setter.SetHostOverride(value)
}
}
} | go | func WithHostOverride(value string) options.Opt {
return func(p options.Params) {
if setter, ok := p.(hostOverrideSetter); ok {
setter.SetHostOverride(value)
}
}
} | [
"func",
"WithHostOverride",
"(",
"value",
"string",
")",
"options",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"options",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"hostOverrideSetter",
")",
";",
"ok",
"{",
"setter",
... | // WithHostOverride sets the host name that will be used to resolve the TLS certificate | [
"WithHostOverride",
"sets",
"the",
"host",
"name",
"that",
"will",
"be",
"used",
"to",
"resolve",
"the",
"TLS",
"certificate"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/comm/connectionopts.go#L36-L42 |
29,965 | hyperledger/fabric-sdk-go | pkg/fab/comm/connectionopts.go | WithCertificate | func WithCertificate(value *x509.Certificate) options.Opt {
return func(p options.Params) {
if setter, ok := p.(certificateSetter); ok {
setter.SetCertificate(value)
}
}
} | go | func WithCertificate(value *x509.Certificate) options.Opt {
return func(p options.Params) {
if setter, ok := p.(certificateSetter); ok {
setter.SetCertificate(value)
}
}
} | [
"func",
"WithCertificate",
"(",
"value",
"*",
"x509",
".",
"Certificate",
")",
"options",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"options",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"certificateSetter",
")",
";",
... | // WithCertificate sets the X509 certificate used for the TLS connection | [
"WithCertificate",
"sets",
"the",
"X509",
"certificate",
"used",
"for",
"the",
"TLS",
"connection"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/comm/connectionopts.go#L45-L51 |
29,966 | hyperledger/fabric-sdk-go | pkg/fab/comm/connectionopts.go | WithKeepAliveParams | func WithKeepAliveParams(value keepalive.ClientParameters) options.Opt {
return func(p options.Params) {
if setter, ok := p.(keepAliveParamsSetter); ok {
setter.SetKeepAliveParams(value)
}
}
} | go | func WithKeepAliveParams(value keepalive.ClientParameters) options.Opt {
return func(p options.Params) {
if setter, ok := p.(keepAliveParamsSetter); ok {
setter.SetKeepAliveParams(value)
}
}
} | [
"func",
"WithKeepAliveParams",
"(",
"value",
"keepalive",
".",
"ClientParameters",
")",
"options",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"options",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"keepAliveParamsSetter",
")"... | // WithKeepAliveParams sets the GRPC keep-alive parameters | [
"WithKeepAliveParams",
"sets",
"the",
"GRPC",
"keep",
"-",
"alive",
"parameters"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/comm/connectionopts.go#L54-L60 |
29,967 | hyperledger/fabric-sdk-go | pkg/fab/comm/connectionopts.go | WithFailFast | func WithFailFast(value bool) options.Opt {
return func(p options.Params) {
if setter, ok := p.(failFastSetter); ok {
setter.SetFailFast(value)
}
}
} | go | func WithFailFast(value bool) options.Opt {
return func(p options.Params) {
if setter, ok := p.(failFastSetter); ok {
setter.SetFailFast(value)
}
}
} | [
"func",
"WithFailFast",
"(",
"value",
"bool",
")",
"options",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"options",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"failFastSetter",
")",
";",
"ok",
"{",
"setter",
".",
"Se... | // WithFailFast sets the GRPC fail-fast parameter | [
"WithFailFast",
"sets",
"the",
"GRPC",
"fail",
"-",
"fast",
"parameter"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/comm/connectionopts.go#L63-L69 |
29,968 | hyperledger/fabric-sdk-go | pkg/fab/comm/connectionopts.go | WithConnectTimeout | func WithConnectTimeout(value time.Duration) options.Opt {
return func(p options.Params) {
if setter, ok := p.(connectTimeoutSetter); ok {
setter.SetConnectTimeout(value)
}
}
} | go | func WithConnectTimeout(value time.Duration) options.Opt {
return func(p options.Params) {
if setter, ok := p.(connectTimeoutSetter); ok {
setter.SetConnectTimeout(value)
}
}
} | [
"func",
"WithConnectTimeout",
"(",
"value",
"time",
".",
"Duration",
")",
"options",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"options",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"connectTimeoutSetter",
")",
";",
"ok"... | // WithConnectTimeout sets the GRPC connection timeout | [
"WithConnectTimeout",
"sets",
"the",
"GRPC",
"connection",
"timeout"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/comm/connectionopts.go#L72-L78 |
29,969 | hyperledger/fabric-sdk-go | pkg/fab/comm/connectionopts.go | WithInsecure | func WithInsecure() options.Opt {
return func(p options.Params) {
if setter, ok := p.(insecureSetter); ok {
setter.SetInsecure(true)
}
}
} | go | func WithInsecure() options.Opt {
return func(p options.Params) {
if setter, ok := p.(insecureSetter); ok {
setter.SetInsecure(true)
}
}
} | [
"func",
"WithInsecure",
"(",
")",
"options",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"options",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"insecureSetter",
")",
";",
"ok",
"{",
"setter",
".",
"SetInsecure",
"(",
... | // WithInsecure indicates to fall back to an insecure connection if the
// connection URL does not specify a protocol | [
"WithInsecure",
"indicates",
"to",
"fall",
"back",
"to",
"an",
"insecure",
"connection",
"if",
"the",
"connection",
"URL",
"does",
"not",
"specify",
"a",
"protocol"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/comm/connectionopts.go#L82-L88 |
29,970 | hyperledger/fabric-sdk-go | pkg/fab/comm/connectionopts.go | OptsFromPeerConfig | func OptsFromPeerConfig(peerCfg *fab.PeerConfig) []options.Opt {
opts := []options.Opt{
WithHostOverride(getServerNameOverride(peerCfg)),
WithFailFast(getFailFast(peerCfg)),
WithKeepAliveParams(getKeepAliveOptions(peerCfg)),
WithCertificate(peerCfg.TLSCACert),
}
if isInsecureAllowed(peerCfg) {
opts = appe... | go | func OptsFromPeerConfig(peerCfg *fab.PeerConfig) []options.Opt {
opts := []options.Opt{
WithHostOverride(getServerNameOverride(peerCfg)),
WithFailFast(getFailFast(peerCfg)),
WithKeepAliveParams(getKeepAliveOptions(peerCfg)),
WithCertificate(peerCfg.TLSCACert),
}
if isInsecureAllowed(peerCfg) {
opts = appe... | [
"func",
"OptsFromPeerConfig",
"(",
"peerCfg",
"*",
"fab",
".",
"PeerConfig",
")",
"[",
"]",
"options",
".",
"Opt",
"{",
"opts",
":=",
"[",
"]",
"options",
".",
"Opt",
"{",
"WithHostOverride",
"(",
"getServerNameOverride",
"(",
"peerCfg",
")",
")",
",",
"... | // OptsFromPeerConfig returns a set of connection options from the given peer config | [
"OptsFromPeerConfig",
"returns",
"a",
"set",
"of",
"connection",
"options",
"from",
"the",
"given",
"peer",
"config"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/comm/connectionopts.go#L149-L162 |
29,971 | hyperledger/fabric-sdk-go | pkg/fab/events/client/peerresolver/preferpeer/preferpeer.go | New | func New(dispatcher service.Dispatcher, context context.Client, channelID string, preferredPeers []string, opts ...options.Opt) *PeerResolver {
params := defaultParams(context, channelID)
options.Apply(params, opts)
logger.Debugf("Creating new PreferPeer peer resolver with options: Preferred Peers [%s]", preferredP... | go | func New(dispatcher service.Dispatcher, context context.Client, channelID string, preferredPeers []string, opts ...options.Opt) *PeerResolver {
params := defaultParams(context, channelID)
options.Apply(params, opts)
logger.Debugf("Creating new PreferPeer peer resolver with options: Preferred Peers [%s]", preferredP... | [
"func",
"New",
"(",
"dispatcher",
"service",
".",
"Dispatcher",
",",
"context",
"context",
".",
"Client",
",",
"channelID",
"string",
",",
"preferredPeers",
"[",
"]",
"string",
",",
"opts",
"...",
"options",
".",
"Opt",
")",
"*",
"PeerResolver",
"{",
"para... | // New returns a new "prefer peer" resolver. | [
"New",
"returns",
"a",
"new",
"prefer",
"peer",
"resolver",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/client/peerresolver/preferpeer/preferpeer.go#L44-L56 |
29,972 | hyperledger/fabric-sdk-go | pkg/fab/events/client/peerresolver/preferpeer/preferpeer.go | Resolve | func (r *PeerResolver) Resolve(peers []fab.Peer) (fab.Peer, error) {
preferredPeers := r.getPreferredPeers(r.minBlockHeightResolver.Filter(peers))
if len(preferredPeers) > 0 {
// At least one of our preferred peers is suitable. Use the default balancer to balance between them.
logger.Debugf("Choosing a peer from ... | go | func (r *PeerResolver) Resolve(peers []fab.Peer) (fab.Peer, error) {
preferredPeers := r.getPreferredPeers(r.minBlockHeightResolver.Filter(peers))
if len(preferredPeers) > 0 {
// At least one of our preferred peers is suitable. Use the default balancer to balance between them.
logger.Debugf("Choosing a peer from ... | [
"func",
"(",
"r",
"*",
"PeerResolver",
")",
"Resolve",
"(",
"peers",
"[",
"]",
"fab",
".",
"Peer",
")",
"(",
"fab",
".",
"Peer",
",",
"error",
")",
"{",
"preferredPeers",
":=",
"r",
".",
"getPreferredPeers",
"(",
"r",
".",
"minBlockHeightResolver",
"."... | // Resolve uses the MinBlockHeight resolver to choose peers but will prefer the ones in the list of preferred peers. | [
"Resolve",
"uses",
"the",
"MinBlockHeight",
"resolver",
"to",
"choose",
"peers",
"but",
"will",
"prefer",
"the",
"ones",
"in",
"the",
"list",
"of",
"preferred",
"peers",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/client/peerresolver/preferpeer/preferpeer.go#L59-L69 |
29,973 | hyperledger/fabric-sdk-go | pkg/fab/events/client/peerresolver/preferpeer/preferpeer.go | ShouldDisconnect | func (r *PeerResolver) ShouldDisconnect(peers []fab.Peer, connectedPeer fab.Peer) bool {
if !r.isPreferred(connectedPeer) {
// We're not connected to a preferred peer. Check if we can connect back to one.
logger.Debugf("Currently connected to [%s]. Checking if any of the preferred peers [%s] is suitable to connect... | go | func (r *PeerResolver) ShouldDisconnect(peers []fab.Peer, connectedPeer fab.Peer) bool {
if !r.isPreferred(connectedPeer) {
// We're not connected to a preferred peer. Check if we can connect back to one.
logger.Debugf("Currently connected to [%s]. Checking if any of the preferred peers [%s] is suitable to connect... | [
"func",
"(",
"r",
"*",
"PeerResolver",
")",
"ShouldDisconnect",
"(",
"peers",
"[",
"]",
"fab",
".",
"Peer",
",",
"connectedPeer",
"fab",
".",
"Peer",
")",
"bool",
"{",
"if",
"!",
"r",
".",
"isPreferred",
"(",
"connectedPeer",
")",
"{",
"// We're not conn... | // ShouldDisconnect determines whether the connected peer should be disconnected and reconnected to the preferred peer. | [
"ShouldDisconnect",
"determines",
"whether",
"the",
"connected",
"peer",
"should",
"be",
"disconnected",
"and",
"reconnected",
"to",
"the",
"preferred",
"peer",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/client/peerresolver/preferpeer/preferpeer.go#L72-L87 |
29,974 | hyperledger/fabric-sdk-go | pkg/fab/events/client/dispatcher/opts.go | WithLoadBalancePolicy | func WithLoadBalancePolicy(value lbp.LoadBalancePolicy) options.Opt {
return func(p options.Params) {
if setter, ok := p.(loadBalancePolicySetter); ok {
setter.SetLoadBalancePolicy(value)
}
}
} | go | func WithLoadBalancePolicy(value lbp.LoadBalancePolicy) options.Opt {
return func(p options.Params) {
if setter, ok := p.(loadBalancePolicySetter); ok {
setter.SetLoadBalancePolicy(value)
}
}
} | [
"func",
"WithLoadBalancePolicy",
"(",
"value",
"lbp",
".",
"LoadBalancePolicy",
")",
"options",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"options",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"loadBalancePolicySetter",
")",... | // WithLoadBalancePolicy sets the load-balance policy to use when
// choosing an event endpoint from a set of endpoints | [
"WithLoadBalancePolicy",
"sets",
"the",
"load",
"-",
"balance",
"policy",
"to",
"use",
"when",
"choosing",
"an",
"event",
"endpoint",
"from",
"a",
"set",
"of",
"endpoints"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/client/dispatcher/opts.go#L53-L59 |
29,975 | hyperledger/fabric-sdk-go | pkg/fab/events/client/dispatcher/opts.go | WithPeerMonitorPeriod | func WithPeerMonitorPeriod(value time.Duration) options.Opt {
return func(p options.Params) {
if setter, ok := p.(peerMonitorPeriodSetter); ok {
setter.SetPeerMonitorPeriod(value)
}
}
} | go | func WithPeerMonitorPeriod(value time.Duration) options.Opt {
return func(p options.Params) {
if setter, ok := p.(peerMonitorPeriodSetter); ok {
setter.SetPeerMonitorPeriod(value)
}
}
} | [
"func",
"WithPeerMonitorPeriod",
"(",
"value",
"time",
".",
"Duration",
")",
"options",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"options",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"peerMonitorPeriodSetter",
")",
";",
... | // WithPeerMonitorPeriod is the period with which the connected peer is monitored
// to see whether or not it should be disconnected. | [
"WithPeerMonitorPeriod",
"is",
"the",
"period",
"with",
"which",
"the",
"connected",
"peer",
"is",
"monitored",
"to",
"see",
"whether",
"or",
"not",
"it",
"should",
"be",
"disconnected",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/client/dispatcher/opts.go#L63-L69 |
29,976 | hyperledger/fabric-sdk-go | pkg/fab/events/client/dispatcher/opts.go | WithPeerResolver | func WithPeerResolver(value peerresolver.Provider) options.Opt {
return func(p options.Params) {
if setter, ok := p.(peerResolverSetter); ok {
setter.SetPeerResolver(value)
}
}
} | go | func WithPeerResolver(value peerresolver.Provider) options.Opt {
return func(p options.Params) {
if setter, ok := p.(peerResolverSetter); ok {
setter.SetPeerResolver(value)
}
}
} | [
"func",
"WithPeerResolver",
"(",
"value",
"peerresolver",
".",
"Provider",
")",
"options",
".",
"Opt",
"{",
"return",
"func",
"(",
"p",
"options",
".",
"Params",
")",
"{",
"if",
"setter",
",",
"ok",
":=",
"p",
".",
"(",
"peerResolverSetter",
")",
";",
... | // WithPeerResolver sets the peer resolver that chooses the peer from a discovered list of peers. | [
"WithPeerResolver",
"sets",
"the",
"peer",
"resolver",
"that",
"chooses",
"the",
"peer",
"from",
"a",
"discovered",
"list",
"of",
"peers",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/client/dispatcher/opts.go#L72-L78 |
29,977 | hyperledger/fabric-sdk-go | pkg/client/common/selection/dynamicselection/pgresolver/mocks.go | NewPrincipal | func NewPrincipal(name string, classification mb.MSPPrincipal_Classification) (*mb.MSPPrincipal, error) {
member1Role, err := proto.Marshal(&mb.MSPRole{Role: mb.MSPRole_MEMBER, MspIdentifier: name})
if err != nil {
return nil, errors.WithMessage(err, "Error marshal MSPRole")
}
return &mb.MSPPrincipal{
Principal... | go | func NewPrincipal(name string, classification mb.MSPPrincipal_Classification) (*mb.MSPPrincipal, error) {
member1Role, err := proto.Marshal(&mb.MSPRole{Role: mb.MSPRole_MEMBER, MspIdentifier: name})
if err != nil {
return nil, errors.WithMessage(err, "Error marshal MSPRole")
}
return &mb.MSPPrincipal{
Principal... | [
"func",
"NewPrincipal",
"(",
"name",
"string",
",",
"classification",
"mb",
".",
"MSPPrincipal_Classification",
")",
"(",
"*",
"mb",
".",
"MSPPrincipal",
",",
"error",
")",
"{",
"member1Role",
",",
"err",
":=",
"proto",
".",
"Marshal",
"(",
"&",
"mb",
".",... | // NewPrincipal creates a new MSPPrincipal | [
"NewPrincipal",
"creates",
"a",
"new",
"MSPPrincipal"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/dynamicselection/pgresolver/mocks.go#L17-L25 |
29,978 | hyperledger/fabric-sdk-go | pkg/client/common/selection/dynamicselection/pgresolver/mocks.go | NewSignedByPolicy | func NewSignedByPolicy(index int32) *common.SignaturePolicy {
return &common.SignaturePolicy{
Type: &common.SignaturePolicy_SignedBy{
SignedBy: index,
}}
} | go | func NewSignedByPolicy(index int32) *common.SignaturePolicy {
return &common.SignaturePolicy{
Type: &common.SignaturePolicy_SignedBy{
SignedBy: index,
}}
} | [
"func",
"NewSignedByPolicy",
"(",
"index",
"int32",
")",
"*",
"common",
".",
"SignaturePolicy",
"{",
"return",
"&",
"common",
".",
"SignaturePolicy",
"{",
"Type",
":",
"&",
"common",
".",
"SignaturePolicy_SignedBy",
"{",
"SignedBy",
":",
"index",
",",
"}",
"... | // NewSignedByPolicy creates a SignaturePolicy at the given index | [
"NewSignedByPolicy",
"creates",
"a",
"SignaturePolicy",
"at",
"the",
"given",
"index"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/dynamicselection/pgresolver/mocks.go#L28-L33 |
29,979 | hyperledger/fabric-sdk-go | pkg/client/common/selection/dynamicselection/pgresolver/mocks.go | NewNOutOfPolicy | func NewNOutOfPolicy(n int32, signedBy ...*common.SignaturePolicy) *common.SignaturePolicy {
return &common.SignaturePolicy{
Type: &common.SignaturePolicy_NOutOf_{
NOutOf: &common.SignaturePolicy_NOutOf{
N: n,
Rules: signedBy,
}}}
} | go | func NewNOutOfPolicy(n int32, signedBy ...*common.SignaturePolicy) *common.SignaturePolicy {
return &common.SignaturePolicy{
Type: &common.SignaturePolicy_NOutOf_{
NOutOf: &common.SignaturePolicy_NOutOf{
N: n,
Rules: signedBy,
}}}
} | [
"func",
"NewNOutOfPolicy",
"(",
"n",
"int32",
",",
"signedBy",
"...",
"*",
"common",
".",
"SignaturePolicy",
")",
"*",
"common",
".",
"SignaturePolicy",
"{",
"return",
"&",
"common",
".",
"SignaturePolicy",
"{",
"Type",
":",
"&",
"common",
".",
"SignaturePol... | // NewNOutOfPolicy creates an NOutOf signature policy | [
"NewNOutOfPolicy",
"creates",
"an",
"NOutOf",
"signature",
"policy"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/dynamicselection/pgresolver/mocks.go#L36-L43 |
29,980 | hyperledger/fabric-sdk-go | pkg/client/common/selection/dynamicselection/pgresolver/mocks.go | GetPolicies | func GetPolicies(mspIDs ...string) (signedBy []*common.SignaturePolicy, identities []*mb.MSPPrincipal, err error) {
for i, mspID := range mspIDs {
signedBy = append(signedBy, NewSignedByPolicy(int32(i)))
principal, err := NewPrincipal(mspID, mb.MSPPrincipal_ROLE)
if err != nil {
return nil, nil, err
}
ide... | go | func GetPolicies(mspIDs ...string) (signedBy []*common.SignaturePolicy, identities []*mb.MSPPrincipal, err error) {
for i, mspID := range mspIDs {
signedBy = append(signedBy, NewSignedByPolicy(int32(i)))
principal, err := NewPrincipal(mspID, mb.MSPPrincipal_ROLE)
if err != nil {
return nil, nil, err
}
ide... | [
"func",
"GetPolicies",
"(",
"mspIDs",
"...",
"string",
")",
"(",
"signedBy",
"[",
"]",
"*",
"common",
".",
"SignaturePolicy",
",",
"identities",
"[",
"]",
"*",
"mb",
".",
"MSPPrincipal",
",",
"err",
"error",
")",
"{",
"for",
"i",
",",
"mspID",
":=",
... | // GetPolicies creates a set of 'signed by' signature policies and corresponding identities for the given set of MSP IDs | [
"GetPolicies",
"creates",
"a",
"set",
"of",
"signed",
"by",
"signature",
"policies",
"and",
"corresponding",
"identities",
"for",
"the",
"given",
"set",
"of",
"MSP",
"IDs"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/client/common/selection/dynamicselection/pgresolver/mocks.go#L46-L56 |
29,981 | hyperledger/fabric-sdk-go | pkg/msp/identitymgr.go | NewIdentityManager | func NewIdentityManager(orgName string, userStore msp.UserStore, cryptoSuite core.CryptoSuite, endpointConfig fab.EndpointConfig) (*IdentityManager, error) {
netConfig := endpointConfig.NetworkConfig()
// viper keys are case insensitive
orgConfig, ok := netConfig.Organizations[strings.ToLower(orgName)]
if !ok {
... | go | func NewIdentityManager(orgName string, userStore msp.UserStore, cryptoSuite core.CryptoSuite, endpointConfig fab.EndpointConfig) (*IdentityManager, error) {
netConfig := endpointConfig.NetworkConfig()
// viper keys are case insensitive
orgConfig, ok := netConfig.Organizations[strings.ToLower(orgName)]
if !ok {
... | [
"func",
"NewIdentityManager",
"(",
"orgName",
"string",
",",
"userStore",
"msp",
".",
"UserStore",
",",
"cryptoSuite",
"core",
".",
"CryptoSuite",
",",
"endpointConfig",
"fab",
".",
"EndpointConfig",
")",
"(",
"*",
"IdentityManager",
",",
"error",
")",
"{",
"n... | // NewIdentityManager creates a new instance of IdentityManager | [
"NewIdentityManager",
"creates",
"a",
"new",
"instance",
"of",
"IdentityManager"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/msp/identitymgr.go#L33-L79 |
29,982 | hyperledger/fabric-sdk-go | pkg/fab/mocks/mockmspmanager.go | NewMockMSPManagerWithError | func NewMockMSPManagerWithError(msps map[string]msp.MSP, err error) *MockMSPManager {
return &MockMSPManager{MSPs: msps, Err: err}
} | go | func NewMockMSPManagerWithError(msps map[string]msp.MSP, err error) *MockMSPManager {
return &MockMSPManager{MSPs: msps, Err: err}
} | [
"func",
"NewMockMSPManagerWithError",
"(",
"msps",
"map",
"[",
"string",
"]",
"msp",
".",
"MSP",
",",
"err",
"error",
")",
"*",
"MockMSPManager",
"{",
"return",
"&",
"MockMSPManager",
"{",
"MSPs",
":",
"msps",
",",
"Err",
":",
"err",
"}",
"\n",
"}"
] | // NewMockMSPManagerWithError mockcore msp manager | [
"NewMockMSPManagerWithError",
"mockcore",
"msp",
"manager"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/mocks/mockmspmanager.go#L26-L28 |
29,983 | hyperledger/fabric-sdk-go | pkg/fab/mocks/mockmspmanager.go | GetMSPs | func (mgr *MockMSPManager) GetMSPs() (map[string]msp.MSP, error) {
if mgr.Err != nil && mgr.Err.Error() == "GetMSPs" {
return nil, mgr.Err
}
return mgr.MSPs, nil
} | go | func (mgr *MockMSPManager) GetMSPs() (map[string]msp.MSP, error) {
if mgr.Err != nil && mgr.Err.Error() == "GetMSPs" {
return nil, mgr.Err
}
return mgr.MSPs, nil
} | [
"func",
"(",
"mgr",
"*",
"MockMSPManager",
")",
"GetMSPs",
"(",
")",
"(",
"map",
"[",
"string",
"]",
"msp",
".",
"MSP",
",",
"error",
")",
"{",
"if",
"mgr",
".",
"Err",
"!=",
"nil",
"&&",
"mgr",
".",
"Err",
".",
"Error",
"(",
")",
"==",
"\"",
... | // GetMSPs Provides a list of Membership Service providers | [
"GetMSPs",
"Provides",
"a",
"list",
"of",
"Membership",
"Service",
"providers"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/mocks/mockmspmanager.go#L46-L52 |
29,984 | hyperledger/fabric-sdk-go | pkg/fab/mocks/mockidentitymgr.go | NewMockIdentityManager | func NewMockIdentityManager(opts ...UsersOption) msp.IdentityManager {
manager := MockIdentityManager{}
usersOptions := UsersOptions{}
for _, param := range opts {
err := param(&usersOptions)
if err != nil {
panic(fmt.Errorf("failed to create IdentityManager: %s", err))
}
}
if usersOptions.users != nil... | go | func NewMockIdentityManager(opts ...UsersOption) msp.IdentityManager {
manager := MockIdentityManager{}
usersOptions := UsersOptions{}
for _, param := range opts {
err := param(&usersOptions)
if err != nil {
panic(fmt.Errorf("failed to create IdentityManager: %s", err))
}
}
if usersOptions.users != nil... | [
"func",
"NewMockIdentityManager",
"(",
"opts",
"...",
"UsersOption",
")",
"msp",
".",
"IdentityManager",
"{",
"manager",
":=",
"MockIdentityManager",
"{",
"}",
"\n\n",
"usersOptions",
":=",
"UsersOptions",
"{",
"}",
"\n\n",
"for",
"_",
",",
"param",
":=",
"ran... | // NewMockIdentityManager Constructor for a identity manager. | [
"NewMockIdentityManager",
"Constructor",
"for",
"a",
"identity",
"manager",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/mocks/mockidentitymgr.go#L54-L73 |
29,985 | hyperledger/fabric-sdk-go | pkg/fab/mocks/mockidentitymgr.go | GetSigningIdentity | func (mgr *MockIdentityManager) GetSigningIdentity(id string) (msp.SigningIdentity, error) {
si, ok := mgr.users[id]
if !ok {
return nil, msp.ErrUserNotFound
}
return si, nil
} | go | func (mgr *MockIdentityManager) GetSigningIdentity(id string) (msp.SigningIdentity, error) {
si, ok := mgr.users[id]
if !ok {
return nil, msp.ErrUserNotFound
}
return si, nil
} | [
"func",
"(",
"mgr",
"*",
"MockIdentityManager",
")",
"GetSigningIdentity",
"(",
"id",
"string",
")",
"(",
"msp",
".",
"SigningIdentity",
",",
"error",
")",
"{",
"si",
",",
"ok",
":=",
"mgr",
".",
"users",
"[",
"id",
"]",
"\n",
"if",
"!",
"ok",
"{",
... | // GetSigningIdentity will return an identity that can be used to cryptographically sign an object | [
"GetSigningIdentity",
"will",
"return",
"an",
"identity",
"that",
"can",
"be",
"used",
"to",
"cryptographically",
"sign",
"an",
"object"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/mocks/mockidentitymgr.go#L76-L82 |
29,986 | hyperledger/fabric-sdk-go | pkg/fab/mocks/mockorderer.go | SendBroadcast | func (o *MockOrderer) SendBroadcast(ctx reqContext.Context, envelope *fab.SignedEnvelope) (*common.Status, error) {
// Report this call to the listener
if o.BroadcastListener != nil {
o.BroadcastQueue <- envelope
}
select {
case err := <-o.BroadcastErrors:
return nil, err
default:
return nil, nil
}
} | go | func (o *MockOrderer) SendBroadcast(ctx reqContext.Context, envelope *fab.SignedEnvelope) (*common.Status, error) {
// Report this call to the listener
if o.BroadcastListener != nil {
o.BroadcastQueue <- envelope
}
select {
case err := <-o.BroadcastErrors:
return nil, err
default:
return nil, nil
}
} | [
"func",
"(",
"o",
"*",
"MockOrderer",
")",
"SendBroadcast",
"(",
"ctx",
"reqContext",
".",
"Context",
",",
"envelope",
"*",
"fab",
".",
"SignedEnvelope",
")",
"(",
"*",
"common",
".",
"Status",
",",
"error",
")",
"{",
"// Report this call to the listener",
"... | // SendBroadcast accepts client broadcast calls and reports them to the listener channel
// Returns the first enqueued error, or nil if there are no enqueued errors | [
"SendBroadcast",
"accepts",
"client",
"broadcast",
"calls",
"and",
"reports",
"them",
"to",
"the",
"listener",
"channel",
"Returns",
"the",
"first",
"enqueued",
"error",
"or",
"nil",
"if",
"there",
"are",
"no",
"enqueued",
"errors"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/mocks/mockorderer.go#L88-L99 |
29,987 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockevents.go | NewBlock | func NewBlock(channelID string, transactions ...*TxInfo) *cb.Block {
var data [][]byte
txValidationFlags := make([]uint8, len(transactions))
for i, txInfo := range transactions {
envBytes, err := proto.Marshal(newEnvelope(channelID, txInfo))
if err != nil {
panic(err)
}
data = append(data, envBytes)
txV... | go | func NewBlock(channelID string, transactions ...*TxInfo) *cb.Block {
var data [][]byte
txValidationFlags := make([]uint8, len(transactions))
for i, txInfo := range transactions {
envBytes, err := proto.Marshal(newEnvelope(channelID, txInfo))
if err != nil {
panic(err)
}
data = append(data, envBytes)
txV... | [
"func",
"NewBlock",
"(",
"channelID",
"string",
",",
"transactions",
"...",
"*",
"TxInfo",
")",
"*",
"cb",
".",
"Block",
"{",
"var",
"data",
"[",
"]",
"[",
"]",
"byte",
"\n",
"txValidationFlags",
":=",
"make",
"(",
"[",
"]",
"uint8",
",",
"len",
"(",... | // NewBlock returns a new mock block initialized with the given channel | [
"NewBlock",
"returns",
"a",
"new",
"mock",
"block",
"initialized",
"with",
"the",
"given",
"channel"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockevents.go#L16-L36 |
29,988 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockevents.go | NewTransaction | func NewTransaction(txID string, txValidationCode pb.TxValidationCode, headerType cb.HeaderType) *TxInfo {
return &TxInfo{
TxID: txID,
TxValidationCode: txValidationCode,
HeaderType: headerType,
}
} | go | func NewTransaction(txID string, txValidationCode pb.TxValidationCode, headerType cb.HeaderType) *TxInfo {
return &TxInfo{
TxID: txID,
TxValidationCode: txValidationCode,
HeaderType: headerType,
}
} | [
"func",
"NewTransaction",
"(",
"txID",
"string",
",",
"txValidationCode",
"pb",
".",
"TxValidationCode",
",",
"headerType",
"cb",
".",
"HeaderType",
")",
"*",
"TxInfo",
"{",
"return",
"&",
"TxInfo",
"{",
"TxID",
":",
"txID",
",",
"TxValidationCode",
":",
"tx... | // NewTransaction creates a new transaction | [
"NewTransaction",
"creates",
"a",
"new",
"transaction"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockevents.go#L50-L56 |
29,989 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockevents.go | NewTransactionWithCCEvent | func NewTransactionWithCCEvent(txID string, txValidationCode pb.TxValidationCode, ccID string, eventName string, payload []byte) *TxInfo {
return &TxInfo{
TxID: txID,
TxValidationCode: txValidationCode,
ChaincodeID: ccID,
EventName: eventName,
Payload: payload,
HeaderType: ... | go | func NewTransactionWithCCEvent(txID string, txValidationCode pb.TxValidationCode, ccID string, eventName string, payload []byte) *TxInfo {
return &TxInfo{
TxID: txID,
TxValidationCode: txValidationCode,
ChaincodeID: ccID,
EventName: eventName,
Payload: payload,
HeaderType: ... | [
"func",
"NewTransactionWithCCEvent",
"(",
"txID",
"string",
",",
"txValidationCode",
"pb",
".",
"TxValidationCode",
",",
"ccID",
"string",
",",
"eventName",
"string",
",",
"payload",
"[",
"]",
"byte",
")",
"*",
"TxInfo",
"{",
"return",
"&",
"TxInfo",
"{",
"T... | // NewTransactionWithCCEvent creates a new transaction with the given chaincode event | [
"NewTransactionWithCCEvent",
"creates",
"a",
"new",
"transaction",
"with",
"the",
"given",
"chaincode",
"event"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockevents.go#L59-L68 |
29,990 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockevents.go | NewFilteredBlock | func NewFilteredBlock(channelID string, filteredTx ...*pb.FilteredTransaction) *pb.FilteredBlock {
return &pb.FilteredBlock{
ChannelId: channelID,
FilteredTransactions: filteredTx,
}
} | go | func NewFilteredBlock(channelID string, filteredTx ...*pb.FilteredTransaction) *pb.FilteredBlock {
return &pb.FilteredBlock{
ChannelId: channelID,
FilteredTransactions: filteredTx,
}
} | [
"func",
"NewFilteredBlock",
"(",
"channelID",
"string",
",",
"filteredTx",
"...",
"*",
"pb",
".",
"FilteredTransaction",
")",
"*",
"pb",
".",
"FilteredBlock",
"{",
"return",
"&",
"pb",
".",
"FilteredBlock",
"{",
"ChannelId",
":",
"channelID",
",",
"FilteredTra... | // NewFilteredBlock returns a new mock filtered block initialized with the given channel
// and filtered transactions | [
"NewFilteredBlock",
"returns",
"a",
"new",
"mock",
"filtered",
"block",
"initialized",
"with",
"the",
"given",
"channel",
"and",
"filtered",
"transactions"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockevents.go#L72-L77 |
29,991 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockevents.go | NewFilteredTx | func NewFilteredTx(txID string, txValidationCode pb.TxValidationCode) *pb.FilteredTransaction {
return &pb.FilteredTransaction{
Txid: txID,
TxValidationCode: txValidationCode,
}
} | go | func NewFilteredTx(txID string, txValidationCode pb.TxValidationCode) *pb.FilteredTransaction {
return &pb.FilteredTransaction{
Txid: txID,
TxValidationCode: txValidationCode,
}
} | [
"func",
"NewFilteredTx",
"(",
"txID",
"string",
",",
"txValidationCode",
"pb",
".",
"TxValidationCode",
")",
"*",
"pb",
".",
"FilteredTransaction",
"{",
"return",
"&",
"pb",
".",
"FilteredTransaction",
"{",
"Txid",
":",
"txID",
",",
"TxValidationCode",
":",
"t... | // NewFilteredTx returns a new mock filtered transaction | [
"NewFilteredTx",
"returns",
"a",
"new",
"mock",
"filtered",
"transaction"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockevents.go#L80-L85 |
29,992 | hyperledger/fabric-sdk-go | pkg/fab/events/service/mocks/mockevents.go | NewFilteredTxWithCCEvent | func NewFilteredTxWithCCEvent(txID, ccID, event string) *pb.FilteredTransaction {
return &pb.FilteredTransaction{
Txid: txID,
Data: &pb.FilteredTransaction_TransactionActions{
TransactionActions: &pb.FilteredTransactionActions{
ChaincodeActions: []*pb.FilteredChaincodeAction{
{
ChaincodeEvent: &p... | go | func NewFilteredTxWithCCEvent(txID, ccID, event string) *pb.FilteredTransaction {
return &pb.FilteredTransaction{
Txid: txID,
Data: &pb.FilteredTransaction_TransactionActions{
TransactionActions: &pb.FilteredTransactionActions{
ChaincodeActions: []*pb.FilteredChaincodeAction{
{
ChaincodeEvent: &p... | [
"func",
"NewFilteredTxWithCCEvent",
"(",
"txID",
",",
"ccID",
",",
"event",
"string",
")",
"*",
"pb",
".",
"FilteredTransaction",
"{",
"return",
"&",
"pb",
".",
"FilteredTransaction",
"{",
"Txid",
":",
"txID",
",",
"Data",
":",
"&",
"pb",
".",
"FilteredTra... | // NewFilteredTxWithCCEvent returns a new mock filtered transaction
// with the given chaincode event | [
"NewFilteredTxWithCCEvent",
"returns",
"a",
"new",
"mock",
"filtered",
"transaction",
"with",
"the",
"given",
"chaincode",
"event"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/events/service/mocks/mockevents.go#L89-L106 |
29,993 | hyperledger/fabric-sdk-go | pkg/fab/orderer/orderer.go | New | func New(config fab.EndpointConfig, opts ...Option) (*Orderer, error) {
orderer := &Orderer{
config: config,
commManager: &defCommManager{},
}
for _, opt := range opts {
err := opt(orderer)
if err != nil {
return nil, err
}
}
var grpcOpts []grpc.DialOption
if orderer.kap.Time > 0 {
grpcOpts ... | go | func New(config fab.EndpointConfig, opts ...Option) (*Orderer, error) {
orderer := &Orderer{
config: config,
commManager: &defCommManager{},
}
for _, opt := range opts {
err := opt(orderer)
if err != nil {
return nil, err
}
}
var grpcOpts []grpc.DialOption
if orderer.kap.Time > 0 {
grpcOpts ... | [
"func",
"New",
"(",
"config",
"fab",
".",
"EndpointConfig",
",",
"opts",
"...",
"Option",
")",
"(",
"*",
"Orderer",
",",
"error",
")",
"{",
"orderer",
":=",
"&",
"Orderer",
"{",
"config",
":",
"config",
",",
"commManager",
":",
"&",
"defCommManager",
"... | // New Returns a Orderer instance | [
"New",
"Returns",
"a",
"Orderer",
"instance"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/orderer/orderer.go#L60-L101 |
29,994 | hyperledger/fabric-sdk-go | pkg/fab/orderer/orderer.go | WithURL | func WithURL(url string) Option {
return func(o *Orderer) error {
o.url = url
return nil
}
} | go | func WithURL(url string) Option {
return func(o *Orderer) error {
o.url = url
return nil
}
} | [
"func",
"WithURL",
"(",
"url",
"string",
")",
"Option",
"{",
"return",
"func",
"(",
"o",
"*",
"Orderer",
")",
"error",
"{",
"o",
".",
"url",
"=",
"url",
"\n\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] | // WithURL is a functional option for the orderer.New constructor that configures the orderer's URL. | [
"WithURL",
"is",
"a",
"functional",
"option",
"for",
"the",
"orderer",
".",
"New",
"constructor",
"that",
"configures",
"the",
"orderer",
"s",
"URL",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/orderer/orderer.go#L104-L110 |
29,995 | hyperledger/fabric-sdk-go | pkg/fab/orderer/orderer.go | WithTLSCert | func WithTLSCert(tlsCACert *x509.Certificate) Option {
return func(o *Orderer) error {
o.tlsCACert = tlsCACert
return nil
}
} | go | func WithTLSCert(tlsCACert *x509.Certificate) Option {
return func(o *Orderer) error {
o.tlsCACert = tlsCACert
return nil
}
} | [
"func",
"WithTLSCert",
"(",
"tlsCACert",
"*",
"x509",
".",
"Certificate",
")",
"Option",
"{",
"return",
"func",
"(",
"o",
"*",
"Orderer",
")",
"error",
"{",
"o",
".",
"tlsCACert",
"=",
"tlsCACert",
"\n\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] | // WithTLSCert is a functional option for the orderer.New constructor that configures the orderer's TLS certificate | [
"WithTLSCert",
"is",
"a",
"functional",
"option",
"for",
"the",
"orderer",
".",
"New",
"constructor",
"that",
"configures",
"the",
"orderer",
"s",
"TLS",
"certificate"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/orderer/orderer.go#L113-L119 |
29,996 | hyperledger/fabric-sdk-go | pkg/fab/orderer/orderer.go | WithServerName | func WithServerName(serverName string) Option {
return func(o *Orderer) error {
o.serverName = serverName
return nil
}
} | go | func WithServerName(serverName string) Option {
return func(o *Orderer) error {
o.serverName = serverName
return nil
}
} | [
"func",
"WithServerName",
"(",
"serverName",
"string",
")",
"Option",
"{",
"return",
"func",
"(",
"o",
"*",
"Orderer",
")",
"error",
"{",
"o",
".",
"serverName",
"=",
"serverName",
"\n\n",
"return",
"nil",
"\n",
"}",
"\n",
"}"
] | // WithServerName is a functional option for the orderer.New constructor that configures the orderer's server name | [
"WithServerName",
"is",
"a",
"functional",
"option",
"for",
"the",
"orderer",
".",
"New",
"constructor",
"that",
"configures",
"the",
"orderer",
"s",
"server",
"name"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/orderer/orderer.go#L122-L128 |
29,997 | hyperledger/fabric-sdk-go | pkg/fab/orderer/orderer.go | FromOrdererConfig | func FromOrdererConfig(ordererCfg *fab.OrdererConfig) Option {
return func(o *Orderer) error {
o.url = ordererCfg.URL
o.tlsCACert = ordererCfg.TLSCACert
if ordererCfg.GRPCOptions["allow-insecure"] == false {
//verify if certificate was expired or not yet valid
err := verifier.ValidateCertificateDates(o.tl... | go | func FromOrdererConfig(ordererCfg *fab.OrdererConfig) Option {
return func(o *Orderer) error {
o.url = ordererCfg.URL
o.tlsCACert = ordererCfg.TLSCACert
if ordererCfg.GRPCOptions["allow-insecure"] == false {
//verify if certificate was expired or not yet valid
err := verifier.ValidateCertificateDates(o.tl... | [
"func",
"FromOrdererConfig",
"(",
"ordererCfg",
"*",
"fab",
".",
"OrdererConfig",
")",
"Option",
"{",
"return",
"func",
"(",
"o",
"*",
"Orderer",
")",
"error",
"{",
"o",
".",
"url",
"=",
"ordererCfg",
".",
"URL",
"\n",
"o",
".",
"tlsCACert",
"=",
"orde... | // FromOrdererConfig is a functional option for the orderer.New constructor that configures a new orderer
// from a apiconfig.OrdererConfig struct | [
"FromOrdererConfig",
"is",
"a",
"functional",
"option",
"for",
"the",
"orderer",
".",
"New",
"constructor",
"that",
"configures",
"a",
"new",
"orderer",
"from",
"a",
"apiconfig",
".",
"OrdererConfig",
"struct"
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/orderer/orderer.go#L141-L162 |
29,998 | hyperledger/fabric-sdk-go | pkg/fab/orderer/orderer.go | FromOrdererName | func FromOrdererName(name string) Option {
return func(o *Orderer) error {
ordererCfg, found := o.config.OrdererConfig(name)
if !found {
return errors.Errorf("orderer config not found for orderer : %s", name)
}
return FromOrdererConfig(ordererCfg)(o)
}
} | go | func FromOrdererName(name string) Option {
return func(o *Orderer) error {
ordererCfg, found := o.config.OrdererConfig(name)
if !found {
return errors.Errorf("orderer config not found for orderer : %s", name)
}
return FromOrdererConfig(ordererCfg)(o)
}
} | [
"func",
"FromOrdererName",
"(",
"name",
"string",
")",
"Option",
"{",
"return",
"func",
"(",
"o",
"*",
"Orderer",
")",
"error",
"{",
"ordererCfg",
",",
"found",
":=",
"o",
".",
"config",
".",
"OrdererConfig",
"(",
"name",
")",
"\n",
"if",
"!",
"found",... | // FromOrdererName is a functional option for the orderer.New constructor that obtains an apiconfig.OrdererConfig
// by name from the apiconfig.Config supplied to the constructor, and then constructs a new orderer from it | [
"FromOrdererName",
"is",
"a",
"functional",
"option",
"for",
"the",
"orderer",
".",
"New",
"constructor",
"that",
"obtains",
"an",
"apiconfig",
".",
"OrdererConfig",
"by",
"name",
"from",
"the",
"apiconfig",
".",
"Config",
"supplied",
"to",
"the",
"constructor",... | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/orderer/orderer.go#L166-L175 |
29,999 | hyperledger/fabric-sdk-go | pkg/fab/orderer/orderer.go | SendBroadcast | func (o *Orderer) SendBroadcast(ctx reqContext.Context, envelope *fab.SignedEnvelope) (*common.Status, error) {
conn, err := o.conn(ctx)
if err != nil {
rpcStatus, ok := grpcstatus.FromError(err)
if ok {
return nil, errors.WithMessage(status.NewFromGRPCStatus(rpcStatus), "connection failed")
}
return nil,... | go | func (o *Orderer) SendBroadcast(ctx reqContext.Context, envelope *fab.SignedEnvelope) (*common.Status, error) {
conn, err := o.conn(ctx)
if err != nil {
rpcStatus, ok := grpcstatus.FromError(err)
if ok {
return nil, errors.WithMessage(status.NewFromGRPCStatus(rpcStatus), "connection failed")
}
return nil,... | [
"func",
"(",
"o",
"*",
"Orderer",
")",
"SendBroadcast",
"(",
"ctx",
"reqContext",
".",
"Context",
",",
"envelope",
"*",
"fab",
".",
"SignedEnvelope",
")",
"(",
"*",
"common",
".",
"Status",
",",
"error",
")",
"{",
"conn",
",",
"err",
":=",
"o",
".",
... | // SendBroadcast Send the created transaction to Orderer. | [
"SendBroadcast",
"Send",
"the",
"created",
"transaction",
"to",
"Orderer",
"."
] | 48bb0d199e2cee03ad3af0a413bdfc064fc69bfe | https://github.com/hyperledger/fabric-sdk-go/blob/48bb0d199e2cee03ad3af0a413bdfc064fc69bfe/pkg/fab/orderer/orderer.go#L246-L284 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.