drivemgr

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package drivemgr contains a code for managers of storage hardware such as drives

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DriveManager

type DriveManager interface {
	// GetDrivesList gets list of drives
	GetDrivesList() ([]*api.Drive, error)
	// Locate manipulates of drive's led state, receive drive serial number and type of action
	// returns current led status or error
	Locate(serialNumber string, action int32) (currentStatus int32, err error)
	// LocateNode manipulates of node's led state, which should be synced with drive's led
	LocateNode(action int32) error
	// GetDriveSmartInfo gets smart info for specific drive with given serialNumber
	GetDriveSmartInfo(serialNumber string) (string, error)
	// GetAllDrivesSmartInfo gets smart info for all drives on given node
	GetAllDrivesSmartInfo() (string, error)
}

DriveManager is the interface for managers that provide information about drives on a node

type DriveServiceServerImpl

type DriveServiceServerImpl struct {
	// contains filtered or unexported fields
}

DriveServiceServerImpl is the implementation of gRPC server that gives possibility to invoke DriveManager's methods remotely

func NewDriveServer

func NewDriveServer(logger *logrus.Logger, manager DriveManager) DriveServiceServerImpl

NewDriveServer is the constructor for DriveServiceServerImpl struct Receives logrus logger and implementation of DriveManager as parameters Returns an instance of DriveServiceServerImpl

func (*DriveServiceServerImpl) GetAllDrivesSmartInfo added in v1.6.1

func (svc *DriveServiceServerImpl) GetAllDrivesSmartInfo(ctx context.Context, req *api.Empty) (*api.SmartInfoResponse, error)

GetAllDrivesSmartInfo invokes DriveManager's GetAllDrivesSmartInfo() and sends the response over gRPC Receives go context and Empty message Returns SmartInfoResponse with smart info json string

func (*DriveServiceServerImpl) GetDriveSmartInfo added in v1.6.1

func (svc *DriveServiceServerImpl) GetDriveSmartInfo(ctx context.Context, req *api.SmartInfoRequest) (*api.SmartInfoResponse, error)

GetDriveSmartInfo invokes DriveManager's GetDriveSmartInfo() and sends the response over gRPC Receives go context and SmartInfoRequest which contains Serial Number Returns SmartInfoResponse with smart info json string

func (*DriveServiceServerImpl) GetDrivesList

func (svc *DriveServiceServerImpl) GetDrivesList(ctx context.Context, req *api.DrivesRequest) (*api.DrivesResponse, error)

GetDrivesList invokes DriveManager's GetDrivesList() and sends the response over gRPC Receives go context and DrivesRequest which contains node id Returns DrivesResponse with slice of api.Drives structs

func (*DriveServiceServerImpl) Locate

Locate invokes DriveManager's Locate method for manipulation drive's LED state

func (*DriveServiceServerImpl) LocateNode

func (svc *DriveServiceServerImpl) LocateNode(ctx context.Context, req *api.NodeLocateRequest) (*api.Empty, error)

LocateNode invokes DriveManager's LocateNode method for manipulation node's LED state

Directories

Path Synopsis
Package idracmgr provides the iDRAC based implementation of DriveManager interface
Package idracmgr provides the iDRAC based implementation of DriveManager interface
Package loopbackmgr contains DriveManager for test purposes based on loop devices
Package loopbackmgr contains DriveManager for test purposes based on loop devices

Jump to

Keyboard shortcuts

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