inventory

package
v0.31.9 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Overview

Code generated, do not edit

Code generated, do not edit

Code generated, do not edit

Code generated, do not edit

Code generated, do not edit

Index

Constants

This section is empty.

Variables

View Source
var File_modules_inventory_inventory_proto protoreflect.FileDescriptor
View Source
var Inventory_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "inventory.Inventory",
	HandlerType: (*InventoryServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListNetworkHosts",
			Handler:       _Inventory_ListNetworkHosts_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ListNetworkIDs",
			Handler:       _Inventory_ListNetworkIDs_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "ListZigbeeDevices",
			Handler:       _Inventory_ListZigbeeDevices_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "modules/inventory/inventory.proto",
}

Inventory_ServiceDesc is the grpc.ServiceDesc for Inventory service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func NewLDAPClient

func NewLDAPClient(cfg Config, logger log.Logger) (*ldap.Conn, error)

NewLDAPClient constructs an LDAP client to return.

func PublicKeyFile

func PublicKeyFile(file string) ssh.AuthMethod

PublicKeyFile builds the AuthMethod for SSH.

func RegisterInventoryServer

func RegisterInventoryServer(s grpc.ServiceRegistrar, srv InventoryServer)

func SSHAgent

func SSHAgent() ssh.AuthMethod

SSHAgent builds the AuthMethod for SSH.

Types

type Config

type Config struct {
	LDAP LDAPConfig `yaml:"ldap,omitempty"`
}

Config is the client configuration for LDAP.

type Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

func (*Empty) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type IOTDevice

