coresmd

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2025 License: MIT Imports: 24 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Plugin = plugins.Plugin{
	Name:   "coresmd",
	Setup6: setup6,
	Setup4: setup4,
}

Functions

func Handler4

func Handler4(req, resp *dhcpv4.DHCPv4) (*dhcpv4.DHCPv4, bool)

Types

type Cache

type Cache struct {
	Client      *SmdClient
	Duration    time.Duration
	LastUpdated time.Time
	Mutex       sync.RWMutex

	EthernetInterfaces map[string]EthernetInterface
	Components         map[string]Component
}

func NewCache

func NewCache(duration string, client *SmdClient) (*Cache, error)

func (*Cache) Refresh

func (c *Cache) Refresh() error

func (*Cache) RefreshLoop

func (c *Cache) RefreshLoop()

type Component

type Component struct {
	ID   string `json:"ID"`
	NID  int64  `json:"NID"`
	Type string `json:"Type"`
}

type EthernetInterface

type EthernetInterface struct {
	MACAddress  string `json:"MACAddress"`
	ComponentID string `json:"ComponentID"`
	Type        string `json:"Type"`
	Description string `json:"Description"`
	IPAddresses []struct {
		IPAddress string `json:"IPAddress"`
	} `json:"IPAddresses"`
}

type IfaceInfo

type IfaceInfo struct {
	CompID  string
	CompNID int64
	Type    string
	MAC     string
	IPList  []net.IP
}

type ScriptReader

type ScriptReader struct{}

func (ScriptReader) Read

func (sr ScriptReader) Read(b []byte) (int, error)

type SmdClient

type SmdClient struct {
	*http.Client
	BaseURL *url.URL
}

func NewSmdClient

func NewSmdClient(baseURL *url.URL) *SmdClient

func (*SmdClient) APIGet

func (sc *SmdClient) APIGet(path string) ([]byte, error)

func (*SmdClient) UseCACert

func (sc *SmdClient) UseCACert(path string) error

Jump to

Keyboard shortcuts

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