platform

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2025 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContainsPlatform

func ContainsPlatform(platforms *[]Platform, platform Platform) bool

func SetOS

func SetOS(v string)

Types

type Platform

type Platform string
const (
	PlatformMacos   Platform = "macos"
	PlatformLinux   Platform = "linux"
	PlatformWindows Platform = "windows"
)

func GetPlatform

func GetPlatform() Platform

type PlatformMap

type PlatformMap[T any] struct {
	MacOS   *T `json:"macos"   yaml:"macos"`
	Linux   *T `json:"linux"   yaml:"linux"`
	Windows *T `json:"windows" yaml:"windows"`
}

func NewPlatformMap added in v1.9.0

func NewPlatformMap[T any](values map[string]T) *PlatformMap[T]

func (*PlatformMap[T]) Resolve

func (p *PlatformMap[T]) Resolve() *T

func (*PlatformMap[T]) ResolveWithFallback

func (o *PlatformMap[T]) ResolveWithFallback(fallback PlatformMap[T]) T

type Platforms

type Platforms struct {
	Only   *[]Platform `json:"only"   yaml:"only"`
	Except *[]Platform `json:"except" yaml:"except"`
}

func (*Platforms) GetShouldRunOnOS

func (p *Platforms) GetShouldRunOnOS(curOS Platform) bool

Jump to

Keyboard shortcuts

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