fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/fabsdk Index | Files | Directories

package fabsdk

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

Package fabsdk enables client usage of a Hyperledger Fabric network.

Package fabsdk enables client usage of a Hyperledger Fabric network.

Index

Package Files

context.go defpkgsuite.go fabsdk.go fabsdk_std.go factory.go

Variables

var ErrAnonymousIdentity = errors.New("missing credentials")

ErrAnonymousIdentity is returned when options for identity creation don't include neither username nor identity

type ContextOption Uses

type ContextOption func(s *identityOptions) error

ContextOption provides parameters for creating a session (primarily from a fabric identity/user)

func WithIdentity Uses

func WithIdentity(signingIdentity msp.SigningIdentity) ContextOption

WithIdentity uses a pre-constructed identity object as the credential for the session

func WithOrg Uses

func WithOrg(org string) ContextOption

WithOrg uses the named organization

func WithUser Uses

func WithUser(username string) ContextOption

WithUser uses the named user to load the identity

type FabricSDK Uses

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

FabricSDK provides access (and context) to clients being managed by the SDK.

func New Uses

func New(configProvider core.ConfigProvider, opts ...Option) (*FabricSDK, error)

New initializes the SDK based on the set of options provided. ConfigOptions provides the application configuration.

func (*FabricSDK) ChannelContext Uses

func (sdk *FabricSDK) ChannelContext(channelID string, options ...ContextOption) contextApi.ChannelProvider

ChannelContext creates and returns channel context

func (*FabricSDK) Close Uses

func (sdk *FabricSDK) Close()

Close frees up caches and connections being maintained by the SDK

func (*FabricSDK) CloseContext Uses

func (sdk *FabricSDK) CloseContext(ctxt fab.ClientContext)

CloseContext frees up caches being maintained by the SDK for the given context

func (*FabricSDK) Config Uses

func (sdk *FabricSDK) Config() (core.ConfigBackend, error)

Config returns config backend used by all SDK config types

func (*FabricSDK) Context Uses

func (sdk *FabricSDK) Context(options ...ContextOption) contextApi.ClientProvider

Context creates and returns context client which has all the necessary providers

type Option Uses

type Option func(opts *options) error

Option configures the SDK.

func WithCorePkg Uses

func WithCorePkg(core sdkApi.CoreProviderFactory) Option

WithCorePkg injects the core implementation into the SDK.

func WithCryptoSuiteConfig Uses

func WithCryptoSuiteConfig(cryptoConfigs ...interface{}) Option

WithCryptoSuiteConfig injects a CryptoSuiteConfig interface to the SDK it accepts either a full interface of CryptoSuiteConfig or a list of sub interfaces each implementing one (or more) function(s) of CryptoSuiteConfig

func WithEndpointConfig Uses

func WithEndpointConfig(endpointConfigs ...interface{}) Option

WithEndpointConfig injects a EndpointConfig interface to the SDK it accepts either a full interface of EndpointConfig or a list of sub interfaces each implementing one (or more) function(s) of EndpointConfig

func WithErrorHandler Uses

func WithErrorHandler(value fab.ErrorHandler) Option

WithErrorHandler sets an error handler that will be invoked when a service error is experienced. This allows the client to take a decision of whether to ignore the error, shut down the client context, or shut down the entire SDK.

func WithIdentityConfig Uses

func WithIdentityConfig(identityConfigs ...interface{}) Option

WithIdentityConfig injects a IdentityConfig interface to the SDK it accepts either a full interface of IdentityConfig or a list of sub interfaces each implementing one (or more) function(s) of IdentityConfig

func WithLoggerPkg Uses

func WithLoggerPkg(logger api.LoggerProvider) Option

WithLoggerPkg injects the logger implementation into the SDK.

func WithMSPPkg Uses

func WithMSPPkg(msp sdkApi.MSPProviderFactory) Option

WithMSPPkg injects the MSP implementation into the SDK.

func WithMetricsConfig Uses

func WithMetricsConfig(metricsConfigs ...interface{}) Option

WithMetricsConfig injects a MetricsConfig interface to the SDK it accepts either a full interface of MetricsConfig or a list of sub interfaces each implementing one (or more) function(s) of MetricsConfig

func WithProviderOpts Uses

func WithProviderOpts(sopts ...coptions.Opt) Option

WithProviderOpts adds options which are propagated to the various providers.

func WithServicePkg Uses

func WithServicePkg(service sdkApi.ServiceProviderFactory) Option

WithServicePkg injects the service implementation into the SDK.

Directories

PathSynopsis
api
factory/defcore
factory/defmsp
factory/defsvc
metrics
metrics/cfg
provider/chpvdr
provider/fabpvdr
provider/msppvdr
test/mocksdkapiPackage mocksdkapi is a generated GoMock package.

Package fabsdk imports 23 packages (graph) and is imported by 11 packages. Updated 2019-04-11. Refresh now. Tools for package owners.