fleetdb

package
v0.0.0-...-dcf9213 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSlugs                  = errors.New("slugs error")
	ErrFleetDBRegisterChanges = errors.New("error in FleetDB API register changes")
	ErrAssetObject            = errors.New("asset object error")
	ErrAssetObjectConversion  = errors.New("error converting asset object")
	ErrFleetDBAPIObject       = errors.New("serverService object error")
	ErrChangeList             = errors.New("error building change list")
	ErrFleetDBAttrObject      = errors.New("error in FleetDB API attribute object")
)
View Source
var (
	ErrConfig = errors.New("error in fleetdb client configuration")
)

Functions

func NewFleetDBAPIClient

func NewFleetDBAPIClient(ctx context.Context, cfg *app.FleetDBAPIOptions, logger *logrus.Logger) (*fleetdbapi.Client, error)

NewFleetDBAPIClient instantiates and returns a serverService client

Types

type Store

type Store struct {
	*fleetdbapi.Client
	// contains filtered or unexported fields
}

Store is an asset inventory store

func New

func New(ctx context.Context, appKind model.AppKind, cfg *app.FleetDBAPIOptions, logger *logrus.Logger) (*Store, error)

NewStore returns a fleetdb store queryor to lookup and publish assets to, from the store.

func (*Store) AssetByID

func (r *Store) AssetByID(ctx context.Context, id string, fetchBmcCredentials bool) (*model.Asset, error)

assetByID queries serverService for the hardware asset by ID and returns an Asset object

func (*Store) AssetUpdate

func (r *Store) AssetUpdate(ctx context.Context, asset *model.Asset) error

AssetUpdate inserts/updates the asset data in the fleetdb store

func (*Store) AssetsByOffsetLimit

func (r *Store) AssetsByOffsetLimit(ctx context.Context, offset, limit int) (assets []*model.Asset, totalAssets int, err error)

assetByID queries serverService for the hardware asset by ID and returns an Asset object

func (*Store) Kind

func (r *Store) Kind() model.StoreKind

Kind returns the repository store kind.

Jump to

Keyboard shortcuts

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