entitymanager

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package entitymanager is an in-memory implementation of an entity manager that models an organization's inventory.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemoryEntityManager

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

InMemoryEntityManager provides a simple in memory handler for Entities.

func New

func New(chassisConfigFile string, artifacts *service.SecurityArtifacts) (*InMemoryEntityManager, error)

New returns a new in-memory entity manager.

func (*InMemoryEntityManager) AddChassis

func (m *InMemoryEntityManager) AddChassis(bootMode bpb.BootMode, manufacturer string, serial string) *InMemoryEntityManager

AddChassis adds a new chassis to the entity manager.

func (*InMemoryEntityManager) AddControlCard

func (m *InMemoryEntityManager) AddControlCard(serial string) *InMemoryEntityManager

AddControlCard adds a new control card to the entity manager.

func (*InMemoryEntityManager) DeleteDevice

func (m *InMemoryEntityManager) DeleteDevice(chassis *service.EntityLookup)

DeleteDevice removes the chassis at the provided lookup from the entitymanager.

func (*InMemoryEntityManager) GetAll

func (m *InMemoryEntityManager) GetAll() []*epb.Chassis

GetAll returns a copy of the chassisInventory field.

func (*InMemoryEntityManager) GetBootstrapData

func (m *InMemoryEntityManager) GetBootstrapData(ctx context.Context, chassis *service.Chassis, serial string) (*bpb.BootstrapDataResponse, error)

GetBootstrapData fetches and returns the bootstrap data response from the server.

func (*InMemoryEntityManager) GetChassisInventory

func (m *InMemoryEntityManager) GetChassisInventory() []*epb.Chassis

GetChassisInventory returns the chassis inventory

func (*InMemoryEntityManager) GetDevice

func (m *InMemoryEntityManager) GetDevice(chassis *service.EntityLookup) (*epb.Chassis, error)

GetDevice returns a copy of the chassis at the provided lookup.

func (*InMemoryEntityManager) ReplaceDevice

func (m *InMemoryEntityManager) ReplaceDevice(old *service.EntityLookup, new *epb.Chassis) error

ReplaceDevice replaces an existing chassis with a new chassis object. If the chassis is not found, it is added to the inventory.

func (*InMemoryEntityManager) ResolveChassis

func (m *InMemoryEntityManager) ResolveChassis(ctx context.Context, lookup *service.EntityLookup, ccSerial string) (*service.Chassis, error)

ResolveChassis returns an entity based on the provided lookup. If a control card serial is provided, it also looks up chassis' by its control cards.

func (*InMemoryEntityManager) SetStatus

SetStatus updates the status for each control card on the chassis.

func (*InMemoryEntityManager) Sign

func (m *InMemoryEntityManager) Sign(ctx context.Context, resp *bpb.GetBootstrapDataResponse, chassis *service.Chassis, controllerCard string) error

Sign unmarshals the SignedResponse bytes then generates a signature from its Ownership Certificate private key.

Directories

Path Synopsis
proto

Jump to

Keyboard shortcuts

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