inventory

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

View Source
const (
	BytesMultiplier int64 = 1
	KbMultiplier          = BytesMultiplier << 10
	MbMultiplier          = KbMultiplier << 10
	GbMultiplier          = MbMultiplier << 10
	TbMultiplier          = GbMultiplier << 10
	EbMultiplier          = TbMultiplier << 10
	ZbMultiplier          = EbMultiplier << 10
)
View Source
const MaxIpmiChannel = 12

Variables

This section is empty.

Functions

func CreateInveroryInfo

func CreateInveroryInfo() []byte

func GetBmcAddress

func GetBmcAddress(dependencies IDependencies) string

func GetBmcV6Address

func GetBmcV6Address(dependencies IDependencies) string

func GetBoot

func GetBoot(dependencies IDependencies) *models.Boot

func GetCPU

func GetCPU(dependencies IDependencies) *models.CPU

func GetDisks

func GetDisks(dependencies IDependencies) []*models.Disk

func GetHostname

func GetHostname(dependencies IDependencies) string

func GetInterfaces

func GetInterfaces(depenndecies IDependencies) []*models.Interface

func GetMemory

func GetMemory(dependencies IDependencies) *models.Memory

func GetVendor

func GetVendor(dependencies IDependencies) *models.SystemVendor

func ReadInventory

func ReadInventory() *models.Inventory

Types

type Dependencies

type Dependencies struct{}

func (*Dependencies) Abs

func (d *Dependencies) Abs(path string) (string, error)

func (*Dependencies) Block

func (d *Dependencies) Block(opts ...*ghw.WithOption) (*ghw.BlockInfo, error)
func (d *Dependencies) EvalSymlinks(path string) (string, error)

func (*Dependencies) Execute

func (d *Dependencies) Execute(command string, args ...string) (stdout string, stderr string, exitCode int)

func (*Dependencies) Hostname

func (d *Dependencies) Hostname() (string, error)

func (*Dependencies) Interfaces

func (d *Dependencies) Interfaces() ([]Interface, error)

func (*Dependencies) ReadDir

func (d *Dependencies) ReadDir(dirname string) ([]os.FileInfo, error)

func (*Dependencies) ReadFile

func (d *Dependencies) ReadFile(fname string) ([]byte, error)

func (*Dependencies) Stat

func (d *Dependencies) Stat(fname string) (os.FileInfo, error)

type IDependencies

type IDependencies interface {
	Execute(command string, args ...string) (stdout string, stderr string, exitCode int)
	ReadFile(fname string) ([]byte, error)
	Stat(fname string) (os.FileInfo, error)
	Hostname() (string, error)
	Interfaces() ([]Interface, error)
	Block(opts ...*ghw.WithOption) (*ghw.BlockInfo, error)
	ReadDir(dirname string) ([]os.FileInfo, error)
	Abs(path string) (string, error)
	EvalSymlinks(path string) (string, error)
}

type Interface

type Interface interface {
	MTU() int
	Name() string
	HardwareAddr() net.HardwareAddr
	Flags() net.Flags
	Addrs() ([]net.Addr, error)
	IsPhysical() bool
	SpeedMbps() int64
}

type MockIDependencies

type MockIDependencies struct {
	mock.Mock
}

MockIDependencies is an autogenerated mock type for the IDependencies type

func (*MockIDependencies) Abs

func (_m *MockIDependencies) Abs(path string) (string, error)

Abs provides a mock function with given fields: path

func (*MockIDependencies) Block

func (_m *MockIDependencies) Block(opts ...*ghw.WithOption) (*ghw.BlockInfo, error)

Block provides a mock function with given fields: opts

func (_m *MockIDependencies) EvalSymlinks(path string) (string, error)

EvalSymlinks provides a mock function with given fields: path

func (*MockIDependencies) Execute

func (_m *MockIDependencies) Execute(command string, args ...string) (string, string, int)

Execute provides a mock function with given fields: command, args

func (*MockIDependencies) Hostname

func (_m *MockIDependencies) Hostname() (string, error)

Hostname provides a mock function with given fields:

func (*MockIDependencies) Interfaces

func (_m *MockIDependencies) Interfaces() ([]Interface, error)

Interfaces provides a mock function with given fields:

func (*MockIDependencies) ReadDir

func (_m *MockIDependencies) ReadDir(dirname string) ([]os.FileInfo, error)

ReadDir provides a mock function with given fields: dirname

func (*MockIDependencies) ReadFile

func (_m *MockIDependencies) ReadFile(fname string) ([]byte, error)

ReadFile provides a mock function with given fields: fname

func (*MockIDependencies) Stat

func (_m *MockIDependencies) Stat(fname string) (os.FileInfo, error)

Stat provides a mock function with given fields: fname

type MockInterface

type MockInterface struct {
	mock.Mock
}

MockInterface is an autogenerated mock type for the Interface type

func (*MockInterface) Addrs

func (_m *MockInterface) Addrs() ([]net.Addr, error)

Addrs provides a mock function with given fields:

func (*MockInterface) Flags

func (_m *MockInterface) Flags() net.Flags

Flags provides a mock function with given fields:

func (*MockInterface) HardwareAddr

func (_m *MockInterface) HardwareAddr() net.HardwareAddr

HardwareAddr provides a mock function with given fields:

func (*MockInterface) IsPhysical

func (_m *MockInterface) IsPhysical() bool

IsPhysical provides a mock function with given fields:

func (*MockInterface) MTU

func (_m *MockInterface) MTU() int

MTU provides a mock function with given fields:

func (*MockInterface) Name

func (_m *MockInterface) Name() string

Name provides a mock function with given fields:

func (*MockInterface) SpeedMbps

func (_m *MockInterface) SpeedMbps() int64

SpeedMbps provides a mock function with given fields:

type NetworkInterface

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

func (*NetworkInterface) Addrs

func (n *NetworkInterface) Addrs() ([]net.Addr, error)

func (*NetworkInterface) Flags

func (n *NetworkInterface) Flags() net.Flags

func (*NetworkInterface) HardwareAddr

func (n *NetworkInterface) HardwareAddr() net.HardwareAddr

func (*NetworkInterface) IsPhysical

func (n *NetworkInterface) IsPhysical() bool

func (*NetworkInterface) MTU

func (n *NetworkInterface) MTU() int

func (*NetworkInterface) Name

func (n *NetworkInterface) Name() string

func (*NetworkInterface) SpeedMbps

func (n *NetworkInterface) SpeedMbps() int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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