k8s.io/perf-tests/clusterloader2@v0.0.0-20240304094227-64bdb12da87e/pkg/state/state.go (about) 1 /* 2 Copyright 2018 The Kubernetes 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 17 package state 18 19 // State is a state of the cluster. 20 // It is composed of namespaces state and resources versions state. 21 type State struct { 22 namespacesState *NamespacesState 23 resourcesVersionState *ResourcesVersionsState 24 } 25 26 // NewState creates new State instance. 27 func NewState() *State { 28 return &State{ 29 namespacesState: newNamespacesState(), 30 resourcesVersionState: newResourcesVersionsState(), 31 } 32 } 33 34 // GetNamespacesState returns namespaces state. 35 func (s *State) GetNamespacesState() *NamespacesState { 36 return s.namespacesState 37 } 38 39 // GetResourcesVersionState returns resources versions state. 40 func (s *State) GetResourcesVersionState() *ResourcesVersionsState { 41 return s.resourcesVersionState 42 }