context

package
v1.0.2-gm Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReqContextTimeoutOverrides = reqContextKey("timeout-overrides")

ReqContextTimeoutOverrides key for grpc context value of timeout overrides

Functions

func NewRequest

func NewRequest(client context.Client, options ...ReqContextOptions) (reqContext.Context, reqContext.CancelFunc)

NewRequest creates a request-scoped context.

func RequestClientContext

func RequestClientContext(ctx reqContext.Context) (context.Client, bool)

RequestClientContext extracts the Client Context from the request-scoped context.

func RequestCommManager

func RequestCommManager(ctx reqContext.Context) (fab.CommManager, bool)

RequestCommManager extracts the CommManager from the request-scoped context.

Types

type Channel

type Channel struct {
	context.Client
	// contains filtered or unexported fields
}

Channel supplies the configuration for channel context client

func NewChannel

func NewChannel(clientProvider context.ClientProvider, channelID string) (*Channel, error)

NewChannel creates new channel context client Not be used by end developers, fabsdk package use only

func (*Channel) ChannelID

func (c *Channel) ChannelID() string

ChannelID returns channel id

func (*Channel) ChannelService

func (c *Channel) ChannelService() fab.ChannelService

ChannelService returns channel service

func (*Channel) Providers

func (c *Channel) Providers() context.Client

Providers returns core providers

type Client

type Client struct {
	context.Providers
	msp.SigningIdentity
}

Client supplies the configuration and signing identity to client objects.

type Local

type Local struct {
	context.Client
	// contains filtered or unexported fields
}

Local supplies the configuration and signing identity to clients that will be invoking the peer outside of a channel context using an identity in the peer's local MSP.

func NewLocal

func NewLocal(clientProvider context.ClientProvider) (*Local, error)

NewLocal returns a new local context

func (*Local) LocalDiscoveryService

func (c *Local) LocalDiscoveryService() fab.DiscoveryService

LocalDiscoveryService returns core discovery service

type Provider

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

Provider implementation of Providers interface

func NewProvider

func NewProvider(params ...SDKContextParams) *Provider

NewProvider creates new context client provider Not be used by end developers, fabsdk package use only

func (*Provider) ChannelProvider

func (c *Provider) ChannelProvider() fab.ChannelProvider

ChannelProvider provides channel services.

func (*Provider) CryptoSuite

func (c *Provider) CryptoSuite() core.CryptoSuite

CryptoSuite returns the BCCSP provider of sdk.

func (*Provider) EndpointConfig

func (c *Provider) EndpointConfig() fab.EndpointConfig

EndpointConfig returns end point network config

func (*Provider) GetMetrics

func (c *Provider) GetMetrics() *metrics.ClientMetrics

GetMetrics will return the SDK's metrics instance

func (*Provider) IdentityConfig

func (c *Provider) IdentityConfig() msp.IdentityConfig

IdentityConfig returns the Identity config

func (*Provider) IdentityManager

func (c *Provider) IdentityManager(orgName string) (msp.IdentityManager, bool)

IdentityManager returns identity manager for organization

func (*Provider) InfraProvider

func (c *Provider) InfraProvider() fab.InfraProvider

InfraProvider provides fabric objects such as peer and user

func (*Provider) LocalDiscoveryProvider

func (c *Provider) LocalDiscoveryProvider() fab.LocalDiscoveryProvider

LocalDiscoveryProvider returns the local discovery provider

func (*Provider) SigningManager

func (c *Provider) SigningManager() core.SigningManager

SigningManager returns signing manager

func (*Provider) UserStore

func (c *Provider) UserStore() msp.UserStore

UserStore returns state store

type ReqContextOptions

type ReqContextOptions func(opts *requestContextOpts)

ReqContextOptions parameter for creating requestContext

func WithParent

func WithParent(context reqContext.Context) ReqContextOptions

WithParent sets existing reqContext as a parent ReqContext

func WithTimeout

func WithTimeout(timeout time.Duration) ReqContextOptions

WithTimeout sets timeout time duration to request context

func WithTimeoutType

func WithTimeoutType(timeoutType fab.TimeoutType) ReqContextOptions

WithTimeoutType sets timeout by type defined in config to request context

type SDKContextParams

type SDKContextParams func(opts *Provider)

SDKContextParams parameter for creating FabContext

func WithChannelProvider

func WithChannelProvider(channelProvider fab.ChannelProvider) SDKContextParams

WithChannelProvider sets channelProvider to Context Provider

func WithClientMetrics

func WithClientMetrics(cm *metrics.ClientMetrics) SDKContextParams

WithClientMetrics sets clientMetrics to Context Provider

func WithCryptoSuite

func WithCryptoSuite(cryptoSuite core.CryptoSuite) SDKContextParams

WithCryptoSuite sets cryptosuite parameter to Context Provider

func WithCryptoSuiteConfig

func WithCryptoSuiteConfig(cryptoSuiteConfig core.CryptoSuiteConfig) SDKContextParams

WithCryptoSuiteConfig sets core cryptoSuite config to Context Provider

func WithEndpointConfig

func WithEndpointConfig(endpointConfig fab.EndpointConfig) SDKContextParams

WithEndpointConfig sets fab endpoint network config to Context Provider

func WithIdentityConfig

func WithIdentityConfig(identityConfig msp.IdentityConfig) SDKContextParams

WithIdentityConfig sets msp identity config to Context Provider

func WithIdentityManagerProvider

func WithIdentityManagerProvider(provider msp.IdentityManagerProvider) SDKContextParams

WithIdentityManagerProvider sets IdentityManagerProvider maps to context

func WithInfraProvider

func WithInfraProvider(infraProvider fab.InfraProvider) SDKContextParams

WithInfraProvider sets infraProvider maps to Context Provider

func WithLocalDiscoveryProvider

func WithLocalDiscoveryProvider(discoveryProvider fab.LocalDiscoveryProvider) SDKContextParams

WithLocalDiscoveryProvider sets the local discovery provider

func WithSigningManager

func WithSigningManager(signingManager core.SigningManager) SDKContextParams

WithSigningManager sets signingManager to Context Provider

func WithUserStore

func WithUserStore(userStore msp.UserStore) SDKContextParams

WithUserStore sets user store to Context Provider

Jump to

Keyboard shortcuts

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