asset

package
v3.0.0-rc67 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 25 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 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"`
}

func (Properties) FeedMap

func (t Properties) FeedMap() (map[string]Property, error)

FeedMap returns the properties to post to the collector, as a map indexed by property name. Like the v2 agent, the optional properties that are not set (source "default" or empty) are omitted so the collector keeps its value.

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