types

package
Version: v3.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MPL-2.0 Imports: 5 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	LMClient  *client.LMSdkGo
	K8sClient *kubernetes.Clientset
	Config    *config.Config
}

Base is a struct for embedding

type DeviceBuilder

type DeviceBuilder interface {
	// Name sets the device name.
	Name(string) DeviceOption
	// DisplayName sets the device name.
	DisplayName(string) DeviceOption
	// CollectorID sets the preferred collector ID for the device.
	CollectorID(int32) DeviceOption
	// SystemCategories sets the system.categories property on the device.
	SystemCategories(string) DeviceOption
	// ResourceLabels sets custom properties for the device
	ResourceLabels(map[string]string) DeviceOption
	// Auto adds an auto property to the device.
	Auto(string, string) DeviceOption
	// System adds a system property to the device.
	System(string, string) DeviceOption
	// System adds a custom property to the device.
	Custom(string, string) DeviceOption
}

DeviceBuilder is the interface responsible for building a device struct.

type DeviceManager

type DeviceManager interface {
	DeviceMapper
	DeviceBuilder
}

DeviceManager is an interface that describes how resources in Kubernetes are mapped into LogicMonitor as devices.

type DeviceMapper

type DeviceMapper interface {
	// Config returns the Argus config.
	Config() *config.Config
	// FindByDisplayName searches for a device by it's display name. It will return a device if and only if
	// one device was found, and return nil otherwise.
	FindByDisplayName(string) (*models.Device, error)
	// FindByDisplayNames searches for devices by the specified string by its display name. It will return the device list.
	FindByDisplayNames(...string) ([]*models.Device, error)
	// FindByDisplayNameAndClusterName searches for device by the specified string by its display name and clusterName. It will return a device if and only if
	FindByDisplayNameAndClusterName(string) (*models.Device, error)
	// Add adds a device to a LogicMonitor account.
	Add(...DeviceOption) (*models.Device, error)
	// UpdateAndReplace updates a device using the 'replace' OpType.
	UpdateAndReplace(*models.Device, ...DeviceOption) (*models.Device, error)
	// UpdateAndReplaceByDisplayName updates a device using the 'replace' OpType if and onlt if it does not already exist.
	UpdateAndReplaceByDisplayName(string, ...DeviceOption) (*models.Device, error)
	// UpdateAndReplaceField updates a device using the 'replace' OpType for a
	// specific field of a device.
	UpdateAndReplaceField(*models.Device, string, ...DeviceOption) (*models.Device, error)
	// UpdateAndReplaceFieldByDisplayName updates a device using the 'replace' OpType for a
	// specific field of a device.
	UpdateAndReplaceFieldByDisplayName(string, string, ...DeviceOption) (*models.Device, error)
	// DeleteByID deletes a device by device ID.
	DeleteByID(int32) error
	// DeleteByDisplayName deletes a device by device display name.
	DeleteByDisplayName(string) error
}

DeviceMapper is the interface responsible for mapping a Kubernetes resource to a LogicMonitor device.

type DeviceOption

type DeviceOption func(*models.Device)

DeviceOption is the function definition for the functional options pattern.

type Watcher

type Watcher interface {
	APIVersion() string
	Enabled() bool
	Resource() string
	ObjType() runtime.Object
	AddFunc() func(obj interface{})
	DeleteFunc() func(obj interface{})
	UpdateFunc() func(oldObj, newObj interface{})
}

Watcher is the LogicMonitor Watcher interface.

Source Files

Jump to

Keyboard shortcuts

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