pmc

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PMC

type PMC struct {
	MAC        net.HardwareAddr       `json:"mac"`
	IP         net.IP                 `json:"ip"`
	Vendor     vendor.Vendor          `json:"vendor"`
	Credential *credential.Credential `json:"credential"`
}

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

func New

func New(mac string, ip string, v vendor.VendorCode, cred *credential.Credential) (*PMC, error)

New creates a new PMC instance by parsing MAC and IP from strings. Use this at API boundaries (gRPC, REST) where addresses come as strings. For internal use with already-parsed addresses, prefer NewFromAddr.

func NewFromAddr

func NewFromAddr(mac net.HardwareAddr, ip net.IP, v vendor.VendorCode, cred *credential.Credential) (*PMC, error)

NewFromAddr creates a new PMC instance from native net.HardwareAddr and net.IP types. This is the preferred constructor for internal use where addresses are already parsed.

func (*PMC) GetCredential

func (pmc *PMC) GetCredential() *credential.Credential

GetCredential returns the PMC credential or nil.

func (*PMC) GetIp

func (pmc *PMC) GetIp() net.IP

GetIp returns the PMC IP address.

func (*PMC) GetMac

func (pmc *PMC) GetMac() net.HardwareAddr

GetMac returns the PMC MAC address.

func (*PMC) GetVendor

func (pmc *PMC) GetVendor() vendor.Vendor

GetVendor returns the PMC vendor.

func (*PMC) Patch

func (pmc *PMC) Patch(to PMC) bool

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

func (*PMC) SetCredential

func (pmc *PMC) SetCredential(cred *credential.Credential)

SetCredential sets the credential for the PMC.

func (*PMC) SetIP

func (pmc *PMC) SetIP(ip string)

SetIP sets the IP address for the PMC.

func (*PMC) SetVendor

func (pmc *PMC) SetVendor(v vendor.VendorCode) error

SetVendor sets the Vendor for the PMC.

Jump to

Keyboard shortcuts

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