ids

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2020 New Relic Corporation. All rights reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

View Source
const (
	DefaultInventoryCategory = "integration"
)

Variables

View Source
var (
	CustomAttrsID = PluginID{
		Category: "metadata",
		Term:     "attributes",
	}
	HostInfo = PluginID{
		Category: "metadata",
		Term:     "system",
	}
	EmptyInventorySource = PluginID{}
)

PluginID list:

Functions

This section is empty.

Types

type PluginID

type PluginID struct {
	Category string
	Term     string
}

PluginID identifies a plugin in a taxonomy-like form, given a Category name (e.g. `kernel`) and a Term (e.g. `sysctl`). Implements the next interfaces: json.Marshaler, json.Unmarshaler, yaml.Unmarshaler, fmt.Stringer, agent.Sortable

func FromString

func FromString(source string) (PluginID, error)

FromString creates a PluginID from a category/term string, returning error if it is not properly formatted

func NewDefaultInventoryPluginID

func NewDefaultInventoryPluginID(term string) PluginID

NewDefaultInventoryPluginID creates a PluginID using default inventory category

func NewPluginID

func NewPluginID(category, term string) *PluginID

NewPluginID creates a new PluginID.

func (PluginID) MarshalJSON

func (p PluginID) MarshalJSON() ([]byte, error)

MarshallJSON creates a JSON `category/term` string representation

func (PluginID) SortKey

func (p PluginID) SortKey() string

SortKey returns the "category/term" string representation of the PluginID, ready to be used as a sorting key

func (PluginID) String

func (p PluginID) String() string

String returns the "category/term" string representation of the PluginID

func (*PluginID) UnmarshalJSON

func (p *PluginID) UnmarshalJSON(field []byte) error

UnmarshallJSON creates a PluginID from its JSON `category/term` string representation

func (*PluginID) UnmarshalYAML

func (p *PluginID) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML populates the PluginID given the yaml.Unmarshaler interface

Jump to

Keyboard shortcuts

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