Documentation
¶
Index ¶
- type DefaultLogger
- func (dl *DefaultLogger) Debug(v ...interface{})
- func (dl *DefaultLogger) Debugf(format string, v ...interface{})
- func (dl *DefaultLogger) Error(v ...interface{})
- func (dl *DefaultLogger) Errorf(format string, v ...interface{})
- func (dl *DefaultLogger) Fatal(v ...interface{})
- func (dl *DefaultLogger) Fatalf(format string, v ...interface{})
- func (dl *DefaultLogger) GetLevel() LogLevel
- func (dl *DefaultLogger) Info(v ...interface{})
- func (dl *DefaultLogger) Infof(format string, v ...interface{})
- func (dl *DefaultLogger) SetLevel(level LogLevel)
- func (dl *DefaultLogger) Warn(v ...interface{})
- func (dl *DefaultLogger) Warnf(format string, v ...interface{})
- type EncryptedRPCStream
- type ITlsRpcClient
- type ITlsRpcServer
- type LogLevel
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
func NewDefaultLogger ¶
func NewDefaultLogger() *DefaultLogger
func (*DefaultLogger) Debug ¶
func (dl *DefaultLogger) Debug(v ...interface{})
func (*DefaultLogger) Debugf ¶
func (dl *DefaultLogger) Debugf(format string, v ...interface{})
func (*DefaultLogger) Error ¶
func (dl *DefaultLogger) Error(v ...interface{})
func (*DefaultLogger) Errorf ¶
func (dl *DefaultLogger) Errorf(format string, v ...interface{})
func (*DefaultLogger) Fatal ¶
func (dl *DefaultLogger) Fatal(v ...interface{})
func (*DefaultLogger) Fatalf ¶
func (dl *DefaultLogger) Fatalf(format string, v ...interface{})
func (*DefaultLogger) GetLevel ¶
func (dl *DefaultLogger) GetLevel() LogLevel
func (*DefaultLogger) Info ¶
func (dl *DefaultLogger) Info(v ...interface{})
func (*DefaultLogger) Infof ¶
func (dl *DefaultLogger) Infof(format string, v ...interface{})
func (*DefaultLogger) SetLevel ¶
func (dl *DefaultLogger) SetLevel(level LogLevel)
func (*DefaultLogger) Warn ¶
func (dl *DefaultLogger) Warn(v ...interface{})
func (*DefaultLogger) Warnf ¶
func (dl *DefaultLogger) Warnf(format string, v ...interface{})
type EncryptedRPCStream ¶
type ITlsRpcClient ¶
type ITlsRpcClient interface {
CloseClient()
SetLogger(logger Logger)
ConnectToRpcServerTls(serviceMethod string, args []byte) ([]byte, error)
}
func NewITlsRpcClient ¶
func NewITlsRpcClient(caCrtPath, clientCrtPath, clientKeyPath, address, name string) (ITlsRpcClient, error)
NewITlsRpcClient creates a new TLS RPC client and connects to the specified RPC server, using the specified certificate path to load the TLS configuration. The client is named for logging purposes.
The returned error is non-nil if the client fails to connect to the server.
type ITlsRpcServer ¶
type ITlsRpcServer interface {
CloseServer()
RegisterMethod(serviceName string, service any) error
Serve()
SetLogger(logger Logger)
}
func NewITlsRpcServer ¶
func NewITlsRpcServer(certPath, keyPath, capath, port string) (ITlsRpcServer, error)
NewITlsRpcServer creates a new TLS RPC server that listens on the specified port and uses the specified certificate and key files to configure the TLS connection. The returned error is non-nil if the server fails to listen on the specified port.
The returned ITlsRpcServer object is ready to use for RPC registrations and serving.
type Logger ¶
type Logger interface {
Debug(v ...interface{})
Debugf(format string, v ...interface{})
Info(v ...interface{})
Infof(format string, v ...interface{})
Warn(v ...interface{})
Warnf(format string, v ...interface{})
Error(v ...interface{})
Errorf(format string, v ...interface{})
Fatal(v ...interface{})
Fatalf(format string, v ...interface{})
SetLevel(level LogLevel)
GetLevel() LogLevel
}
Click to show internal directories.
Click to hide internal directories.