communicator

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2020 License: BSD-2-Clause Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MatchDeviceClass

func MatchDeviceClass(ctx context.Context, identifier string) (bool, error)

MatchDeviceClass checks if the device class in the context matches the given identifier

Types

type Condition

type Condition struct {
	Type      string    `yaml:"type"`
	MatchMode matchMode `yaml:"match_mode" mapstructure:"match_mode"`
	Value     []string  `yaml:"values" mapstructure:"values"`
}

Condition is a single condition.

type ConditionSet

type ConditionSet struct {
	LogicalOperator logicalOperator
	Conditions      []condition
}

ConditionSet defines a set of conditions.

type HTTPCondition

type HTTPCondition struct {
	Condition `yaml:",inline" mapstructure:",squash"`
	URI       string
}

HTTPCondition is a condition based on http.

type ModelCondition

type ModelCondition struct {
	Condition `yaml:",inline" mapstructure:",squash"`
}

ModelCondition is a condition based on a model.

type ModelSeriesCondition

type ModelSeriesCondition struct {
	Condition `yaml:",inline" mapstructure:",squash"`
}

ModelSeriesCondition is a condition based on a model series.

type NetworkDeviceCommunicator

type NetworkDeviceCommunicator interface {
	GetDeviceClass() string
	GetAvailableComponents() []string
	GetIdentifyProperties(ctx context.Context) (device.Properties, error)
	GetUPSComponent(ctx context.Context) (device.UPSComponent, error)
	// contains filtered or unexported methods
}

NetworkDeviceCommunicator represents a communicator for a device

func CreateNetworkDeviceCommunicator

func CreateNetworkDeviceCommunicator(ctx context.Context, deviceClassIdentifier string) (NetworkDeviceCommunicator, error)

CreateNetworkDeviceCommunicator creates a communicator.

func IdentifyNetworkDeviceCommunicator

func IdentifyNetworkDeviceCommunicator(ctx context.Context) (NetworkDeviceCommunicator, error)

IdentifyNetworkDeviceCommunicator identifies a devices and creates a network device communicator

type SnmpCondition

type SnmpCondition struct {
	Condition                    `yaml:",inline" mapstructure:",squash"`
	network.SNMPGetConfiguration `yaml:",inline" mapstructure:",squash"`
}

SnmpCondition is a condition based on snmp.

type VendorCondition

type VendorCondition struct {
	Condition `yaml:",inline" mapstructure:",squash"`
}

VendorCondition is a condition based on a vendor.

Jump to

Keyboard shortcuts

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