bmc

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BMC

type BMC struct {
	MAC        MACAddress             `json:"mac"`
	IP         net.IP                 `json:"ip"`
	Credential *credential.Credential `json:"credential"`
}

BMC specifies the information for a BMC which includes MAC address, IP address, and access credential.

func New

func New(s string, cred *credential.Credential, ip string) (*BMC, error)

New creates a new BMC instance with the given MAC address, credential and IP address.

func (*BMC) Patch

func (b *BMC) Patch(nb BMC) bool

Patch updates the BMC instance with the values from another BMC instance.

func (*BMC) SetCredential

func (b *BMC) SetCredential(cred *credential.Credential)

SetCredential sets the credential for the BMC.

func (*BMC) SetIP

func (b *BMC) SetIP(ip string)

SetIP sets the IP address for the BMC.

type MACAddress added in v1.3.0

type MACAddress struct {
	net.HardwareAddr
}

MACAddress wraps net.HardwareAddr and implements encoding.TextMarshaler and encoding.TextUnmarshaler so that JSON serialization produces the human-readable colon-separated MAC address string (e.g. "aa:bb:cc:dd:ee:ff") rather than a base64-encoded byte array.

func (MACAddress) MarshalText added in v1.3.0

func (m MACAddress) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler.

func (*MACAddress) UnmarshalText added in v1.3.0

func (m *MACAddress) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler.

Jump to

Keyboard shortcuts

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