type IOTDevice struct {
	Name            string               `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	DeviceDiscovery *iot.DeviceDiscovery `protobuf:"bytes,2,opt,name=device_discovery,json=deviceDiscovery,proto3" json:"device_discovery,omitempty"`
	NetworkId       *NetworkID           `protobuf:"bytes,3,opt,name=network_id,json=networkId,proto3" json:"network_id,omitempty"`
	// contains filtered or unexported fields
}

func (*IOTDevice) Descriptor deprecated

func (*IOTDevice) Descriptor() ([]byte, []int)

Deprecated: Use IOTDevice.ProtoReflect.Descriptor instead.

func (*IOTDevice) GetDeviceDiscovery

func (x *IOTDevice) GetDeviceDiscovery() *iot.DeviceDiscovery

func (*IOTDevice) GetName

func (x *IOTDevice) GetName() string

func (*IOTDevice) GetNetworkId

func (x *IOTDevice) GetNetworkId() *NetworkID

func (*IOTDevice) ProtoMessage

func (*IOTDevice) ProtoMessage()

func (*IOTDevice) ProtoReflect

func (x *IOTDevice) ProtoReflect() protoreflect.Message

func (*IOTDevice) Reset

func (x *IOTDevice) Reset()

func (*IOTDevice) String

func (x *IOTDevice) String() string

type IOTZone

type IOTZone struct {
	Name        string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Dn          string `protobuf:"bytes,3,opt,name=dn,proto3" json:"dn,omitempty"`
	// contains filtered or unexported fields
}

func (*IOTZone) Descriptor deprecated

func (*IOTZone) Descriptor() ([]byte, []int)

Deprecated: Use IOTZone.ProtoReflect.Descriptor instead.

func (*IOTZone) GetDescription

func (x *IOTZone) GetDescription() string

func (*IOTZone) GetDn

func (x *IOTZone) GetDn() string

func (*IOTZone) GetName

func (x *IOTZone) GetName() string

func (*IOTZone) ProtoMessage

func (*IOTZone) ProtoMessage()

func (*IOTZone) ProtoReflect

func (x *IOTZone) ProtoReflect() protoreflect.Message

func (*IOTZone) Reset

func (x *IOTZone) Reset()

func (*IOTZone) String

func (x *IOTZone) String() string

type Inet6Network

type Inet6Network struct {
	Name    string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Prefix  string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
	Gateway string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
	Dn      string `protobuf:"bytes,4,opt,name=dn,proto3" json:"dn,omitempty"`
	// contains filtered or unexported fields
}

func (*Inet6Network) Descriptor deprecated

func (*Inet6Network) Descriptor() ([]byte, []int)

Deprecated: Use Inet6Network.ProtoReflect.Descriptor instead.

func (*Inet6Network) GetDn

func (x *Inet6Network) GetDn() string

func (*Inet6Network) GetGateway

func (x *Inet6Network) GetGateway() string

func (*Inet6Network) GetName

func (x *Inet6Network) GetName() string

func (*Inet6Network) GetPrefix

func (x *Inet6Network) GetPrefix() string

func (*Inet6Network) ProtoMessage

func (*Inet6Network) ProtoMessage()

func (*Inet6Network) ProtoReflect

func (x *Inet6Network) ProtoReflect() protoreflect.Message

func (*Inet6Network) Reset

func (x *Inet6Network) Reset()

func (*Inet6Network) String

func (x *Inet6Network) String() string

type InetNetwork

type InetNetwork struct {
	Name         string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Prefix       string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
	Gateway      string `protobuf:"bytes,3,opt,name=gateway,proto3" json:"gateway,omitempty"`
	DynamicRange string `protobuf:"bytes,4,opt,name=dynamic_range,json=dynamicRange,proto3" json:"dynamic_range,omitempty"`
	Dn           string `protobuf:"bytes,5,opt,name=dn,proto3" json:"dn,omitempty"`
	// contains filtered or unexported fields
}

func (*InetNetwork) Descriptor deprecated

func (*InetNetwork) Descriptor() ([]byte, []int)

Deprecated: Use InetNetwork.ProtoReflect.Descriptor instead.

func (*InetNetwork) GetDn

func (x *InetNetwork) GetDn() string

func (*InetNetwork) GetDynamicRange

func (x *InetNetwork) GetDynamicRange() string

func (*InetNetwork) GetGateway

func (x *InetNetwork) GetGateway() string

func (*InetNetwork) GetName

func (x *InetNetwork) GetName() string

func (*InetNetwork) GetPrefix

func (x *InetNetwork) GetPrefix() string

func (*InetNetwork) ProtoMessage

func (*InetNetwork) ProtoMessage()

func (*InetNetwork) ProtoReflect

func (x *InetNetwork) ProtoReflect() protoreflect.Message

func (*InetNetwork) Reset

func (x *InetNetwork) Reset()

func (*InetNetwork) String

func (x *InetNetwork) String() string

type Inventory

type Inventory interface {
	UpdateTimestamp(context.Context, string, string) error

	CreateNetworkHost(context.Context, *NetworkHost) (*NetworkHost, error)
	FetchNetworkHost(context.Context, string) (*NetworkHost, error)
	ListNetworkHosts(context.Context) ([]NetworkHost, error)
	UpdateNetworkHost(context.Context, *NetworkHost) (*NetworkHost, error)
	CreateNetworkID(context.Context, *NetworkID) (*NetworkID, error)
	FetchNetworkID(context.Context, string) (*NetworkID, error)
	ListNetworkIDs(context.Context) ([]NetworkID, error)
	UpdateNetworkID(context.Context, *NetworkID) (*NetworkID, error)
	CreateL3Network(context.Context, *L3Network) (*L3Network, error)
	FetchL3Network(context.Context, string) (*L3Network, error)
	ListL3Networks(context.Context) ([]L3Network, error)
	UpdateL3Network(context.Context, *L3Network) (*L3Network, error)
	CreateInetNetwork(context.Context, *InetNetwork) (*InetNetwork, error)
	FetchInetNetwork(context.Context, string) (*InetNetwork, error)
	ListInetNetworks(context.Context) ([]InetNetwork, error)
	UpdateInetNetwork(context.Context, *InetNetwork) (*InetNetwork, error)
	CreateInet6Network(context.Context, *Inet6Network) (*Inet6Network, error)
	FetchInet6Network(context.Context, string) (*Inet6Network, error)
	ListInet6Networks(context.Context) ([]Inet6Network, error)
	UpdateInet6Network(context.Context, *Inet6Network) (*Inet6Network, error)
	CreateZigbeeDevice(context.Context, *ZigbeeDevice) (*ZigbeeDevice, error)
	FetchZigbeeDevice(context.Context, string) (*ZigbeeDevice, error)
	ListZigbeeDevices(context.Context) ([]ZigbeeDevice, error)
	UpdateZigbeeDevice(context.Context, *ZigbeeDevice) (*ZigbeeDevice, error)
	CreateIOTZone(context.Context, *IOTZone) (*IOTZone, error)
	FetchIOTZone(context.Context, string) (*IOTZone, error)
	ListIOTZones(context.Context) ([]IOTZone, error)
	UpdateIOTZone(context.Context, *IOTZone) (*IOTZone, error)
}

Inventory is the interface to implement for CRUD against a data store of network devices.

type InventoryClient

type InventoryClient interface {
	ListNetworkHosts(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Inventory_ListNetworkHostsClient, error)
	ListNetworkIDs(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Inventory_ListNetworkIDsClient, error)
	ListZigbeeDevices(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Inventory_ListZigbeeDevicesClient, error)
}

InventoryClient is the client API for Inventory service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewInventoryClient

func NewInventoryClient(cc grpc.ClientConnInterface) InventoryClient

type InventoryInteractive

type InventoryInteractive struct {
	Inventory Inventory
}

func (*InventoryInteractive) Completer

func (*InventoryInteractive) Executor

func (i *InventoryInteractive) Executor(in string)

type InventoryServer

type InventoryServer interface {
	ListNetworkHosts(*Empty, Inventory_ListNetworkHostsServer) error
	ListNetworkIDs(*Empty, Inventory_ListNetworkIDsServer) error
	ListZigbeeDevices(*Empty, Inventory_ListZigbeeDevicesServer) error
	// contains filtered or unexported methods
}

InventoryServer is the server API for Inventory service. All implementations must embed UnimplementedInventoryServer for forward compatibility

type Inventory_ListNetworkHostsClient

type Inventory_ListNetworkHostsClient interface {
	Recv() (*NetworkHost, error)
	grpc.ClientStream
}

type Inventory_ListNetworkHostsServer

type Inventory_ListNetworkHostsServer interface {
	Send(*NetworkHost) error
	grpc.ServerStream
}

type Inventory_ListNetworkIDsClient

type Inventory_ListNetworkIDsClient interface {
	Recv() (*NetworkID, error)
	grpc.ClientStream
}

type Inventory_ListNetworkIDsServer

type Inventory_ListNetworkIDsServer interface {
	Send(*NetworkID) error
	grpc.ServerStream
}

type Inventory_ListZigbeeDevicesClient

type Inventory_ListZigbeeDevicesClient interface {
	Recv() (*ZigbeeDevice, error)
	grpc.ClientStream
}

type Inventory_ListZigbeeDevicesServer

type Inventory_ListZigbeeDevicesServer interface {
	Send(*ZigbeeDevice) error
	grpc.ServerStream
}

type L3Network

type L3Network struct {
	Name         string          `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Soa          string          `protobuf:"bytes,2,opt,name=soa,proto3" json:"soa,omitempty"`
	Domain       string          `protobuf:"bytes,3,opt,name=domain,proto3" json:"domain,omitempty"`
	NtpServers   []string        `protobuf:"bytes,4,rep,name=ntp_servers,json=ntpServers,proto3" json:"ntp_servers,omitempty"`
	InetNetwork  []*InetNetwork  `protobuf:"bytes,5,rep,name=inet_network,json=inetNetwork,proto3" json:"inet_network,omitempty"`
	Inet6Network []*Inet6Network `protobuf:"bytes,6,rep,name=inet6_network,json=inet6Network,proto3" json:"inet6_network,omitempty"`
	Dn           string          `protobuf:"bytes,7,opt,name=dn,proto3" json:"dn,omitempty"`
	Description  string          `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*L3Network) Descriptor deprecated

func (*L3Network) Descriptor() ([]byte, []int)

Deprecated: Use L3Network.ProtoReflect.Descriptor instead.

func (*L3Network) GetDescription

func (x *L3Network) GetDescription() string

func (*L3Network) GetDn

func (x *L3Network) GetDn() string

func (*L3Network) GetDomain

func (x *L3Network) GetDomain() string

func (*L3Network) GetInet6Network

func (x *L3Network) GetInet6Network() []*Inet6Network

func (*L3Network) GetInetNetwork

func (x *L3Network) GetInetNetwork() []*InetNetwork

func (*L3Network) GetName

func (x *L3Network) GetName() string

func (*L3Network) GetNtpServers

func (x *L3Network) GetNtpServers() []string

func (*L3Network) GetSoa

func (x *L3Network) GetSoa() string

func (*L3Network) ProtoMessage

func (*L3Network) ProtoMessage()

func (*L3Network) ProtoReflect

func (x *L3Network) ProtoReflect() protoreflect.Message

func (*L3Network) Reset

func (x *L3Network) Reset()

func (*L3Network) String

func (x *L3Network) String() string

type LDAPConfig

type LDAPConfig struct {
	BaseDN string `yaml:"basedn"`
	BindDN string `yaml:"binddn"`
	BindPW string `yaml:"bindpw"`
	Host   string `yaml:"host"`
}

type LDAPInventory

type LDAPInventory struct {
	// contains filtered or unexported fields
}

LDAPInventory holds the coniguration and clients necessary to retrieve information from data sources.

func NewLDAPInventory

func NewLDAPInventory(cfg Config, logger log.Logger) (*LDAPInventory, error)

NewLDAPInventory returns a new Inventory object from the received config.

func (*LDAPInventory) CreateIOTZone

func (i *LDAPInventory) CreateIOTZone(ctx context.Context, x *IOTZone) (*IOTZone, error)

CreateIOTZone creates a new LDAP entry by the received name.

func (*LDAPInventory) CreateInet6Network

func (i *LDAPInventory) CreateInet6Network(ctx context.Context, x *Inet6Network) (*Inet6Network, error)

CreateInet6Network creates a new LDAP entry by the received name.

func (*LDAPInventory) CreateInetNetwork

func (i *LDAPInventory) CreateInetNetwork(ctx context.Context, x *InetNetwork) (*InetNetwork, error)

CreateInetNetwork creates a new LDAP entry by the received name.

func (*LDAPInventory) CreateL3Network

func (i *LDAPInventory) CreateL3Network(ctx context.Context, x *L3Network) (*L3Network, error)

CreateL3Network creates a new LDAP entry by the received name.

func (*LDAPInventory) CreateNetworkHost

func (i *LDAPInventory) CreateNetworkHost(ctx context.Context, x *NetworkHost) (*NetworkHost, error)

CreateNetworkHost creates a new LDAP entry by the received name.

func (*LDAPInventory) CreateNetworkID

func (i *LDAPInventory) CreateNetworkID(ctx context.Context, x *NetworkID) (*NetworkID, error)

CreateNetworkID creates a new LDAP entry by the received name.

func (*LDAPInventory) CreateZigbeeDevice

func (i *LDAPInventory) CreateZigbeeDevice(ctx context.Context, x *ZigbeeDevice) (*ZigbeeDevice, error)

CreateZigbeeDevice creates a new LDAP entry by the received name.

func (*LDAPInventory) FetchIOTZone

func (i *LDAPInventory) FetchIOTZone(ctx context.Context, name string) (*IOTZone, error)

FetchIOTZone will retrieve a IOTZone by name.

func (*LDAPInventory) FetchInet6Network

func (i *LDAPInventory) FetchInet6Network(ctx context.Context, name string) (*Inet6Network, error)

FetchInet6Network will retrieve a Inet6Network by name.

func (*LDAPInventory) FetchInetNetwork

func (i *LDAPInventory) FetchInetNetwork(ctx context.Context, name string) (*InetNetwork, error)

FetchInetNetwork will retrieve a InetNetwork by name.

func (*LDAPInventory) FetchL3Network

func (i *LDAPInventory) FetchL3Network(ctx context.Context, name string) (*L3Network, error)

FetchL3Network will retrieve a L3Network by name.

func (*LDAPInventory) FetchNetworkHost

func (i *LDAPInventory) FetchNetworkHost(ctx context.Context, name string) (*NetworkHost, error)

FetchNetworkHost will retrieve a NetworkHost by name.

func (*LDAPInventory) FetchNetworkID

func (i *LDAPInventory) FetchNetworkID(ctx context.Context, name string) (*NetworkID, error)

FetchNetworkID will retrieve a NetworkID by name.

func (*LDAPInventory) FetchZigbeeDevice

func (i *LDAPInventory) FetchZigbeeDevice(ctx context.Context, name string) (*ZigbeeDevice, error)

FetchZigbeeDevice will retrieve a ZigbeeDevice by name.

func (*LDAPInventory) ListIOTZones

func (i *LDAPInventory) ListIOTZones(ctx context.Context) ([]IOTZone, error)

ListIOTZones retrieves all existing LDAP entries. nolint:gocyclo

func (*LDAPInventory) ListInet6Networks

func (i *LDAPInventory) ListInet6Networks(ctx context.Context) ([]Inet6Network, error)

ListInet6Networks retrieves all existing LDAP entries. nolint:gocyclo

func (*LDAPInventory) ListInetNetworks

func (i *LDAPInventory) ListInetNetworks(ctx context.Context) ([]InetNetwork, error)

ListInetNetworks retrieves all existing LDAP entries. nolint:gocyclo

func (*LDAPInventory) ListL3Networks

func (i *LDAPInventory) ListL3Networks(ctx context.Context) ([]L3Network, error)

ListL3Networks retrieves all existing LDAP entries. nolint:gocyclo

func (*LDAPInventory) ListNetworkHosts

func (i *LDAPInventory) ListNetworkHosts(ctx context.Context) ([]NetworkHost, error)

ListNetworkHosts retrieves all existing LDAP entries. nolint:gocyclo

func (*LDAPInventory) ListNetworkIDs

func (i *LDAPInventory) ListNetworkIDs(ctx context.Context) ([]NetworkID, error)

ListNetworkIDs retrieves all existing LDAP entries. nolint:gocyclo

func (*LDAPInventory) ListZigbeeDevices

func (i *LDAPInventory) ListZigbeeDevices(ctx context.Context) ([]ZigbeeDevice, error)

ListZigbeeDevices retrieves all existing LDAP entries. nolint:gocyclo

func (*LDAPInventory) SetAttribute

func (i *LDAPInventory) SetAttribute(ctx context.Context, dn, attributeName, attributeValue string, replace bool) error

func (*LDAPInventory) Stop

func (i *LDAPInventory) Stop()

func (*LDAPInventory) UpdateIOTZone

func (i *LDAPInventory) UpdateIOTZone(ctx context.Context, x *IOTZone) (*IOTZone, error)

UpdateIOTZone updates an existing LDAP entry, retrieved by name.

func (*LDAPInventory) UpdateInet6Network

func (i *LDAPInventory) UpdateInet6Network(ctx context.Context, x *Inet6Network) (*Inet6Network, error)

UpdateInet6Network updates an existing LDAP entry, retrieved by name.

func (*LDAPInventory) UpdateInetNetwork

func (i *LDAPInventory) UpdateInetNetwork(ctx context.Context, x *InetNetwork) (*InetNetwork, error)

UpdateInetNetwork updates an existing LDAP entry, retrieved by name.

func (*LDAPInventory) UpdateL3Network

func (i *LDAPInventory) UpdateL3Network(ctx context.Context, x *L3Network) (*L3Network, error)

UpdateL3Network updates an existing LDAP entry, retrieved by name.

func (*LDAPInventory) UpdateNetworkHost

func (i *LDAPInventory) UpdateNetworkHost(ctx context.Context, x *NetworkHost) (*NetworkHost, error)

UpdateNetworkHost updates an existing LDAP entry, retrieved by name.

func (*LDAPInventory) UpdateNetworkID

func (i *LDAPInventory) UpdateNetworkID(ctx context.Context, x *NetworkID) (*NetworkID, error)

UpdateNetworkID updates an existing LDAP entry, retrieved by name.

func (*LDAPInventory) UpdateTimestamp

func (i *LDAPInventory) UpdateTimestamp(ctx context.Context, dn string, object string) error

func (*LDAPInventory) UpdateZigbeeDevice

func (i *LDAPInventory) UpdateZigbeeDevice(ctx context.Context, x *ZigbeeDevice) (*ZigbeeDevice, error)

UpdateZigbeeDevice updates an existing LDAP entry, retrieved by name.

type MockInventory

type MockInventory struct {
	FetchNetworkHostCalls      map[string]int
	FetchNetworkHostResponse   *NetworkHost
	FetchNetworkHostErr        error
	ListNetworkHostResponse    []NetworkHost
	ListNetworkHostErr         error
	CreateNetworkHostCalls     map[string]int
	UpdateNetworkHostCalls     map[string]int
	UpdateNetworkHostResponse  *NetworkHost
	UpdateNetworkHostErr       error
	FetchNetworkIDCalls        map[string]int
	FetchNetworkIDResponse     *NetworkID
	FetchNetworkIDErr          error
	ListNetworkIDResponse      []NetworkID
	ListNetworkIDErr           error
	CreateNetworkIDCalls       map[string]int
	UpdateNetworkIDCalls       map[string]int
	UpdateNetworkIDResponse    *NetworkID
	UpdateNetworkIDErr         error
	FetchL3NetworkCalls        map[string]int
	FetchL3NetworkResponse     *L3Network
	FetchL3NetworkErr          error
	ListL3NetworkResponse      []L3Network
	ListL3NetworkErr           error
	CreateL3NetworkCalls       map[string]int
	UpdateL3NetworkCalls       map[string]int
	UpdateL3NetworkResponse    *L3Network
	UpdateL3NetworkErr         error
	FetchInetNetworkCalls      map[string]int
	FetchInetNetworkResponse   *InetNetwork
	FetchInetNetworkErr        error
	ListInetNetworkResponse    []InetNetwork
	ListInetNetworkErr         error
	CreateInetNetworkCalls     map[string]int
	UpdateInetNetworkCalls     map[string]int
	UpdateInetNetworkResponse  *InetNetwork
	UpdateInetNetworkErr       error
	FetchInet6NetworkCalls     map[string]int
	FetchInet6NetworkResponse  *Inet6Network
	FetchInet6NetworkErr       error
	ListInet6NetworkResponse   []Inet6Network
	ListInet6NetworkErr        error
	CreateInet6NetworkCalls    map[string]int
	UpdateInet6NetworkCalls    map[string]int
	UpdateInet6NetworkResponse *Inet6Network
	UpdateInet6NetworkErr      error
	FetchZigbeeDeviceCalls     map[string]int
	FetchZigbeeDeviceResponse  *ZigbeeDevice
	FetchZigbeeDeviceErr       error
	ListZigbeeDeviceResponse   []ZigbeeDevice
	ListZigbeeDeviceErr        error
	CreateZigbeeDeviceCalls    map[string]int
	UpdateZigbeeDeviceCalls    map[string]int
	UpdateZigbeeDeviceResponse *ZigbeeDevice
	UpdateZigbeeDeviceErr      error
	FetchIOTZoneCalls          map[string]int
	FetchIOTZoneResponse       *IOTZone
	FetchIOTZoneErr            error
	ListIOTZoneResponse        []IOTZone
	ListIOTZoneErr             error
	CreateIOTZoneCalls         map[string]int
	UpdateIOTZoneCalls         map[string]int
	UpdateIOTZoneResponse      *IOTZone
	UpdateIOTZoneErr           error
}

func (*MockInventory) CreateIOTZone

func (i *MockInventory) CreateIOTZone(_ context.Context, x *IOTZone) (*IOTZone, error)

func (*MockInventory) CreateInet6Network

func (i *MockInventory) CreateInet6Network(_ context.Context, x *Inet6Network) (*Inet6Network, error)

func (*MockInventory) CreateInetNetwork

func (i *MockInventory) CreateInetNetwork(_ context.Context, x *InetNetwork) (*InetNetwork, error)

func (*MockInventory) CreateL3Network

func (i *MockInventory) CreateL3Network(_ context.Context, x *L3Network) (*L3Network, error)

func (*MockInventory) CreateNetworkHost

func (i *MockInventory) CreateNetworkHost(_ context.Context, x *NetworkHost) (*NetworkHost, error)

func (*MockInventory) CreateNetworkID

func (i *MockInventory) CreateNetworkID(_ context.Context, x *NetworkID) (*NetworkID, error)

func (*MockInventory) CreateZigbeeDevice

func (i *MockInventory) CreateZigbeeDevice(_ context.Context, x *ZigbeeDevice) (*ZigbeeDevice, error)

func (*MockInventory) FetchIOTZone

func (i *MockInventory) FetchIOTZone(_ context.Context, name string) (*IOTZone, error)

func (*MockInventory) FetchInet6Network

func (i *MockInventory) FetchInet6Network(_ context.Context, name string) (*Inet6Network, error)

func (*MockInventory) FetchInetNetwork

func (i *MockInventory) FetchInetNetwork(_ context.Context, name string) (*InetNetwork, error)

func (*MockInventory) FetchL3Network

func (i *MockInventory) FetchL3Network(_ context.Context, name string) (*L3Network, error)

func (*MockInventory) FetchNetworkHost

func (i *MockInventory) FetchNetworkHost(_ context.Context, name string) (*NetworkHost, error)

func (*MockInventory) FetchNetworkID

func (i *MockInventory) FetchNetworkID(_ context.Context, name string) (*NetworkID, error)

func (*MockInventory) FetchZigbeeDevice

func (i *MockInventory) FetchZigbeeDevice(_ context.Context, name string) (*ZigbeeDevice, error)

func (*MockInventory) ListIOTZones

func (i *MockInventory) ListIOTZones(_ context.Context) ([]IOTZone, error)

func (*MockInventory) ListInet6Networks

func (i *MockInventory) ListInet6Networks(_ context.Context) ([]Inet6Network, error)

func (*MockInventory) ListInetNetworks

func (i *MockInventory) ListInetNetworks(_ context.Context) ([]InetNetwork, error)

func (*MockInventory) ListL3Networks

func (i *MockInventory) ListL3Networks(_ context.Context) ([]L3Network, error)

func (*MockInventory) ListNetworkHosts

func (i *MockInventory) ListNetworkHosts(_ context.Context) ([]NetworkHost, error)

func (*MockInventory) ListNetworkIDs

func (i *MockInventory) ListNetworkIDs(_ context.Context) ([]NetworkID, error)

func (*MockInventory) ListZigbeeDevices

func (i *MockInventory) ListZigbeeDevices(_ context.Context) ([]ZigbeeDevice, error)

func (*MockInventory) UpdateIOTZone

func (i *MockInventory) UpdateIOTZone(_ context.Context, x *IOTZone) (*IOTZone, error)

func (*MockInventory) UpdateInet6Network

func (i *MockInventory) UpdateInet6Network(_ context.Context, x *Inet6Network) (*Inet6Network, error)

func (*MockInventory) UpdateInetNetwork

func (i *MockInventory) UpdateInetNetwork(_ context.Context, x *InetNetwork) (*InetNetwork, error)

func (*MockInventory) UpdateL3Network

func (i *MockInventory) UpdateL3Network(_ context.Context, x *L3Network) (*L3Network, error)

func (*MockInventory) UpdateNetworkHost

func (i *MockInventory) UpdateNetworkHost(_ context.Context, x *NetworkHost) (*NetworkHost, error)

func (*MockInventory) UpdateNetworkID

func (i *MockInventory) UpdateNetworkID(_ context.Context, x *NetworkID) (*NetworkID, error)

func (*MockInventory) UpdateTimestamp

func (i *MockInventory) UpdateTimestamp(context.Context, string, string) error

func (*MockInventory) UpdateZigbeeDevice

func (i *MockInventory) UpdateZigbeeDevice(_ context.Context, x *ZigbeeDevice) (*ZigbeeDevice, error)

type NetworkHost

type NetworkHost struct {
	Role            string                 `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
	Group           string                 `protobuf:"bytes,2,opt,name=group,proto3" json:"group,omitempty"`
	Name            string                 `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	OperatingSystem string                 `protobuf:"bytes,4,opt,name=operating_system,json=operatingSystem,proto3" json:"operating_system,omitempty"`
	Platform        string                 `protobuf:"bytes,5,opt,name=platform,proto3" json:"platform,omitempty"`
	Type            string                 `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"`
	Domain          string                 `protobuf:"bytes,7,opt,name=domain,proto3" json:"domain,omitempty"`
	Description     string                 `protobuf:"bytes,8,opt,name=description,proto3" json:"description,omitempty"`
	Watch           bool                   `protobuf:"varint,9,opt,name=watch,proto3" json:"watch,omitempty"`
	InetAddress     []string               `protobuf:"bytes,10,rep,name=inet_address,json=inetAddress,proto3" json:"inet_address,omitempty"`
	Inet6Address    []string               `protobuf:"bytes,11,rep,name=inet6_address,json=inet6Address,proto3" json:"inet6_address,omitempty"`
	MacAddress      []string               `protobuf:"bytes,12,rep,name=mac_address,json=macAddress,proto3" json:"mac_address,omitempty"`
	LastSeen        *timestamppb.Timestamp `protobuf:"bytes,13,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"`
	Dn              string                 `protobuf:"bytes,14,opt,name=dn,proto3" json:"dn,omitempty"`
	// contains filtered or unexported fields
}

