Documentation
¶
Index ¶
- type Builder
- type CPUSet
- func (s CPUSet) Clone() CPUSet
- func (s CPUSet) Contains(cpu int) bool
- func (s CPUSet) Difference(s2 CPUSet) CPUSet
- func (s CPUSet) Equals(s2 CPUSet) bool
- func (s CPUSet) Filter(predicate func(int) bool) CPUSet
- func (s CPUSet) FilterNot(predicate func(int) bool) CPUSet
- func (s CPUSet) Intersection(s2 CPUSet) CPUSet
- func (s CPUSet) IsEmpty() bool
- func (s CPUSet) IsSubsetOf(s2 CPUSet) bool
- func (s CPUSet) Size() int
- func (s CPUSet) String() string
- func (s CPUSet) ToSlice() []int
- func (s CPUSet) Union(s2 CPUSet) CPUSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is a mutable builder for CPUSet. Functions that mutate instances of this type are not thread-safe.
type CPUSet ¶
type CPUSet struct {
// contains filtered or unexported fields
}
CPUSet is a thread-safe, immutable set-like data structure for CPU IDs.
func MustParse ¶
func MustParse(s string) CPUSet
MustParse CPUSet constructs a new CPU set from a Linux CPU list formatted string. Unlike Parse, it does not return an error but rather panics if the input cannot be used to construct a CPU set.
func NewCPUSet ¶
func NewCPUSet(cpus ...int) CPUSet
NewCPUSet returns a new CPUSet containing the supplied elements.
func Parse ¶
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 (CPUSet) Contains ¶
func (s CPUSet) Contains(cpu int) bool
Contains returns true if the supplied element is present in this set.
func (CPUSet) Difference ¶
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 (CPUSet) Equals ¶
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 (CPUSet) Filter ¶
func (s CPUSet) Filter(predicate func(int) bool) CPUSet
Filter returns a new CPU set that contains all of the elements from this set that match the supplied predicate, without mutating the source set.
func (CPUSet) FilterNot ¶
func (s CPUSet) FilterNot(predicate func(int) bool) CPUSet
FilterNot returns a new CPU set that contains all of the elements from this set that do not match the supplied predicate, without mutating the source set.
func (CPUSet) Intersection ¶
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 (CPUSet) IsEmpty ¶
func (s CPUSet) IsEmpty() bool
IsEmpty returns true if there are zero elements in this set.
func (CPUSet) IsSubsetOf ¶
func (s CPUSet) IsSubsetOf(s2 CPUSet) bool
IsSubsetOf returns true if the supplied set contains all the elements
func (CPUSet) String ¶
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