inventorychecksimpl

package
v0.0.0-...-45b38f9 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package inventorychecksimpl implements the inventorychecks component interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockModule

func MockModule() fxutil.Module

MockModule defines the fx options for the mock component.

Usage:

fxutil.Test[dependencies](
   t,
   inventorychecks.MockModule(),
)

func Module

func Module() fxutil.Module

Module defines the fx options for this component.

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

func (p *Payload) MarshalJSON() ([]byte, error)

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.

Jump to

Keyboard shortcuts

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