detect

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package detect provides functionality for detecting and managing platform-specific information, including the operating system, architecture, system library, file extension, and distribution. It offers utilities to parse platform details from strings, set default platform configurations, and merge platform data from different sources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Platform

type Platform struct {
	OS           platform.OS
	Library      platform.Library
	Distribution platform.Distribution
	Extension    platform.Extension
	Architecture platform.Architecture
}

Platform encapsulates system-specific characteristics and capabilities.

func (*Platform) Detect

func (p *Platform) Detect() error

Detect gathers information about the current platform, such as the operating system, architecture, distribution, library, and file extension, and populates the Platform struct accordingly.

func (*Platform) Merge

func (p *Platform) Merge(other Platform)

Merge combines two Platform configurations. Copies non-zero values from the other Platform into this one, preserving existing values when they are already set.

func (*Platform) Parse

func (p *Platform) Parse(name string)

Parse extracts platform information from a string identifier. Attempts to determine OS, architecture, and library details from the input.

func (Platform) ToMap

func (p Platform) ToMap() map[string]any

ToMap converts the Platform configuration into a map for templating. Includes derived values like architecture type, version, and capability flags.

Directories

Path Synopsis
Package platform provides types and utilities for representing and working with different system platforms, including architectures, operating systems, libraries, and distributions.
Package platform provides types and utilities for representing and working with different system platforms, including architectures, operating systems, libraries, and distributions.

Jump to

Keyboard shortcuts

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