Documentation ¶
Index ¶
- Variables
- type Repository
- type Serverservice
- func (s *Serverservice) BillOfMaterialsBatchUpload(ctx context.Context, boms []sservice.Bom) (*sservice.ServerResponse, error)
- func (s *Serverservice) GetBomInfoByAOCMacAddr(ctx context.Context, macAddr string) (*sservice.Bom, *sservice.ServerResponse, error)
- func (s *Serverservice) GetBomInfoByBMCMacAddr(ctx context.Context, macAddr string) (*sservice.Bom, *sservice.ServerResponse, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrServerserviceConfig is returned when theres an error in loading serverservice configuration. ErrServerserviceConfig = errors.New("Serverservice configuration error") // ErrServserviceAttribute is returned when a serverservice attribute does not contain the expected fields. ErrServerserviceAttribute = errors.New("error in serverservice attribute") )
View Source
var (
ErrRepository = errors.New("storage repository error")
)
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository interface { // GetBomInfoByAOCMacAddr gets bom object by AOCMacAddr. GetBomInfoByAOCMacAddr(ctx context.Context, macAddr string) (*sservice.Bom, *sservice.ServerResponse, error) // GetBomInfoByBMCMacAddr gets bom object by BMCMacAddr. GetBomInfoByBMCMacAddr(ctx context.Context, macAddr string) (*sservice.Bom, *sservice.ServerResponse, error) // BillOfMaterialsBatchUpload creates a bom on a server. BillOfMaterialsBatchUpload(ctx context.Context, boms []sservice.Bom) (*sservice.ServerResponse, error) }
NOTE: when updating this interface, run make gen-store-mock to make sure the mocks are updated.
func NewStore ¶
func NewStore(ctx context.Context, config *app.Configuration, logger *logrus.Logger) (Repository, error)
type Serverservice ¶
type Serverservice struct {
// contains filtered or unexported fields
}
Serverservice implements the Repository interface to have server bom objects stored as server attributes.
func (*Serverservice) BillOfMaterialsBatchUpload ¶
func (s *Serverservice) BillOfMaterialsBatchUpload(ctx context.Context, boms []sservice.Bom) (*sservice.ServerResponse, error)
BillOfMaterialsBatchUpload will attempt to write multiple boms to database.
func (*Serverservice) GetBomInfoByAOCMacAddr ¶
func (s *Serverservice) GetBomInfoByAOCMacAddr(ctx context.Context, macAddr string) (*sservice.Bom, *sservice.ServerResponse, error)
GetBomInfoByAOCMacAddr will return the bom info object by the aoc mac address.
func (*Serverservice) GetBomInfoByBMCMacAddr ¶
func (s *Serverservice) GetBomInfoByBMCMacAddr(ctx context.Context, macAddr string) (*sservice.Bom, *sservice.ServerResponse, error)
GetBomInfoByBMCMacAddr will return the bom info object by the bmc mac address.
Click to show internal directories.
Click to hide internal directories.