component

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewComponentRenderer

func NewComponentRenderer(component *componentResponse, jsonData []byte, writer io.Writer) *componentRenderer

NewComponentRenderer creates a new renderer of a single component

func NewComponentsRenderer

func NewComponentsRenderer(components *componentListResponse, jsonData []byte, writer io.Writer, noHeaders bool) *componentsRenderer

NewComponentsRenderer creates a new renderer for a list of components

Types

type ComponentList

type ComponentList struct {
	// Included is a list of included items
	Included []map[string]any
	// Components is a list of components
	Components []string
}

ComponentList is a list of components

func (*ComponentList) MarshalJSON

func (cl *ComponentList) MarshalJSON() ([]byte, error)

func (*ComponentList) ToResponse

func (cl *ComponentList) ToResponse() *componentListResponse

type GetComponentInput

type GetComponentInput struct {
	Logger    *slog.Logger
	APIClient apiclient.ClientWithResponsesInterface
}

GetComponentInput is the input used by GetComponent()

type GetComponentResult

type GetComponentResult struct {
	ComponentResponse *componentResponse
	JSONResponse      []byte
	Problem           *apiclient.Problem
}

GetComponentResult is the result of GetComponent

func GetComponent

func GetComponent(ctx context.Context, namespace, name string, in GetComponentInput) (*GetComponentResult, error)

GetComponent returns information abuot a component

type ListComponentResults

type ListComponentResults struct {
	ComponentListResponse *componentListResponse
	JSONResponse          []byte
	Problem               *apiclient.Problem
}

ListComponentResults is the result of ListComponents

func ListComponents

func ListComponents(ctx context.Context, in ListComponentsInput) (*ListComponentResults, error)

ListComponents returns a non-paginated list of components

type ListComponentsInput

type ListComponentsInput struct {
	// Logger is a logger
	Logger *slog.Logger
	// APIClient is the inventory server API client used to make requests
	APIClient apiclient.ClientWithResponsesInterface
}

ListComponentsInput is the input given to ListComponents()

type Renderer

type Renderer interface {
	// Render renders the component
	Render(format string) error
}

Jump to

Keyboard shortcuts

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