Documentation ¶
Index ¶
- func Server(endpoint string, c oim.ControllerServer, ...) (*oimcommon.NonBlockingGRPCServer, func(*grpc.Server))
- type Controller
- func (c *Controller) CheckMallocBDev(ctx context.Context, in *oim.CheckMallocBDevRequest) (*oim.CheckMallocBDevReply, error)
- func (c *Controller) Close()
- func (c *Controller) MapVolume(ctx context.Context, in *oim.MapVolumeRequest) (*oim.MapVolumeReply, error)
- func (c *Controller) ProvisionMallocBDev(ctx context.Context, in *oim.ProvisionMallocBDevRequest) (*oim.ProvisionMallocBDevReply, error)
- func (c *Controller) Server(endpoint string) (*oimcommon.NonBlockingGRPCServer, func(*grpc.Server))
- func (c *Controller) Start() error
- func (c *Controller) UnmapVolume(ctx context.Context, in *oim.UnmapVolumeRequest) (*oim.UnmapVolumeReply, error)
- type Option
- func WithControllerAddress(address string) Option
- func WithControllerID(controllerID string) Option
- func WithCreds(creds credentials.TransportCredentials) Option
- func WithRegistry(address string) Option
- func WithRegistryDelay(delay time.Duration) Option
- func WithSPDK(path string) Option
- func WithVHostController(vhost string) Option
- func WithVHostDev(dev string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Server ¶
func Server(endpoint string, c oim.ControllerServer, creds credentials.TransportCredentials) (*oimcommon.NonBlockingGRPCServer, func(*grpc.Server))
Server configures an arbitrary OIM controller implementation as a gRPC server.
Types ¶
type Controller ¶
Controller implements oim.Controller.
func New ¶
func New(options ...Option) (*Controller, error)
New constructs a new OIM controller instance.
func (*Controller) CheckMallocBDev ¶
func (c *Controller) CheckMallocBDev(ctx context.Context, in *oim.CheckMallocBDevRequest) (*oim.CheckMallocBDevReply, error)
CheckMallocBDev checks whether the Malloc BDev exists.
func (*Controller) Close ¶
func (c *Controller) Close()
Close ends the interaction with the OIM Registry, if one was configured, and frees all resources.
func (*Controller) MapVolume ¶
func (c *Controller) MapVolume(ctx context.Context, in *oim.MapVolumeRequest) (*oim.MapVolumeReply, error)
MapVolume ensures that there is a BDev for the volume and makes it available as block device.
func (*Controller) ProvisionMallocBDev ¶
func (c *Controller) ProvisionMallocBDev(ctx context.Context, in *oim.ProvisionMallocBDevRequest) (*oim.ProvisionMallocBDevReply, error)
ProvisionMallocBDev creates a new local Malloc BDev.
func (*Controller) Server ¶
func (c *Controller) Server(endpoint string) (*oimcommon.NonBlockingGRPCServer, func(*grpc.Server))
Server returns a new gRPC server listening on the given endpoint.
func (*Controller) Start ¶
func (c *Controller) Start() error
Start begins the interaction with the OIM Registry, if one was configured.
func (*Controller) UnmapVolume ¶
func (c *Controller) UnmapVolume(ctx context.Context, in *oim.UnmapVolumeRequest) (*oim.UnmapVolumeReply, error)
UnmapVolume removes the block device for a BDev and (if not a local Malloc BDev) the BDev itself.
type Option ¶
type Option func(c *Controller) error
Option is what New accepts to reconfigure the resulting controller.
func WithControllerAddress ¶
WithControllerAddress sets the *external* address for the controller, i.e. what the OIM registry needs to use for gRPC.Dial to contact the controller.
func WithControllerID ¶
WithControllerID sets the unique ID that this controller instance has inside the OIM registry. Only needed when self-registration is enabled with WithRegistry.
func WithCreds ¶
func WithCreds(creds credentials.TransportCredentials) Option
WithCreds sets the secret key and CA used by the controller for mutual TLS.
func WithRegistry ¶
WithRegistry sets the OIM registry end point for the optional self-registrarion. It takes a gRPC dial string.
func WithRegistryDelay ¶
WithRegistryDelay sets the interval between self-registration calls.
func WithVHostController ¶
WithVHostController sets the name of the existing SCSI device to which BDevs are to be attached.
func WithVHostDev ¶
WithVHostDev sets the PCI address of the SCSI device. It takes a PCI Bus/Device/Function string.