Documentation
¶
Index ¶
- Constants
- Variables
- func AnnotateError(in error) error
- func Debug(msg proto.Message) string
- func ErrFromMeta(meta map[string]string, errType error) error
- func MetaFromFault(f *fault.Fault) map[string]string
- func MockNvmeController(varIdx ...int32) *ctlpb.NvmeController
- func MockNvmeHealth(varIdx ...int32) *ctlpb.BioHealthResp
- func MockNvmeNamespace(varIdx ...int32) *ctlpb.NvmeController_Namespace
- func MockPBMemInfo() *ctlpb.MemInfo
- func MockScmModule(varIdx ...int32) *ctlpb.ScmModule
- func MockScmMountPoint(varIdx ...int32) *ctlpb.ScmNamespace_Mount
- func MockScmNamespace(varIdx ...int32) *ctlpb.ScmNamespace
- func MockSmdDevice(c *storage.NvmeController, varIdx ...int32) *ctlpb.SmdDevice
- func ShouldDebug(msg proto.Message, ldrChk func() bool) bool
- func UnwrapError(st *status.Status) error
- type NvmeController
- type NvmeControllerResults
- type NvmeControllers
- type NvmeHealth
- type NvmeNamespace
- type NvmeNamespaces
- type ScmModule
- type ScmModuleResults
- type ScmModules
- type ScmMountPoint
- type ScmMountResults
- type ScmNamespace
- type ScmNamespaces
- type SmdDevice
- type SmdDevices
Constants ¶
const ( // AnnotatedFaultType defines a stable identifier for Faults serialized as gRPC // status metadata. AnnotatedFaultType = "proto.fault.Fault" // AnnotatedDaosStatusType defines an identifier for DaosStatus errors serialized // as gRPC status metadata. AnnotatedDaosStatusType = "proto.daos.DaosStatus" // AnnotatedSystemErrNotLeader defines an identifier for ErrNotLeader errors // serialized as gRPC status metadata. AnnotatedSystemErrNotLeader = "proto.system.ErrNotLeader" // AnnotatedSystemErrNotReplica defines an identifier for ErrNotReplica errors // serialized as gRPC status metadata. AnnotatedSystemErrNotReplica = "proto.system.ErrNotReplica" // AnnotatedSystemErrPoolNotFound defines an identifier for ErrPoolNotFound errors // serialized as gRPC status metadata. AnnotatedSystemErrPoolNotFound = "proto.system.ErrPoolNotFound" )
Variables ¶
var MockPoolList = []*mgmtpb.ListPoolsResp_Pool{ {Uuid: "12345678-1234-1234-1234-123456789abc", SvcReps: []uint32{1, 2}}, {Uuid: "12345678-1234-1234-1234-cba987654321", SvcReps: []uint32{0}}, }
MockPoolList returns a slice of mock protobuf Pool messages used in tests for multiple packages.
Functions ¶
func AnnotateError ¶
AnnotateError adds more details to the gRPC error, if available.
func Debug ¶
Debug returns a string representation of the protobuf message. Certain messages have hand-crafted representations for optimal log density and relevance. The default representation should be sufficient for most messages.
NB: This is fairly expensive and should only be invoked when debug logging is enabled.
func ErrFromMeta ¶
ErrFromMeta converts a map of metadata into an error.
func MetaFromFault ¶
MetaFromFault converts a *fault.Fault into a map of metadata.
func MockNvmeController ¶
func MockNvmeController(varIdx ...int32) *ctlpb.NvmeController
MockNvmeController is a mock protobuf Controller message used in tests for multiple packages (message contains repeated namespace field).
func MockNvmeHealth ¶
func MockNvmeHealth(varIdx ...int32) *ctlpb.BioHealthResp
MockNvmeHealth is a mock protobuf Health message used in tests for multiple packages.
func MockNvmeNamespace ¶
func MockNvmeNamespace(varIdx ...int32) *ctlpb.NvmeController_Namespace
MockNvmeNamespace is a mock protobuf Namespace message used in tests for multiple packages.
func MockPBMemInfo ¶
MockPBMemInfo returns a mock MemInfo result.
func MockScmModule ¶
MockScmModule generates specific protobuf SCM module message used in tests for multiple packages.
func MockScmMountPoint ¶
func MockScmMountPoint(varIdx ...int32) *ctlpb.ScmNamespace_Mount
MockScmMountPoint generates specific protobuf SCM namespace mount message used in tests for multiple packages.
func MockScmNamespace ¶
func MockScmNamespace(varIdx ...int32) *ctlpb.ScmNamespace
MockScmNamespace generates specific protobuf SCM namespace message used in tests for multiple packages.
func MockSmdDevice ¶
func MockSmdDevice(c *storage.NvmeController, varIdx ...int32) *ctlpb.SmdDevice
MockSmdDevice is a mock protobuf SmdDevice message used in tests for multiple packages.
func ShouldDebug ¶
ShouldDebug returns true if the protobuf message should be logged.
func UnwrapError ¶
UnwrapError reconstitutes the original error from the gRPC metadata.
Types ¶
type NvmeController ¶
type NvmeController ctlpb.NvmeController
NvmeController is an alias for protobuf NvmeController message slice.
func (*NvmeController) AsProto ¶
func (pb *NvmeController) AsProto() *ctlpb.NvmeController
AsProto converts pointer receiver alias type to protobuf type.
func (*NvmeController) FromNative ¶
func (pb *NvmeController) FromNative(native *storage.NvmeController) error
FromNative converts storage package type to protobuf equivalent.
func (*NvmeController) ToNative ¶
func (pb *NvmeController) ToNative() (*storage.NvmeController, error)
ToNative converts pointer receiver alias type to storage package equivalent.
type NvmeControllerResults ¶
type NvmeControllerResults []*ctlpb.NvmeControllerResult
NvmeControllerResults is an alias for protobuf NvmeControllerResult messages representing operation results on a number of NVMe controllers.
func (NvmeControllerResults) Errors ¶
func (ncr NvmeControllerResults) Errors() string
Errors reports summary string of errored results.
func (NvmeControllerResults) HasErrors ¶
func (ncr NvmeControllerResults) HasErrors() bool
HasErrors indicates whether any controller result has non-successful status.
type NvmeControllers ¶
type NvmeControllers []*ctlpb.NvmeController
NvmeControllers is an alias for protobuf NvmeController message slice representing a number of NVMe SSD controllers installed on a storage node.
func (*NvmeControllers) FromNative ¶
func (pb *NvmeControllers) FromNative(native storage.NvmeControllers) error
FromNative converts storage package type to protobuf equivalent.
func (*NvmeControllers) ToNative ¶
func (pb *NvmeControllers) ToNative() (storage.NvmeControllers, error)
ToNative converts pointer receiver alias type to storage package equivalent.
type NvmeHealth ¶
type NvmeHealth ctlpb.BioHealthResp
NvmeHealth is an alias for protobuf BioHealthResp message.
func (*NvmeHealth) AsProto ¶
func (pb *NvmeHealth) AsProto() *ctlpb.BioHealthResp
AsProto converts pointer receiver alias type to protobuf type.
func (*NvmeHealth) FromNative ¶
func (pb *NvmeHealth) FromNative(native *storage.NvmeHealth) error
FromNative converts storage package type to protobuf equivalent.
func (*NvmeHealth) ToNative ¶
func (pb *NvmeHealth) ToNative() (*storage.NvmeHealth, error)
ToNative converts pointer receiver alias type to storage package equivalent.
type NvmeNamespace ¶
type NvmeNamespace ctlpb.NvmeController_Namespace
NvmeNamespace is an alias for protobuf NvmeController_Namespace message.
func (*NvmeNamespace) AsProto ¶
func (pb *NvmeNamespace) AsProto() *ctlpb.NvmeController_Namespace
AsProto converts pointer receiver alias type to protobuf type.
func (*NvmeNamespace) FromNative ¶
func (pb *NvmeNamespace) FromNative(native *storage.NvmeNamespace) error
FromNative converts storage package type to protobuf equivalent.
func (*NvmeNamespace) ToNative ¶
func (pb *NvmeNamespace) ToNative() (*storage.NvmeNamespace, error)
ToNative converts pointer receiver alias type to storage package equivalent.
type NvmeNamespaces ¶
type NvmeNamespaces []*ctlpb.NvmeController_Namespace
NvmeNamespaces is an alias for protobuf NvmeController_Namespace message slice representing namespaces existing on a NVMe SSD.
type ScmModule ¶
ScmModule is an alias for protobuf ScmModule message representing an SCM persistent memory module installed on a storage node.
func (*ScmModule) FromNative ¶
FromNative converts storage package type to protobuf equivalent.
type ScmModuleResults ¶
type ScmModuleResults []*ctlpb.ScmModuleResult
ScmModuleResults is an alias for protobuf ScmModuleResult message slice representing operation results on a number of SCM modules.
type ScmModules ¶
ScmModules is an alias for protobuf ScmModule message slice representing a number of SCM modules installed on a storage node.
func (*ScmModules) FromNative ¶
func (pb *ScmModules) FromNative(native storage.ScmModules) error
FromNative converts storage package type to protobuf equivalent.
func (*ScmModules) ToNative ¶
func (pb *ScmModules) ToNative() (storage.ScmModules, error)
ToNative converts pointer receiver alias type to storage package equivalent.
type ScmMountPoint ¶
type ScmMountPoint ctlpb.ScmNamespace_Mount
ScmMountPoint is an alias for protobuf ScmNamespace_Mount message representing the OS mount point target at which a pmem block device is mounted.
func (*ScmMountPoint) AsProto ¶
func (pb *ScmMountPoint) AsProto() *ctlpb.ScmNamespace_Mount
AsProto converts pointer receiver alias type to protobuf type.
func (*ScmMountPoint) FromNative ¶
func (pb *ScmMountPoint) FromNative(native *storage.ScmMountPoint) error
FromNative converts storage package type to protobuf equivalent.
func (*ScmMountPoint) ToNative ¶
func (pb *ScmMountPoint) ToNative() (*storage.ScmMountPoint, error)
ToNative converts pointer receiver alias type to storage package equivalent.
type ScmMountResults ¶
type ScmMountResults []*ctlpb.ScmMountResult
ScmMountResults is an alias for protobuf ScmMountResult message slice representing operation results on a number of SCM mounts.
func (ScmMountResults) HasErrors ¶
func (smr ScmMountResults) HasErrors() bool
HasErrors indicates whether any mount result has non-successful status.
type ScmNamespace ¶
type ScmNamespace ctlpb.ScmNamespace
ScmNamespace is an alias for protobuf ScmNamespace message representing a pmem block device created on an appdirect set of persistent memory modules.
func (*ScmNamespace) AsProto ¶
func (pb *ScmNamespace) AsProto() *ctlpb.ScmNamespace
AsProto converts pointer receiver alias type to protobuf type.
func (*ScmNamespace) FromNative ¶
func (pb *ScmNamespace) FromNative(native *storage.ScmNamespace) error
FromNative converts storage package type to protobuf equivalent.
func (*ScmNamespace) ToNative ¶
func (pb *ScmNamespace) ToNative() (*storage.ScmNamespace, error)
ToNative converts pointer receiver alias type to storage package equivalent.
type ScmNamespaces ¶
type ScmNamespaces []*ctlpb.ScmNamespace
ScmNamespaces is an alias for protobuf ScmNamespace message slice representing a number of SCM modules installed on a storage node.
func (*ScmNamespaces) FromNative ¶
func (pb *ScmNamespaces) FromNative(native storage.ScmNamespaces) error
FromNative converts storage package type to protobuf equivalent.
func (*ScmNamespaces) ToNative ¶
func (pb *ScmNamespaces) ToNative() (storage.ScmNamespaces, error)
ToNative converts pointer receiver alias type to storage package equivalent.
type SmdDevice ¶
SmdDevice is an alias for protobuf SmdDevice message representing DAOS server meta data existing on a NVMe SSD.
func (*SmdDevice) FromNative ¶
FromNative converts storage package type to protobuf equivalent.
type SmdDevices ¶
SmdDevices is an alias for protobuf SmdDevice message slice representing DAOS server meta data existing on a NVMe SSD.