NetworkHost is the information about any host that is attached to the network.

func (*NetworkHost) Descriptor deprecated

func (*NetworkHost) Descriptor() ([]byte, []int)

Deprecated: Use NetworkHost.ProtoReflect.Descriptor instead.

func (*NetworkHost) GetDescription

func (x *NetworkHost) GetDescription() string

func (*NetworkHost) GetDn

func (x *NetworkHost) GetDn() string

func (*NetworkHost) GetDomain

func (x *NetworkHost) GetDomain() string

func (*NetworkHost) GetGroup

func (x *NetworkHost) GetGroup() string

func (*NetworkHost) GetInet6Address

func (x *NetworkHost) GetInet6Address() []string

func (*NetworkHost) GetInetAddress

func (x *NetworkHost) GetInetAddress() []string

func (*NetworkHost) GetLastSeen

func (x *NetworkHost) GetLastSeen() *timestamppb.Timestamp

func (*NetworkHost) GetMacAddress

func (x *NetworkHost) GetMacAddress() []string

func (*NetworkHost) GetName

func (x *NetworkHost) GetName() string

func (*NetworkHost) GetOperatingSystem

func (x *NetworkHost) GetOperatingSystem() string

func (*NetworkHost) GetPlatform

func (x *NetworkHost) GetPlatform() string

