Documentation ¶
Index ¶
- Variables
- func CacheConfiguration() error
- func CacheViper(thevp ...*viper.Viper)
- func DebugModule(moduleName string)
- func GetLocalIP() string
- func GetLogger(tag string) *logging.Logger
- func GlobalFileSystemPath() string
- func GlobalFileSystemPathRaw() string
- func InitCryptoGlobal(vp *viper.Viper) (err error)
- func InitViperForEnv(prefix string, vp ...*viper.Viper)
- func MergeViperPrefix(path string, vp *viper.Viper) string
- func RestoreAllModule()
- func RestoreMoudleLogging(moduleName string)
- func SecurityEnabled() bool
- func SetupTestConfig(pathToOpenchainYaml string)
- func SubViper(path string, thevp ...*viper.Viper) *viper.Viper
- type ClientSpec
- type FailTLSImpl
- type ServerSpec
- type SetupTestConf
- type TLSImpl
Constants ¶
This section is empty.
Variables ¶
var TLSImplFactory func(vp *viper.Viper) TLSImpl = func(*viper.Viper) TLSImpl { return FailTLSImpl{dummyImply{}} }
an impl which create util for tls's crypto elements
Functions ¶
func CacheConfiguration ¶
func CacheConfiguration() error
CacheConfiguration caches configuration settings so that reading the yaml file can be avoided on future requests
func CacheViper ¶
func DebugModule ¶
func DebugModule(moduleName string)
func GetLocalIP ¶
func GetLocalIP() string
GetLocalIP returns the non loopback local IP of the host TODO: this should be a singleton service (the result can be reused) and should use more way to obtain the real "external" IP for server
func GlobalFileSystemPath ¶
func GlobalFileSystemPath() string
func GlobalFileSystemPathRaw ¶
func GlobalFileSystemPathRaw() string
func InitCryptoGlobal ¶
Init initializes the crypto layer. It load from viper the security level and the logging setting.
func InitViperForEnv ¶
func RestoreAllModule ¶
func RestoreAllModule()
func RestoreMoudleLogging ¶
func RestoreMoudleLogging(moduleName string)
func SecurityEnabled ¶
func SecurityEnabled() bool
SecurityEnabled returns true if security is enabled
func SetupTestConfig ¶
func SetupTestConfig(pathToOpenchainYaml string)
SetupTestConfig setup the config during test execution
Types ¶
type ClientSpec ¶
type ClientSpec struct { Address string // contains filtered or unexported fields }
func (*ClientSpec) GetClientTLSOptions ¶
func (ts *ClientSpec) GetClientTLSOptions() (credentials.TransportCredentials, error)
func (*ClientSpec) GetServerTLSOptions ¶
func (ts *ClientSpec) GetServerTLSOptions() (credentials.TransportCredentials, error)
we also make an implement to generating the grpc credential
type FailTLSImpl ¶
type FailTLSImpl struct {
E error
}
func (FailTLSImpl) GetRootCerts ¶
func (e FailTLSImpl) GetRootCerts() (*x509.CertPool, error)
func (FailTLSImpl) GetTLSCert ¶
func (e FailTLSImpl) GetTLSCert() (*tls.Certificate, error)
type ServerSpec ¶
type ServerSpec struct { Address string ExternalAddr string MessageSize int AutoDetect bool // contains filtered or unexported fields }
a server's specification: including the listen address, declaimed address (which a external accessor should use), TLS scheme etc...
func (*ServerSpec) GetClient ¶
func (s *ServerSpec) GetClient() *ClientSpec
func (*ServerSpec) GetClientTLSOptions ¶
func (ts *ServerSpec) GetClientTLSOptions() (credentials.TransportCredentials, error)
func (*ServerSpec) GetServerTLSOptions ¶
func (ts *ServerSpec) GetServerTLSOptions() (credentials.TransportCredentials, error)
we also make an implement to generating the grpc credential
type SetupTestConf ¶
func (SetupTestConf) Setup ¶
func (c SetupTestConf) Setup()