biz

package
v0.0.0-...-e544f65 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 12 Imported by: 0

README

Biz

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet is biz providers.

View Source
var WorkerProviderSet = wire.NewSet(NewHardwareUsecase)

Functions

This section is empty.

Types

type Cpu

type Cpu struct {
	CPU       int32
	VendorID  string
	Family    string
	Model     string
	ModelName string
}

type DiskPartition

type DiskPartition struct {
	Device     string
	Mountpoint string
	Fstype     string
	Opts       []string
}

type Hardware

type Hardware struct {
	Host              *Host
	Memory            *Memory
	NetworkInterfaces []*NetworkInterfaces
	DiskPartition     []*DiskPartition
	Netstat           []*Netstat
	Cpu               []*Cpu
}

Greeter is a Greeter model.

func (*Hardware) Collect

func (h *Hardware) Collect() error

type HardwareRepo

type HardwareRepo interface {
	Save(context.Context, *Hardware) (*Hardware, error)
	Update(context.Context, *Hardware) (*Hardware, error)
	GetByID(context.Context, string) (*Hardware, error)
	GetByHostname(context.Context, string) (*Hardware, error)
	ListAll(context.Context) ([]*Hardware, error)
}

HardwareRepo is a Greater repo.

type HardwareUsecase

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

HardwareUsecase is a Greeter usecase.

func NewHardwareUsecase

func NewHardwareUsecase(repo HardwareRepo, logger log.Logger) *HardwareUsecase

NewHardwareUsecase new a Greeter usecase.

func (*HardwareUsecase) CreateHardware

func (uc *HardwareUsecase) CreateHardware(ctx context.Context, g *Hardware) (*Hardware, error)

CreateHardware creates a Hardware.

func (*HardwareUsecase) GetByHostname

func (uc *HardwareUsecase) GetByHostname(ctx context.Context, hostname string) (*Hardware, error)

CreateHardware creates a Hardware.

func (*HardwareUsecase) GetByID

func (uc *HardwareUsecase) GetByID(ctx context.Context, id string) (*Hardware, error)

CreateHardware creates a Hardware.

type Host

type Host struct {
	Hostname             string
	OS                   string
	Platform             string
	PlatformFamily       string
	PlatformVersion      string
	KernelVersion        string
	KernelArch           string
	VirtualizationSystem string
	VirtualizationRole   string
	HostID               string
}

func (*Host) Collect

func (h *Host) Collect() error

type Memory

type Memory struct {
	Total uint64
}

type Netstat

type Netstat struct {
	Addr    string
	Port    uint64
	Proto   string
	Process string
}

type NetworkInterfaces

type NetworkInterfaces struct {
	Index        int64
	MTU          int64
	Name         string
	HardwareAddr string
	Flags        []string
	Addrs        []string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