func (*NetworkHost) GetRole

func (x *NetworkHost) GetRole() string

func (*NetworkHost) GetType

func (x *NetworkHost) GetType() string

func (*NetworkHost) GetWatch

func (x *NetworkHost) GetWatch() bool

func (*NetworkHost) ProtoMessage

func (*NetworkHost) ProtoMessage()

func (*NetworkHost) ProtoReflect

func (x *NetworkHost) ProtoReflect() protoreflect.Message

func (*NetworkHost) Reset

func (x *NetworkHost) Reset()

func (*NetworkHost) String

func (x *NetworkHost) String() string

type NetworkID

type NetworkID struct {
	Name                     string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	MacAddress               []string               `protobuf:"bytes,2,rep,name=mac_address,json=macAddress,proto3" json:"mac_address,omitempty"`
	IpAddress                []string               `protobuf:"bytes,3,rep,name=ip_address,json=ipAddress,proto3" json:"ip_address,omitempty"`
	ReportingSource          []string               `protobuf:"bytes,4,rep,name=reporting_source,json=reportingSource,proto3" json:"reporting_source,omitempty"`
	ReportingSourceInterface []string               `` /* 135-byte string literal not displayed */
	LastSeen                 *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"`
	Dn                       string                 `protobuf:"bytes,7,opt,name=dn,proto3" json:"dn,omitempty"`
	// contains filtered or unexported fields
}

