asset

package
v0.0.0-...-63b02d4 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SrcProbe   = "probe"
	SrcDefault = "default"
	SrcConfig  = "config"
)

Variables

View Source
var (
	ErrNotImpl = fmt.Errorf("not implemented")
	ErrIgnore  = fmt.Errorf("ignore")
)

Functions

func ConnectTo

func ConnectTo() (string, error)

func GetLANS

func GetLANS() (map[string][]LAN, error)

func LastBoot

func LastBoot() (string, error)

func SMBIOS

func SMBIOS() (*smbios.SMBIOS, error)

func TZ

func TZ() (string, error)

Types

type Data

type Data struct {
	Properties Properties       `json:"properties"`
	GIDS       []Group          `json:"gids"`
	UIDS       []User           `json:"uids"`
	Hardware   []Device         `json:"hardware"`
	LAN        map[string][]LAN `json:"lan"`
	HBA        []san.Initiator  `json:"hba"`
	Targets    san.Paths        `json:"targets"`
}

func NewData

func NewData() Data

func (Data) Render

func (t Data) Render() string

func (Data) Values

func (t Data) Values() []Property

type Device

type Device struct {
	Path        string `json:"path"`
	Description string `json:"description"`
	Class       string `json:"class"`
	Driver      string `json:"driver"`
	Type        string `json:"type"`
}

func Hardware

func Hardware() ([]Device, error)

type Group

type Group struct {
	ID   int    `json:"gid"`
	Name string `json:"groupname"`
}

func Groups

func Groups() ([]Group, error)

type LAN

type LAN struct {
	Address        string `json:"addr"`
	FlagDeprecated bool   `json:"flag_deprecated"`
	Intf           string `json:"intf"`
	Mask           string `json:"mask"`
	Type           string `json:"type"`
}

type Properties

type Properties struct {
	Nodename     Property `json:"nodename"`
	FQDN         Property `json:"fqdn"`
	Version      Property `json:"version"`
	OSName       Property `json:"os_name"`
	OSVendor     Property `json:"os_vendor"`
	OSRelease    Property `json:"os_release"`
	OSKernel     Property `json:"os_kernel"`
	OSArch       Property `json:"os_arch"`
	MemBytes     Property `json:"mem_bytes"`
	MemSlots     Property `json:"mem_slots"`
	MemBanks     Property `json:"mem_banks"`
	CPUFreq      Property `json:"cpu_freq"`
	CPUThreads   Property `json:"cpu_threads"`
	CPUCores     Property `json:"cpu_cores"`
	CPUDies      Property `json:"cpu_dies"`
	CPUModel     Property `json:"cpu_model"`
	Serial       Property `json:"serial"`
	Model        Property `json:"model"`
	Manufacturer Property `json:"manufacturer"`
	BIOSVersion  Property `json:"bios_version"`
	SPVersion    Property `json:"sp_version"`
	NodeEnv      Property `json:"node_env"`
	AssetEnv     Property `json:"asset_env"`
	ListenerPort Property `json:"listener_port"`
	ClusterID    Property `json:"cluster_id"`
	Enclosure    Property `json:"enclosure"`
	TZ           Property `json:"tz"`
	ConnectTo    Property `json:"connect_to"`
	SecZone      Property `json:"sec_zone"`
	LastBoot     Property `json:"last_boot"`
	BootID       Property `json:"boot_id"`
	LocCountry   Property `json:"loc_country"`
	LocCity      Property `json:"loc_city"`
	LocBuilding  Property `json:"loc_building"`
	LocRoom      Property `json:"loc_room"`
	LocRack      Property `json:"loc_rack"`
	LocAddr      Property `json:"loc_addr"`
	LocFloor     Property `json:"loc_floor"`
	LocZIP       Property `json:"loc_zip"`
	TeamInteg    Property `json:"team_integ"`
	TeamSupport  Property `json:"team_support"`
}

type Property

type Property struct {
	Name   string      `json:"-"`
	Source string      `json:"source"`
	Title  string      `json:"title"`
	Value  interface{} `json:"value"`
	Error  string      `json:"error,omitempty"`
}

type T

type T struct{}

func New

func New() *T

func (T) Get

func (t T) Get(s string) (interface{}, error)

type User

type User struct {
	ID   int    `json:"uid"`
	Name string `json:"username"`
}

func Users

func Users() ([]User, error)

Jump to

Keyboard shortcuts

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