proto

package
v0.0.0-...-72cc25f Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: BSD-2-Clause-Patent Imports: 23 Imported by: 16

Documentation

Index

Constants

View Source
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

View Source
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

func AnnotateError(in error) error

AnnotateError adds more details to the gRPC error, if available.

func Debug

func Debug(msg proto.Message) string

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

func ErrFromMeta(meta map[string]string, errType error) error

ErrFromMeta converts a map of metadata into an error.

func MetaFromFault

func MetaFromFault(f *fault.Fault) map[string]string

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

func MockPBMemInfo() *ctlpb.MemInfo

MockPBMemInfo returns a mock MemInfo result.

func MockScmModule

func MockScmModule(varIdx ...int32) *ctlpb.ScmModule

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

func ShouldDebug(msg proto.Message, ldrChk func() bool) bool

ShouldDebug returns true if the protobuf message should be logged.

func UnwrapError

func UnwrapError(st *status.Status) error

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

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

type ScmModule ctlpb.ScmModule

ScmModule is an alias for protobuf ScmModule message representing an SCM persistent memory module installed on a storage node.

func (*ScmModule) AsProto

func (pb *ScmModule) AsProto() *ctlpb.ScmModule

AsProto converts pointer receiver alias type to protobuf type.

func (*ScmModule) FromNative

func (pb *ScmModule) FromNative(native *storage.ScmModule) error

FromNative converts storage package type to protobuf equivalent.

func (*ScmModule) ToNative

func (pb *ScmModule) ToNative() (*storage.ScmModule, error)

ToNative converts pointer receiver alias type to storage package 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

type ScmModules []*ctlpb.ScmModule

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

type SmdDevice ctlpb.SmdDevice

SmdDevice is an alias for protobuf SmdDevice message representing DAOS server meta data existing on a NVMe SSD.

func (*SmdDevice) AsProto

func (pb *SmdDevice) AsProto() *ctlpb.SmdDevice

AsProto converts pointer receiver alias type to protobuf type.

func (*SmdDevice) FromNative

func (pb *SmdDevice) FromNative(native *storage.SmdDevice) error

FromNative converts storage package type to protobuf equivalent.

func (*SmdDevice) ToNative

func (pb *SmdDevice) ToNative() (*storage.SmdDevice, error)

ToNative converts pointer receiver alias type to storage package equivalent.

type SmdDevices

type SmdDevices []*ctlpb.SmdDevice

SmdDevices is an alias for protobuf SmdDevice message slice representing DAOS server meta data existing on a NVMe SSD.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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