1/*
2   Copyright The containerd Authors.
3
4   Licensed under the Apache License, Version 2.0 (the "License");
5   you may not use this file except in compliance with the License.
6   You may obtain a copy of the License at
7
8       http://www.apache.org/licenses/LICENSE-2.0
9
10   Unless required by applicable law or agreed to in writing, software
11   distributed under the License is distributed on an "AS IS" BASIS,
12   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   See the License for the specific language governing permissions and
14   limitations under the License.
15*/
16
17package v2
18
19type Memory struct {
20	Swap *int64
21	Max  *int64
22	Low  *int64
23	High *int64
24}
25
26func (r *Memory) Values() (o []Value) {
27	if r.Swap != nil {
28		o = append(o, Value{
29			filename: "memory.swap.max",
30			value:    *r.Swap,
31		})
32	}
33	if r.Max != nil {
34		o = append(o, Value{
35			filename: "memory.max",
36			value:    *r.Max,
37		})
38	}
39	if r.Low != nil {
40		o = append(o, Value{
41			filename: "memory.low",
42			value:    *r.Low,
43		})
44	}
45	if r.High != nil {
46		o = append(o, Value{
47			filename: "memory.high",
48			value:    *r.High,
49		})
50	}
51	return o
52}
53