fleetdb

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrSlugs                        = errors.New("slugs error")
	ErrServerServiceRegisterChanges = errors.New("error in server service API register changes")
	ErrAssetObject                  = errors.New("asset object error")
	ErrAssetObjectConversion        = errors.New("error converting asset object")
	ErrFleetDBObject                = errors.New("serverService object error")
	ErrChangeList                   = errors.New("error building change list")
	ErrServerServiceAttrObject      = errors.New("error in server service attribute object")
	ErrFleetDBConfig                = errors.New("fleetdb configuration error")
	ErrInventoryQuery               = errors.New("fleetdb query returned error")
)

Functions

func NewFleetDBClient

func NewFleetDBClient(ctx context.Context, cfg *Config, logger *logrus.Logger) (*fleetdbapi.Client, error)

NewFleetDBClient instantiates and returns a serverService client

Types

type Config

type Config struct {
	URL              string   `mapstructure:"url"`
	OidcIssuerURL    string   `mapstructure:"oidc_issuer_url"`
	OidcAudienceURL  string   `mapstructure:"oidc_audience_url"`
	OidcClientSecret string   `mapstructure:"oidc_client_secret"`
	OidcClientID     string   `mapstructure:"oidc_client_id"`
	OidcClientScopes []string `mapstructure:"oidc_client_scopes"`
	Authenticate     bool     `mapstructure:"authenticate"`
}

FleetDBConfig defines configuration for the Serverservice client. https://github.com/metal-toolbox/fleetdb

type Store

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

Store is an asset inventory store

func New

func New(ctx context.Context, cfg *Config, logger *logrus.Logger) (*Store, error)

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

func (*Store) AssetByID

func (s *Store) AssetByID(ctx context.Context, id uuid.UUID) (*model.Asset, error)

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

Jump to

Keyboard shortcuts

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