Documentation
¶
Index ¶
- func FromFile(name string, opts ...Option) apiconfig.ConfigProvider
- func FromRaw(configBytes []byte, configType string, opts ...Option) apiconfig.ConfigProvider
- func FromReader(in io.Reader, configType string, opts ...Option) apiconfig.ConfigProvider
- 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) (*apiconfig.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) (*apiconfig.ChannelConfig, error)
- func (c *Config) ChannelOrderers(name string) ([]apiconfig.OrdererConfig, error)
- func (c *Config) ChannelPeers(name string) ([]apiconfig.ChannelPeer, error)
- func (c *Config) Client() (*apiconfig.ClientConfig, error)
- func (c *Config) CryptoConfigPath() string
- func (c *Config) Ephemeral() bool
- func (c *Config) IsSecurityEnabled() bool
- func (c *Config) KeyStorePath() string
- func (c *Config) MspID(org string) (string, error)
- func (c *Config) NetworkConfig() (*apiconfig.NetworkConfig, error)
- func (c *Config) NetworkPeers() ([]apiconfig.NetworkPeer, error)
- func (c *Config) OrdererConfig(name string) (*apiconfig.OrdererConfig, error)
- func (c *Config) OrderersConfig() ([]apiconfig.OrdererConfig, error)
- func (c *Config) PeerConfig(org string, name string) (*apiconfig.PeerConfig, error)
- func (c *Config) PeerMspID(name string) (string, error)
- func (c *Config) PeersConfig(org string) ([]apiconfig.PeerConfig, error)
- func (c *Config) RandomOrdererConfig() (*apiconfig.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) SetTLSCACertPool(certPool *sm2.CertPool)
- func (c *Config) SoftVerify() bool
- func (c *Config) TLSCACertPool(certs ...*sm2.Certificate) (*sm2.CertPool, error)
- func (c *Config) TLSClientCerts() ([]tls.Certificate, error)
- func (c *Config) TimeoutOrDefault(conn apiconfig.TimeoutType) time.Duration
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromFile ¶
func FromFile(name string, opts ...Option) apiconfig.ConfigProvider
FromFile reads from named config file
func FromRaw ¶
func FromRaw(configBytes []byte, configType string, opts ...Option) apiconfig.ConfigProvider
FromRaw will initialize the configs from a byte array
func FromReader ¶
FromReader loads configuration from in. configType can be "json" or "yaml".
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) (*apiconfig.ChannelConfig, error)
ChannelConfig returns the channel configuration
func (*Config) ChannelOrderers ¶
func (c *Config) ChannelOrderers(name string) ([]apiconfig.OrdererConfig, error)
ChannelOrderers returns a list of channel orderers
func (*Config) ChannelPeers ¶
func (c *Config) ChannelPeers(name string) ([]apiconfig.ChannelPeer, error)
ChannelPeers returns the channel peers configuration
func (*Config) Client ¶
func (c *Config) Client() (*apiconfig.ClientConfig, error)
Client returns the Client config
func (*Config) KeyStorePath ¶
KeyStorePath returns the keystore path used by BCCSP
func (*Config) NetworkConfig ¶
func (c *Config) NetworkConfig() (*apiconfig.NetworkConfig, error)
NetworkConfig returns the network configuration defined in the config file
func (*Config) NetworkPeers ¶
func (c *Config) NetworkPeers() ([]apiconfig.NetworkPeer, error)
NetworkPeers returns the network peers configuration
func (*Config) OrdererConfig ¶
func (c *Config) OrdererConfig(name string) (*apiconfig.OrdererConfig, error)
OrdererConfig returns the requested orderer
func (*Config) OrderersConfig ¶
func (c *Config) OrderersConfig() ([]apiconfig.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) PeersConfig ¶
func (c *Config) PeersConfig(org string) ([]apiconfig.PeerConfig, error)
PeersConfig Retrieves the fabric peers for the specified org from the config file provided
func (*Config) RandomOrdererConfig ¶
func (c *Config) RandomOrdererConfig() (*apiconfig.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) SetTLSCACertPool ¶
SetTLSCACertPool allows a user to set a global cert pool with a set of root TLS CAs that will be used for all outgoing connections
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) TimeoutOrDefault ¶
func (c *Config) TimeoutOrDefault(conn apiconfig.TimeoutType) time.Duration
TimeoutOrDefault reads connection timeouts for the given connection type