Documentation ¶
Index ¶
- func FromFile(name string, opts ...Option) core.ConfigProvider
- func FromRaw(configBytes []byte, configType string, opts ...Option) core.ConfigProvider
- func FromReader(in io.Reader, configType string, opts ...Option) core.ConfigProvider
- func NetworkPeerConfigFromURL(cfg core.Config, url string) (*core.NetworkPeer, error)
- func SubstPathVars(path string) string
- type Config
- func (c *Config) CAClientCertPath(org string) (string, error)
- func (c *Config) CAClientCertPem(org string) (string, error)
- func (c *Config) CAClientKeyPath(org string) (string, error)
- func (c *Config) CAClientKeyPem(org string) (string, error)
- func (c *Config) CAConfig(org string) (*core.CAConfig, error)
- func (c *Config) CAKeyStorePath() string
- func (c *Config) CAServerCertPaths(org string) ([]string, error)
- func (c *Config) CAServerCertPems(org string) ([]string, error)
- func (c *Config) ChannelConfig(name string) (*core.ChannelConfig, error)
- func (c *Config) ChannelOrderers(name string) ([]core.OrdererConfig, error)
- func (c *Config) ChannelPeers(name string) ([]core.ChannelPeer, error)
- func (c *Config) Client() (*core.ClientConfig, error)
- func (c *Config) CredentialStorePath() string
- func (c *Config) CryptoConfigPath() string
- func (c *Config) Ephemeral() bool
- func (c *Config) EventServiceType() core.EventServiceType
- func (c *Config) IsSecurityEnabled() bool
- func (c *Config) KeyStorePath() string
- func (c *Config) MSPID(org string) (string, error)
- func (c *Config) NetworkConfig() (*core.NetworkConfig, error)
- func (c *Config) NetworkPeers() ([]core.NetworkPeer, error)
- func (c *Config) OrdererConfig(name string) (*core.OrdererConfig, error)
- func (c *Config) OrderersConfig() ([]core.OrdererConfig, error)
- func (c *Config) PeerConfig(org string, name string) (*core.PeerConfig, error)
- func (c *Config) PeerConfigByURL(url string) (*core.PeerConfig, error)
- func (c *Config) PeerMSPID(name string) (string, error)
- func (c *Config) PeersConfig(org string) ([]core.PeerConfig, error)
- func (c *Config) RandomOrdererConfig() (*core.OrdererConfig, error)
- func (c *Config) SecurityAlgorithm() string
- func (c *Config) SecurityLevel() int
- func (c *Config) SecurityProvider() string
- func (c *Config) SecurityProviderLabel() string
- func (c *Config) SecurityProviderLibPath() string
- func (c *Config) SecurityProviderPin() string
- func (c *Config) SoftVerify() bool
- func (c *Config) TLSCACertPool(certs ...*x509.Certificate) (*x509.CertPool, error)
- func (c *Config) TLSClientCerts() ([]tls.Certificate, error)
- func (c *Config) Timeout(tType core.TimeoutType) time.Duration
- func (c *Config) TimeoutOrDefault(tType core.TimeoutType) time.Duration
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromFile ¶
func FromFile(name string, opts ...Option) core.ConfigProvider
FromFile reads from named config file
func FromRaw ¶
func FromRaw(configBytes []byte, configType string, opts ...Option) core.ConfigProvider
FromRaw will initialize the configs from a byte array
func FromReader ¶
FromReader loads configuration from in. configType can be "json" or "yaml".
func NetworkPeerConfigFromURL ¶
NetworkPeerConfigFromURL fetches the peer configuration based on a URL.
func SubstPathVars ¶
SubstPathVars replaces instances of '${VARNAME}' (eg ${GOPATH}) with the variable. As a special case, $GOPATH is also replaced. NOTE: this function currently only performs substitution when the path string starts with $
as the path variables are intended to assist with testing.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config represents the configuration for the client
func (*Config) CAClientCertPath ¶
CAClientCertPath Read configuration option for the fabric CA client cert file
func (*Config) CAClientCertPem ¶
CAClientCertPem Read configuration option for the fabric CA client cert pem embedded in the client config
func (*Config) CAClientKeyPath ¶
CAClientKeyPath Read configuration option for the fabric CA client key file
func (*Config) CAClientKeyPem ¶
CAClientKeyPem Read configuration option for the fabric CA client key pem embedded in the client config
func (*Config) CAKeyStorePath ¶
CAKeyStorePath returns the same path as KeyStorePath() without the 'keystore' directory added. This is done because the fabric-ca-client adds this to the path
func (*Config) CAServerCertPaths ¶
CAServerCertPaths Read configuration option for the server certificates will send a list of cert file paths
func (*Config) CAServerCertPems ¶
CAServerCertPems Read configuration option for the server certificates will send a list of cert pem contents directly from the config bytes array
func (*Config) ChannelConfig ¶
func (c *Config) ChannelConfig(name string) (*core.ChannelConfig, error)
ChannelConfig returns the channel configuration
func (*Config) ChannelOrderers ¶
func (c *Config) ChannelOrderers(name string) ([]core.OrdererConfig, error)
ChannelOrderers returns a list of channel orderers
func (*Config) ChannelPeers ¶
func (c *Config) ChannelPeers(name string) ([]core.ChannelPeer, error)
ChannelPeers returns the channel peers configuration
func (*Config) Client ¶
func (c *Config) Client() (*core.ClientConfig, error)
Client returns the Client config
func (*Config) CredentialStorePath ¶
CredentialStorePath returns the user store path
func (*Config) EventServiceType ¶
func (c *Config) EventServiceType() core.EventServiceType
EventServiceType returns the type of event service client to use
func (*Config) KeyStorePath ¶
KeyStorePath returns the keystore path used by BCCSP
func (*Config) NetworkConfig ¶
func (c *Config) NetworkConfig() (*core.NetworkConfig, error)
NetworkConfig returns the network configuration defined in the config file
func (*Config) NetworkPeers ¶
func (c *Config) NetworkPeers() ([]core.NetworkPeer, error)
NetworkPeers returns the network peers configuration
func (*Config) OrdererConfig ¶
func (c *Config) OrdererConfig(name string) (*core.OrdererConfig, error)
OrdererConfig returns the requested orderer
func (*Config) OrderersConfig ¶
func (c *Config) OrderersConfig() ([]core.OrdererConfig, error)
OrderersConfig returns a list of defined orderers
func (*Config) PeerConfig ¶
PeerConfig Retrieves a specific peer from the configuration by org and name
func (*Config) PeerConfigByURL ¶
func (c *Config) PeerConfigByURL(url string) (*core.PeerConfig, error)
PeerConfigByURL retrieves PeerConfig by URL
func (*Config) PeersConfig ¶
func (c *Config) PeersConfig(org string) ([]core.PeerConfig, error)
PeersConfig Retrieves the fabric peers for the specified org from the config file provided
func (*Config) RandomOrdererConfig ¶
func (c *Config) RandomOrdererConfig() (*core.OrdererConfig, error)
RandomOrdererConfig returns a pseudo-random orderer from the network config
func (*Config) SecurityAlgorithm ¶
SecurityAlgorithm ...
func (*Config) SecurityProvider ¶
SecurityProvider provider SW or PKCS11
func (*Config) SecurityProviderLabel ¶
SecurityProviderLabel will be set only if provider is PKCS11
func (*Config) SecurityProviderLibPath ¶
SecurityProviderLibPath will be set only if provider is PKCS11
func (*Config) SecurityProviderPin ¶
SecurityProviderPin will be set only if provider is PKCS11
func (*Config) TLSCACertPool ¶
TLSCACertPool returns the configured cert pool. If a certConfig is provided, the certficate is added to the pool
func (*Config) TLSClientCerts ¶
func (c *Config) TLSClientCerts() ([]tls.Certificate, error)
TLSClientCerts loads the client's certs for mutual TLS It checks the config for embedded pem files before looking for cert files
func (*Config) Timeout ¶
func (c *Config) Timeout(tType core.TimeoutType) time.Duration
Timeout reads timeouts for the given timeout type, the default is 0 if type is not found in config
func (*Config) TimeoutOrDefault ¶
func (c *Config) TimeoutOrDefault(tType core.TimeoutType) time.Duration
TimeoutOrDefault reads timeouts for the given timeout type, if not found, defaultTimeout is returned