package platform
import "github.com/cilium/ebpf/internal/platform"
Index ¶
- Constants
- func DecodeConstant[T ~uint32](c T) (string, uint32)
- func EncodeConstant[T ~uint32](platform string, c uint32) (T, error)
- func SelectVersion(versions []string) (string, error)
Constants ¶
Values used to tag platform specific constants.
The value for Linux is zero so that existing constants do not change.
const ( Linux = "linux" Windows = "windows" )
const Native = Linux
Functions ¶
func DecodeConstant ¶
Decode a platform and a value from a tagged constant.
func EncodeConstant ¶
Encode a platform and a value into a tagged constant.
Returns an error if platform is unknown or c is out of bounds.
func SelectVersion ¶
SelectVersion extracts the platform-appropriate version from a list of strings like `linux:6.1` or `windows:0.20.0`.
Returns an empty string and nil if no version matched or an error if no strings were passed.
Source Files ¶
constants.go platform.go platform_linux.go
- Version
- v0.18.0 (latest)
- Published
- Apr 2, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 6 days ago –
Tools for package owners.