Documentation ¶
Index ¶
- Constants
- func ClientTLS(caCert, cert, key []byte, peerName string) (*tls.Config, error)
- func Connect(endpoint string, tlsConfig *tls.Config, dialOptions ...grpc.DialOption) (*grpc.ClientConn, error)
- func Execute(binary string, args ...string) (string, error)
- func ExecuteWithTimeout(timeout time.Duration, binary string, args ...string) (string, error)
- func GRPCServiceReadinessProbe(address string) bool
- func GetURL(host string, port int) string
- func GetVolumeMountPointMap() (map[string]mount.MountPoint, error)
- func GetVolumeNameSHAStrFromPath(path string) string
- func IsMountPointReadOnly(mp mount.MountPoint) bool
- func IsSPDKTgtReady(timeout time.Duration) bool
- func LoadClientTLS(caFile, certFile, keyFile, peerName string) (*tls.Config, error)
- func LoadServerTLS(caFile, certFile, keyFile, peerName string) (*tls.Config, error)
- func NewServer(endpoint string, tlsConfig *tls.Config, opts ...grpc.ServerOption) (*grpc.Server, net.Listener, error)
- func Now() string
- func ParsePortRange(portRange string) (int32, int32, error)
- func PrintJSON(obj interface{}) error
- func ProcessNameToVolumeName(processName string) string
- func RemoveFile(file string) error
- func ServerTLS(caCert, cert, key []byte, peerName string) (*tls.Config, error)
- func SetUpLogger(logsDir string) error
- func UUID() string
- type Bitmap
- type LonghornFormatter
- type LonghornWriter
Constants ¶
const ( DefaulCmdTimeout = time.Minute // one minute by default GRPCHealthProbe = "/usr/local/bin/grpc_health_probe" )
const (
LogComponentField = "component"
)
Variables ¶
This section is empty.
Functions ¶
func ClientTLS ¶
ClientTLS prepares the TLS configuration that can be used by a client while connecting to a server with given encoded certificate and private key. peerName must be provided when expecting the server to offer a certificate with that CommonName.
func Connect ¶
func Connect(endpoint string, tlsConfig *tls.Config, dialOptions ...grpc.DialOption) (*grpc.ClientConn, error)
Connect is a helper function to initiate a grpc client connection to server running at endpoint using tlsConfig
func ExecuteWithTimeout ¶
func GetVolumeMountPointMap ¶ added in v1.5.4
func GetVolumeNameSHAStrFromPath ¶ added in v1.5.4
func IsMountPointReadOnly ¶ added in v1.5.4
func IsMountPointReadOnly(mp mount.MountPoint) bool
func IsSPDKTgtReady ¶ added in v1.5.0
IsSPDKTgtReady checks if SPDK target is ready
func LoadClientTLS ¶
LoadClientTLS prepares the TLS configuration that can be used by a client while connecting to a server. peerName must be provided when expecting the server to offer a certificate with that CommonName. caFile, certFile, and keyFile are all optional.
func LoadServerTLS ¶
LoadServerTLS prepares the TLS configuration needed for a server with the given certificate files. peerName is either the name that the client is expected to have a certificate for or empty, in which case any client is allowed to connect.
func NewServer ¶
func NewServer(endpoint string, tlsConfig *tls.Config, opts ...grpc.ServerOption) (*grpc.Server, net.Listener, error)
NewServer is a helper function to start a grpc server at the given endpoint.
func ProcessNameToVolumeName ¶ added in v1.5.4
func RemoveFile ¶
func ServerTLS ¶
ServerTLS prepares the TLS configuration needed for a server with given encoded certificate and private key.
func SetUpLogger ¶
Types ¶
type Bitmap ¶
type Bitmap struct {
// contains filtered or unexported fields
}
func (*Bitmap) ReleaseRange ¶
type LonghornFormatter ¶
type LonghornFormatter struct { *logrus.TextFormatter LogsDir string }
type LonghornWriter ¶
type LonghornWriter struct {
// contains filtered or unexported fields
}
func NewLonghornWriter ¶
func NewLonghornWriter(name string, logsDir string) (*LonghornWriter, error)
func (LonghornWriter) Close ¶
func (l LonghornWriter) Close() error
func (LonghornWriter) StreamLog ¶
func (l LonghornWriter) StreamLog(done chan struct{}) (chan string, error)