Documentation ¶
Overview ¶
Package inventorychecksimpl implements the inventorychecks component interface.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockModule ¶
MockModule defines the fx options for the mock component.
Usage:
fxutil.Test[dependencies]( t, inventorychecks.MockModule(), )
Types ¶
type InventorychecksMock ¶
type InventorychecksMock struct {
// contains filtered or unexported fields
}
InventorychecksMock mocks methods for the inventorychecks components for testing
func (*InventorychecksMock) GetAsJSON ¶
func (m *InventorychecksMock) GetAsJSON() ([]byte, error)
GetAsJSON returns an hardcoded empty JSON dict
func (*InventorychecksMock) GetInstanceMetadata ¶
func (m *InventorychecksMock) GetInstanceMetadata(instanceID string) map[string]interface{}
GetInstanceMetadata returns all the metadata set for an instanceID using the Set method
func (*InventorychecksMock) Refresh ¶
func (m *InventorychecksMock) Refresh()
Refresh is a empty method for the inventorychecks mock
func (*InventorychecksMock) Set ¶
func (m *InventorychecksMock) Set(instanceID string, key string, value interface{})
Set sets a metadata value for a specific instancID
type MockProvides ¶
type MockProvides struct { fx.Out Comp icinterface.Component }
MockProvides is the mock component output
func NewMock ¶
func NewMock() MockProvides
NewMock returns a new InventorychecksMock. TODO: (components) - Once the checks are components we can make this method private
type Payload ¶
type Payload struct { Hostname string `json:"hostname"` Timestamp int64 `json:"timestamp"` Metadata map[string][]metadata `json:"check_metadata"` LogsMetadata map[string][]metadata `json:"logs_metadata"` UUID string `json:"uuid"` }
Payload handles the JSON unmarshalling of the metadata payload
func (*Payload) MarshalJSON ¶
MarshalJSON serialization a Payload to JSON
func (*Payload) SplitPayload ¶
func (p *Payload) SplitPayload(_ int) ([]marshaler.AbstractMarshaler, error)
SplitPayload implements marshaler.AbstractMarshaler#SplitPayload.
In this case, the payload can't be split any further.