store

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

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.

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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