Documentation ¶
Overview ¶
Package datauploader contains routines upload inventory data to SSM - Inventory service
Package datauploader contains routines upload inventory data to SSM - Inventory service ¶
Package datauploader contains routines upload inventory data to SSM - Inventory service ¶
Package datauploader contains routines upload inventory data to SSM - Inventory service
Index ¶
Constants ¶
const (
// Name represents name of this component that uploads data to SSM
Name = "InventoryUploader"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertToMap ¶
ConvertToMap converts given object to map[string]*string
func ConvertToSSMInventoryItem ¶
func ConvertToSSMInventoryItem(item model.Item) (inventoryItem *ssm.InventoryItem, err error)
ConvertToSSMInventoryItem converts given InventoryItem to []map[string]*string
Types ¶
type Impl ¶
type Impl struct {
// contains filtered or unexported fields
}
Impl implements content hash optimizations for inventory plugin
func (*Impl) GetContentHash ¶
func (*Impl) UpdateContentHash ¶
type InventoryUploader ¶
type InventoryUploader struct {
// contains filtered or unexported fields
}
InventoryUploader implements functionality to upload data to SSM Inventory.
func NewInventoryUploader ¶
func NewInventoryUploader(context context.T) (*InventoryUploader, error)
NewInventoryUploader creates a new InventoryUploader (which sends data to SSM Inventory)
func (*InventoryUploader) ConvertToSsmInventoryItems ¶
func (u *InventoryUploader) ConvertToSsmInventoryItems(context context.T, items []model.Item) (optimizedInventoryItems, nonOptimizedInventoryItems []*ssm.InventoryItem, err error)
ConvertToSsmInventoryItems converts given array of inventory.Item into an array of *ssm.InventoryItem. It returns 2 such arrays - one is optimized array which contains only contentHash for those inventory types where the dataset hasn't changed from previous collection. The other array is non-optimized array which contains both contentHash & content. This is done to avoid iterating over the inventory data twice. It throws error when it encounters error during conversion process.
func (*InventoryUploader) SendDataToSSM ¶
func (u *InventoryUploader) SendDataToSSM(context context.T, items []*ssm.InventoryItem) (err error)
SendDataToSSM uploads given inventory items to SSM
type MockOptinizer ¶
Mock stands for a mocked plugin.
func NewMockDefault ¶
func NewMockDefault() *MockOptinizer
func (*MockOptinizer) GetContentHash ¶
func (m *MockOptinizer) GetContentHash(inventoryItemName string) (hash string)
func (*MockOptinizer) UpdateContentHash ¶
func (m *MockOptinizer) UpdateContentHash(inventoryItemName, hash string) (err error)
type Optimizer ¶
type Optimizer interface { UpdateContentHash(inventoryItemName, hash string) (err error) GetContentHash(inventoryItemName string) (hash string) }
Optimizer defines operations of content optimizer which inventory plugin makes use of
type T ¶
type T interface { SendDataToSSM(context context.T, items []*ssm.InventoryItem) (err error) ConvertToSsmInventoryItems(context context.T, items []model.Item) (optimizedInventoryItems, nonOptimizedInventoryItems []*ssm.InventoryItem, err error) }
T represents contracts for SSM Inventory data uploader