services

package
v0.0.0-...-68594da Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrHostNotFound  = fmt.Errorf("could not find host")
	ErrDuplicateHost = fmt.Errorf("duplicate host")
)

Functions

func Slugify

func Slugify(value string) string

adapted from django slugify: https://github.com/django/django/blob/574ee4023e15cfb195833edfbaed353f8021c62f/django/utils/text.py#L421 converts a string into a url friendly string

func UpdateApplicationGroups

func UpdateApplicationGroups(app *models.App, deviceId int32, existingAppGroups []netbox.ApplicationGroup) []netbox.ApplicationGroup

func UpdateApplicationPorts

func UpdateApplicationPorts(app *models.App, deviceId int32, existingApps []netbox.Application, existingAppPorts []netbox.ApplicationPort) ([]netbox.ApplicationPort, []int32)

func UpdateApplications

func UpdateApplications(app *models.App, deviceId int32, existingAppGroups []netbox.ApplicationGroup, existingApps []netbox.Application) ([]netbox.Application, []int32)

func UpdateDisk

func UpdateDisk(hostDisk models.Disk, deviceId int32, roleId int32, existingDisks []netbox.InventoryItem) ([]netbox.InventoryItem, []int32)

func UpdateIPAddresses

func UpdateIPAddresses(value *models.Host, interfaces []netbox.Interface, existingIps []netbox.IPAddress) ([]netbox.IPAddress, []int32)

func UpdateInterfaces

func UpdateInterfaces(value *models.Host, deviceId int32, existingInterfaces []netbox.Interface) ([]netbox.Interface, []int32)

Types

type Actuator

type Actuator struct {
}

func (*Actuator) Patch

func (a *Actuator) Patch()

type ArgusConfig

type ArgusConfig struct {
	Server string
}

type NetboxConverter

type NetboxConverter struct {
}

func (*NetboxConverter) ConvertHost

func (nc *NetboxConverter) ConvertHost(value *models.Host) *netbox.DeviceWithConfigContext

func (*NetboxConverter) UpdateDevice

func (nc *NetboxConverter) UpdateDevice(value *models.Host, device *netbox.DeviceWithConfigContext)

type Storage

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

func NewStorage

func NewStorage(backend *backend.Backend) *Storage

func (*Storage) AddAgent

func (s *Storage) AddAgent(uuid string, value models.Agent) error

func (*Storage) Get

func (s *Storage) Get(uuid string) (*models.Host, error)

func (*Storage) GetAll

func (s *Storage) GetAll() ([]*models.Host, error)

func (*Storage) Init

func (s *Storage) Init() error

func (*Storage) MakeUpdate

func (s *Storage) MakeUpdate(before, after *models.Host)

func (*Storage) UpdateApp

func (s *Storage) UpdateApp(uuid string, value *models.App) (bool, error)

func (*Storage) UpdateCpu

func (s *Storage) UpdateCpu(uuid string, value *models.Cpu) (bool, error)

func (*Storage) UpdateDevice

func (s *Storage) UpdateDevice(uuid string, value *models.Device) (bool, error)

func (*Storage) UpdateDisk

func (s *Storage) UpdateDisk(uuid string, value *models.Disk) (bool, error)

func (*Storage) UpdateNetwork

func (s *Storage) UpdateNetwork(uuid string, value *models.Network) (bool, error)

func (*Storage) UpdateRam

func (s *Storage) UpdateRam(uuid string, value *models.Ram) (bool, error)

type VersionSearcher

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

func NewSearcher

func NewSearcher(config VersionSearcherConfig) *VersionSearcher

func (*VersionSearcher) Search

func (v *VersionSearcher) Search() error

type VersionSearcherConfig

type VersionSearcherConfig struct {
	Backend *backend.Backend
	Argus   *ArgusConfig
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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