drvinfo

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 8, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GetDriverInfo = func(name string) (*DriverInfo, error) {
	ethHandle, err := newEthtool()
	if err != nil {
		return nil, err
	}
	defer ethHandle.Close()
	drvInfo, err := ethHandle.DriverInfo(name)
	if err != nil {
		return nil, err
	}
	return &DriverInfo{
		Name:    drvInfo.Driver,
		Version: drvInfo.Version,
	}, nil
}
View Source
var NewSupportedDrivers = func(fp string) SupportedDrivers {
	retv := SupportedDrivers{}
	supportedDrivers, err := readSupportedDrivers(fp)
	if err != nil {
		log.Printf("fetching supported drivers list from %s failed with error %v", fp, err)
		return retv
	}
	retv.Drivers = *supportedDrivers
	retv.DbFilePath = fp
	return retv
}

Functions

This section is empty.

Types

type DriverInfo

type DriverInfo struct {
	Name    string
	Version string
}

type DriversList

type DriversList struct {
	Drivers []DriverInfo
}

type SupportedDrivers

type SupportedDrivers struct {
	Drivers    DriversList
	DbFilePath string
}

func (*SupportedDrivers) IsDriverSupported

func (dl *SupportedDrivers) IsDriverSupported(drv *DriverInfo) bool

Jump to

Keyboard shortcuts

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