func (*NetworkID) Descriptor deprecated

func (*NetworkID) Descriptor() ([]byte, []int)

Deprecated: Use NetworkID.ProtoReflect.Descriptor instead.

func (*NetworkID) GetDn

func (x *NetworkID) GetDn() string

func (*NetworkID) GetIpAddress

func (x *NetworkID) GetIpAddress() []string

func (*NetworkID) GetLastSeen

func (x *NetworkID) GetLastSeen() *timestamppb.Timestamp

func (*NetworkID) GetMacAddress

func (x *NetworkID) GetMacAddress() []string

func (*NetworkID) GetName

func (x *NetworkID) GetName() string

func (*NetworkID) GetReportingSource

func (x *NetworkID) GetReportingSource() []string

func (*NetworkID) GetReportingSourceInterface

func (x *NetworkID) GetReportingSourceInterface() []string

func (*NetworkID) ProtoMessage

func (*NetworkID) ProtoMessage()

func (*NetworkID) ProtoReflect

func (x *NetworkID) ProtoReflect() protoreflect.Message

func (*NetworkID) Reset

func (x *NetworkID) Reset()

func (*NetworkID) String

func (x *NetworkID) String() string

type Server

type Server struct {
	UnimplementedInventoryServer

	services.Service
	// contains filtered or unexported fields
}

