resourcesimpl

package
v0.0.0-...-3ebc15a Latest Latest
Warning

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

Go to latest
Published: May 4, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Params

type Params struct {
	// Disabled determines if the resources payload will be sent. When disabled, the Get method is still available.
	Disabled bool
}

Params defines the parameters for the metadata resources component.

func Disabled

func Disabled() *Params

Disabled returns a new Params struct that will disabled sending the resources payload.

type Provides

type Provides struct {
	compdef.Out

	Comp     resources.Component
	Provider runnerdef.Provider
}

Provides defines the output of the resources metadata component.

func NewComponent

func NewComponent(deps Requires) Provides

NewComponent creates a new resources metadata component.

type Requires

type Requires struct {
	compdef.In

	Params *Params `optional:"true"`

	Log        log.Component
	Config     config.Component
	Serializer serializer.MetricSerializer
	Hostname   hostnameinterface.Component
}

Requires defines the dependencies for the resources metadata component.

Resources is enabled by default for most binaries. But even for binaries where we don't want to send the 'resources' paylod, like dogstatsd, we still need the resources Component. This is because the resources data is embedded in other metadata payload like 'host'. This means that even if resources is disabled it might be required in the build in order for the `Get` method to be available.

This is why we have a Params struct for resources. It's `optional` so most of the binaries don't have to supply a Params struct but only need to import the metadata.Bundle.

Jump to

Keyboard shortcuts

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