storage

package
v0.0.0-...-1e40bc2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DbDevice

type DbDevice struct {
	Id           string      `json:"id,omitempty"`
	Policy       string      `json:"policy,omitempty"`
	Config       interface{} `json:"config,omitempty"`
	SerialNumber string      `json:"serialNumber"`
	Namespace    string      `json:"namespace"`
	Hostname     string      `json:"hostname"`
	Address      string      `json:"address"`
	Model        string      `json:"model"`
	State        string      `json:"state"`
	Vendor       string      `json:"vendor"`
	Os           string      `json:"os"`
	NetboxRefId  int64       `json:"netbox_id,omitempty"`
	Blob         string      `json:"blob,omitempty"`
}

type DbInterface

type DbInterface struct {
	Id          string      `json:"id,omitempty"`
	Policy      string      `json:"policy,omitempty"`
	Config      interface{} `json:"config,omitempty"`
	Namespace   string      `json:"namespace"`
	Hostname    string      `json:"hostname"`
	Name        string      `json:"ifname"`
	AdminState  string      `json:"adminState"`
	Mtu         int64       `json:"mtu"`
	Speed       int64       `json:"speed"`
	MacAddress  string      `json:"macaddr"`
	IfType      string      `json:"type"`
	IpAddresses []IpAddress `json:"ip_addresses,omitempty"`
	NetboxRefId int64       `json:"netbox_id,omitempty"`
	Blob        string      `json:"blob,omitempty"`
}

type DbInventory

type DbInventory struct {
	Id          string      `json:"id,omitempty"`
	Policy      string      `json:"policy,omitempty"`
	Config      interface{} `json:"config,omitempty"`
	Namespace   string      `json:"namespace"`
	Hostname    string      `json:"hostname"`
	Name        string      `json:"name"`
	Descr       string      `json:"descr"`
	Vendor      string      `json:"vendor"`
	Serial      string      `json:"serial"`
	PartNum     string      `json:"partNum"`
	Type        string      `json:"type"`
	NetboxRefId int64       `json:"netbox_id,omitempty"`
	Blob        string      `json:"blob,omitempty"`
}

type DbVlan

type DbVlan struct {
	Id          string      `json:"id,omitempty"`
	Policy      string      `json:"policy,omitempty"`
	Config      interface{} `json:"config,omitempty"`
	Namespace   string      `json:"namespace"`
	Hostname    string      `json:"hostname"`
	Name        string      `json:"vlanName"`
	State       string      `json:"state"`
	NetboxRefId int64       `json:"netbox_id,omitempty"`
	Blob        string      `json:"blob,omitempty"`
}

type IpAddress

type IpAddress struct {
	Address string `json:"address"`
	Type    string `json:"type"`
}

type Service

type Service interface {
	Save(policy string, jsonData map[string]interface{}) (interface{}, error)
	UpdateInterface(id string, netboxId int64) (DbInterface, error)
	UpdateDevice(id string, netboxId int64) (DbDevice, error)
	UpdateVlan(id string, netboxId int64) (DbVlan, error)
	UpdateInventory(id string, netboxId int64) (DbInventory, error)
	GetInterfacesByName(name string) ([]DbInterface, error)
	GetInterfaceByPolicyAndNamespaceAndHostname(policy, namespace, hostname string) ([]DbInterface, error)
	GetDevicesByHostname(hostname string) ([]DbDevice, error)
	GetDevicesByPolicyAndNamespace(policy, namespace string) ([]DbDevice, error)
	GetDeviceByPolicyAndNamespaceAndHostname(policy, namespace, hostname string) (DbDevice, error)
	GetVlansByPolicyAndNamespaceAndHostname(policy, namespace, hostname string) ([]DbVlan, error)
	GetInventoriesByPolicyAndNamespaceAndHostname(policy, namespace, hostname string) ([]DbInventory, error)
	GetInventoriesByName(name string) ([]DbInventory, error)
}

func NewSqliteStorage

func NewSqliteStorage(logger *zap.Logger) (Service, error)

Jump to

Keyboard shortcuts

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