Server

func NewLDAPServer

func NewLDAPServer(cfg Config, logger log.Logger) (*Server, error)

NewServer is used to return a new Server, which implements the inventory RPC server.

func (*Server) ListNetworkHosts

func (e *Server) ListNetworkHosts(req *Empty, stream Inventory_ListNetworkHostsServer) error

.File.Service Inventory

func (*Server) ListNetworkIDs

func (e *Server) ListNetworkIDs(req *Empty, stream Inventory_ListNetworkIDsServer) error

func (*Server) ListZigbeeDevices

func (e *Server) ListZigbeeDevices(req *Empty, stream Inventory_ListZigbeeDevicesServer) error

type UnimplementedInventoryServer

type UnimplementedInventoryServer struct {
}

UnimplementedInventoryServer must be embedded to have forward compatible implementations.

func (UnimplementedInventoryServer) ListNetworkHosts

func (UnimplementedInventoryServer) ListNetworkIDs

func (UnimplementedInventoryServer) ListZigbeeDevices

type UnsafeInventoryServer

type UnsafeInventoryServer interface {
	// contains filtered or unexported methods
}

UnsafeInventoryServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to InventoryServer will result in compilation errors.

type ZigbeeDevice

type ZigbeeDevice struct {
	Name             string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Description      string                 `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	Dn               string                 `protobuf:"bytes,3,opt,name=dn,proto3" json:"dn,omitempty"`
	LastSeen         *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=last_seen,json=lastSeen,proto3" json:"last_seen,omitempty"`
	IotZone          string                 `protobuf:"bytes,5,opt,name=iot_zone,json=iotZone,proto3" json:"iot_zone,omitempty"`
	Type             string                 `protobuf:"bytes,6,opt,name=type,proto3" json:"type,omitempty"`
	SoftwareBuildId  string                 `protobuf:"bytes,7,opt,name=software_build_id,json=softwareBuildId,proto3" json:"software_build_id,omitempty"`
	DateCode         string                 `protobuf:"bytes,8,opt,name=date_code,json=dateCode,proto3" json:"date_code,omitempty"`
	Model            string                 `protobuf:"bytes,9,opt,name=model,proto3" json:"model,omitempty"`
	Vendor           string                 `protobuf:"bytes,10,opt,name=vendor,proto3" json:"vendor,omitempty"`
	ManufacturerName string                 `protobuf:"bytes,11,opt,name=manufacturer_name,json=manufacturerName,proto3" json:"manufacturer_name,omitempty"` // Remove in favor vendor
	PowerSource      string                 `protobuf:"bytes,12,opt,name=power_source,json=powerSource,proto3" json:"power_source,omitempty"`
	ModelId          string                 `protobuf:"bytes,13,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ZigbeeDevice) Descriptor deprecated

func (*ZigbeeDevice) Descriptor() ([]byte, []int)

Deprecated: Use ZigbeeDevice.ProtoReflect.Descriptor instead.

func (*ZigbeeDevice) GetDateCode

func (x *ZigbeeDevice) GetDateCode() string

func (*ZigbeeDevice) GetDescription

func (x *ZigbeeDevice) GetDescription() string

func (*ZigbeeDevice) GetDn

func (x *ZigbeeDevice) GetDn() string

func (*ZigbeeDevice) GetIotZone

func (x *ZigbeeDevice) GetIotZone() string

func (*ZigbeeDevice) GetLastSeen

func (x *ZigbeeDevice) GetLastSeen() *timestamppb.Timestamp

func (*ZigbeeDevice) GetManufacturerName

func (x *ZigbeeDevice) GetManufacturerName() string

func (*ZigbeeDevice) GetModel

func (x *ZigbeeDevice) GetModel() string

func (*ZigbeeDevice) GetModelId

func (x *ZigbeeDevice) GetModelId() string

func (*ZigbeeDevice) GetName

func (x *ZigbeeDevice) GetName() string

func (*ZigbeeDevice) GetPowerSource

func (x *ZigbeeDevice) GetPowerSource() string

func (*ZigbeeDevice) GetSoftwareBuildId

func (x *ZigbeeDevice) GetSoftwareBuildId() string

func (*ZigbeeDevice) GetType

func (x *ZigbeeDevice) GetType() string

func (*ZigbeeDevice) GetVendor

func (x *ZigbeeDevice) GetVendor() string

func (*ZigbeeDevice) ProtoMessage

func (*ZigbeeDevice) ProtoMessage()

func (*ZigbeeDevice) ProtoReflect

func (x *ZigbeeDevice) ProtoReflect() protoreflect.Message

func (*ZigbeeDevice) Reset

func (x *ZigbeeDevice) Reset()

func (*ZigbeeDevice) String

func (x *ZigbeeDevice) String() string

Jump to

Keyboard shortcuts

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