Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
func NewInfo ¶
func NewInfo() *Info
NewInfo creates and returns a new Info instance with default settings for container detection and operating system information retrieval.
func (*Info) ContainerInfo ¶
ContainerInfo returns container-specific information including container ID, hostname, and operating system release details when running in a containerized environment.
func (*Info) HostInfo ¶
HostInfo returns information about the host system including host ID, hostname, and operating system release details.
func (*Info) IsContainer ¶
IsContainer determines if the current environment is running inside a container. It checks for container-specific files and container references in cgroup. Returns true if running in a container, false otherwise.
type InfoInterface ¶
type InfoInterface interface {
IsContainer() (bool, error)
ResourceID(ctx context.Context) (string, error)
ContainerInfo(ctx context.Context) (*v1.Resource_ContainerInfo, error)
HostInfo(ctx context.Context) (*v1.Resource_HostInfo, error)
}
InfoInterface is an interface that defines methods to get information about the host or container.