Documentation
¶
Index ¶
- type Config
- type DataStoreType
- type NVSwitchManager
- func (nm *NVSwitchManager) Delete(ctx context.Context, id uuid.UUID) error
- func (nm *NVSwitchManager) Get(ctx context.Context, id uuid.UUID) (*nvswitch.NVSwitchTray, error)
- func (nm *NVSwitchManager) List(ctx context.Context) ([]*nvswitch.NVSwitchTray, error)
- func (nm *NVSwitchManager) Register(ctx context.Context, tray *nvswitch.NVSwitchTray) (uuid.UUID, bool, error)
- func (nm *NVSwitchManager) Start(ctx context.Context) error
- func (nm *NVSwitchManager) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DSType DataStoreType
CredentialConf credentials.Config
DB *bun.DB // Database connection for persistent storage
}
Config specifies the configuration for the NVSwitchManager.
type DataStoreType ¶
type DataStoreType string
DataStoreType represents the backing datastore for the manager.
const ( DatastoreTypeInMemory DataStoreType = "inmemory" DatastoreTypePersistent DataStoreType = "persistent" )
type NVSwitchManager ¶
type NVSwitchManager struct {
DataStoreType DataStoreType
Registry nvswitchregistry.Registry
CredentialManager credentials.CredentialManager
}
NVSwitchManager coordinates registry and credential management for NV-Switch trays.
func New ¶
func New(ctx context.Context, c Config) (*NVSwitchManager, error)
New creates a new instance of NVSwitchManager.
func (*NVSwitchManager) Get ¶
func (nm *NVSwitchManager) Get(ctx context.Context, id uuid.UUID) (*nvswitch.NVSwitchTray, error)
Get retrieves an NV-Switch by UUID and attaches credentials.
func (*NVSwitchManager) List ¶
func (nm *NVSwitchManager) List(ctx context.Context) ([]*nvswitch.NVSwitchTray, error)
List returns all registered NV-Switches.
func (*NVSwitchManager) Register ¶
func (nm *NVSwitchManager) Register(ctx context.Context, tray *nvswitch.NVSwitchTray) (uuid.UUID, bool, error)
Register registers a new NV-Switch tray and stores its credentials.
Click to show internal directories.
Click to hide internal directories.