CPUSet is a thread-safe, immutable set-like data structure for CPU IDs.
type CPUSet struct {
// contains filtered or unexported fields
}
func New(cpus ...int) CPUSet
New returns a new CPUSet containing the supplied elements.
func Parse(s string) (CPUSet, error)
Parse CPUSet constructs a new CPU set from a Linux CPU list formatted string.
See: http://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS
func (s CPUSet) Clone() CPUSet
Clone returns a copy of this CPU set.
func (s CPUSet) Contains(cpu int) bool
Contains returns true if the supplied element is present in this set.
func (s CPUSet) Difference(s2 CPUSet) CPUSet
Difference returns a new CPU set that contains all of the elements that are present in this set and not the supplied set, without mutating either source set.
func (s CPUSet) Equals(s2 CPUSet) bool
Equals returns true if the supplied set contains exactly the same elements as this set (s IsSubsetOf s2 and s2 IsSubsetOf s).
func (s CPUSet) Intersection(s2 CPUSet) CPUSet
Intersection returns a new CPU set that contains all of the elements that are present in both this set and the supplied set, without mutating either source set.
func (s CPUSet) IsEmpty() bool
IsEmpty returns true if there are zero elements in this set.
func (s CPUSet) IsSubsetOf(s2 CPUSet) bool
IsSubsetOf returns true if the supplied set contains all the elements
func (s CPUSet) List() []int
List returns a slice of integers that contains all elements from this set. The list is sorted.
func (s CPUSet) Size() int
Size returns the number of elements in this set.
func (s CPUSet) String() string
String returns a new string representation of the elements in this CPU set in canonical linux CPU list format.
See: http://man7.org/linux/man-pages/man7/cpuset.7.html#FORMATS
func (s CPUSet) Union(s2 ...CPUSet) CPUSet
Union returns a new CPU set that contains all of the elements from this set and all of the elements from the supplied sets, without mutating either source set.
func (s CPUSet) UnsortedList() []int
UnsortedList returns a slice of integers that contains all elements from this set.