apiconfig

package
v1.0.0-alpha2.0...-39a4250 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CAConfig

type CAConfig struct {
	URL         string
	HTTPOptions map[string]interface{}
	TLSCACerts  MutualTLSConfig
	Registrar   struct {
		EnrollID     string
		EnrollSecret string
	}
	CAName string
}

CAConfig defines a CA configuration

type CCType

type CCType struct {
	Path string
}

CCType defines the path to crypto keys and certs

type ChannelConfig

type ChannelConfig struct {
	// Orderers list of ordering service nodes
	Orderers []string
	// Peers a list of peer-channels that are part of this organization
	// to get the real Peer config object, use the Name field and fetch NetworkConfig.Peers[Name]
	Peers map[string]PeerChannelConfig
	// Chaincodes list of services
	Chaincodes []string
}

ChannelConfig provides the definition of channels for the network

type ChannelPeer

type ChannelPeer struct {
	PeerChannelConfig
	NetworkPeer
}

ChannelPeer combines channel peer info with raw peerConfig info

type ClientConfig

type ClientConfig struct {
	Organization    string
	Logging         LoggingType
	CryptoConfig    CCType
	TLS             TLSType
	TLSCerts        MutualTLSConfig
	CredentialStore CredentialStoreType
}

ClientConfig provides the definition of the client configuration

type Config

type Config interface {
	Client() (*ClientConfig, error)
	CAConfig(org string) (*CAConfig, error)
	CAServerCertPems(org string) ([]string, error)
	CAServerCertPaths(org string) ([]string, error)
	CAClientKeyPem(org string) (string, error)
	CAClientKeyPath(org string) (string, error)
	CAClientCertPem(org string) (string, error)
	CAClientCertPath(org string) (string, error)
	TimeoutOrDefault(TimeoutType) time.Duration
	MspID(org string) (string, error)
	PeerMspID(name string) (string, error)
	OrderersConfig() ([]OrdererConfig, error)
	RandomOrdererConfig() (*OrdererConfig, error)
	OrdererConfig(name string) (*OrdererConfig, error)
	PeersConfig(org string) ([]PeerConfig, error)
	PeerConfig(org string, name string) (*PeerConfig, error)
	NetworkConfig() (*NetworkConfig, error)
	NetworkPeers() ([]NetworkPeer, error)
	ChannelConfig(name string) (*ChannelConfig, error)
	ChannelPeers(name string) ([]ChannelPeer, error)
	ChannelOrderers(name string) ([]OrdererConfig, error)
	SetTLSCACertPool(*x509.CertPool)
	TLSCACertPool(certConfig ...*x509.Certificate) (*x509.CertPool, error)
	IsSecurityEnabled() bool
	SecurityAlgorithm() string
	SecurityLevel() int
	SecurityProvider() string
	Ephemeral() bool
	SoftVerify() bool
	SecurityProviderLibPath() string
	SecurityProviderPin() string
	SecurityProviderLabel() string
	KeyStorePath() string
	CAKeyStorePath() string
	CryptoConfigPath() string
	TLSClientCerts() ([]tls.Certificate, error)
}

Config fabric-sdk-go configuration interface

type ConfigProvider

type ConfigProvider func() (Config, error)

ConfigProvider enables creation of a Config instance

type CredentialStoreType

type CredentialStoreType struct {
	Path        string
	CryptoStore struct {
		Path string
	}
	Wallet string
}

CredentialStoreType defines pluggable KV store properties

type LoggingType

type LoggingType struct {
	Level string
}

LoggingType defines the level of logging

type MutualTLSConfig

type MutualTLSConfig struct {
	Pem []string
	// Certfiles root certificates for TLS validation (Comma separated path list)
	Path string
	// Client client TLS information
	Client struct {
		KeyPem string
		// Keyfile client key path
		Keyfile string
		CertPem string
		// Certfile client cert path
		Certfile string
	}
}

MutualTLSConfig Mutual TLS configurations

type NetworkConfig

type NetworkConfig struct {
	Name                   string
	Xtype                  string
	Description            string
	Version                string
	Client                 ClientConfig
	Channels               map[string]ChannelConfig
	Organizations          map[string]OrganizationConfig
	Orderers               map[string]OrdererConfig
	Peers                  map[string]PeerConfig
	CertificateAuthorities map[string]CAConfig
}

NetworkConfig provides a static definition of a Hyperledger Fabric network

type NetworkPeer

type NetworkPeer struct {
	PeerConfig
	MspID string
}

NetworkPeer combines peer info with MSP info

type OrdererConfig

type OrdererConfig struct {
	URL         string
	GRPCOptions map[string]interface{}
	TLSCACerts  TLSConfig
}

OrdererConfig defines an orderer configuration

type OrganizationConfig

type OrganizationConfig struct {
	MspID                  string
	CryptoPath             string
	Users                  map[string]TLSKeyPair
	Peers                  []string
	CertificateAuthorities []string
	AdminPrivateKey        TLSConfig
	SignedCert             TLSConfig
}

OrganizationConfig provides the definition of an organization in the network

type PeerChannelConfig

type PeerChannelConfig struct {
	EndorsingPeer  bool
	ChaincodeQuery bool
	LedgerQuery    bool
	EventSource    bool
}

PeerChannelConfig defines the peer capabilities

type PeerConfig

type PeerConfig struct {
	URL         string
	EventURL    string
	GRPCOptions map[string]interface{}
	TLSCACerts  TLSConfig
}

PeerConfig defines a peer configuration

type TLSConfig

type TLSConfig struct {
	// the following two fields are interchangeable.
	// If Path is available, then it will be used to load the cert
	// if Pem is available, then it has the raw data of the cert it will be used as-is
	// Certificate root certificate path
	Path string
	// Certificate actual content
	Pem string
}

TLSConfig TLS configurations

func (TLSConfig) Bytes

func (cfg TLSConfig) Bytes() ([]byte, error)

Bytes returns the tls certificate as a byte array by loading it either from the embedded Pem or Path

func (TLSConfig) TLSCert

func (cfg TLSConfig) TLSCert() (*x509.Certificate, error)

TLSCert returns the tls certificate as a *x509.Certificate by loading it either from the embedded Pem or Path

type TLSKeyPair

type TLSKeyPair struct {
	Key  TLSConfig
	Cert TLSConfig
}

TLSKeyPair contains the private key and certificate for TLS encryption

type TLSType

type TLSType struct {
	Enabled bool
}

TLSType defines whether or not TLS is enabled

type TimeoutType

type TimeoutType int

TimeoutType enumerates the different types of outgoing connections

const (
	// Endorser connection timeout
	Endorser TimeoutType = iota
	// EventHub connection timeout
	EventHub
	// EventReg connection timeout
	EventReg
	// Query timeout
	Query
	// Execute timeout
	Execute
	// OrdererConnection orderer connection timeout
	OrdererConnection
	// OrdererResponse orderer response timeout
	OrdererResponse
	// DiscoveryGreylistExpiry discovery Greylist expiration period
	DiscoveryGreylistExpiry
)

Directories

Path Synopsis
Package mock_apiconfig is a generated GoMock package.
Package mock_apiconfig is a generated GoMock package.

Jump to

Keyboard shortcuts

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