context

package
v1.0.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: Apache-2.0 Imports: 7 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) DiscoveryService

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

DiscoveryService returns core discovery service

func (*Channel) Providers

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

Providers returns core providers

func (*Channel) SelectionService

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

SelectionService returns selection service

type Client

type Client struct {
	context.Providers
	msp.SigningIdentity
}

Client supplies the configuration and signing identity to client objects.

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) Config

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

Config returns the Config provider of sdk.

func (*Provider) CryptoSuite

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

CryptoSuite returns the BCCSP provider of sdk.

func (*Provider) DiscoveryProvider

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

DiscoveryProvider returns discovery provider

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) SelectionProvider

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

SelectionProvider returns selection 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 core.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 FabContext

func WithConfig

func WithConfig(config core.Config) SDKContextParams

WithConfig sets config to FabContext

func WithCryptoSuite

func WithCryptoSuite(cryptoSuite core.CryptoSuite) SDKContextParams

WithCryptoSuite sets cryptosuite parameter to FabContext

func WithDiscoveryProvider

func WithDiscoveryProvider(discoveryProvider fab.DiscoveryProvider) SDKContextParams

WithDiscoveryProvider sets discoveryProvider to FabContext

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 FabContext

func WithSelectionProvider

func WithSelectionProvider(selectionProvider fab.SelectionProvider) SDKContextParams

WithSelectionProvider sets selectionProvider to FabContext

func WithSigningManager

func WithSigningManager(signingManager core.SigningManager) SDKContextParams

WithSigningManager sets signingManager to FabContext

func WithUserStore

func WithUserStore(userStore msp.UserStore) SDKContextParams

WithUserStore sets user store to FabContext

Jump to

Keyboard shortcuts

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