mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-28 02:37:11 +00:00
pkg/api/feature: use pointers of structs
Make it easier to mutate the feature sets.
This commit is contained in:
parent
30f641847e
commit
5de4d8857c
2 changed files with 6 additions and 6 deletions
|
@ -20,9 +20,9 @@ package feature
|
|||
// features to empty values
|
||||
func NewDomainFeatures() *DomainFeatures {
|
||||
return &DomainFeatures{
|
||||
Keys: make(map[string]KeyFeatureSet),
|
||||
Values: make(map[string]ValueFeatureSet),
|
||||
Instances: make(map[string]InstanceFeatureSet)}
|
||||
Keys: make(map[string]*KeyFeatureSet),
|
||||
Values: make(map[string]*ValueFeatureSet),
|
||||
Instances: make(map[string]*InstanceFeatureSet)}
|
||||
}
|
||||
|
||||
func NewKeyFeatures() *KeyFeatureSet { return &KeyFeatureSet{Elements: make(map[string]Nil)} }
|
||||
|
|
|
@ -22,9 +22,9 @@ type Features map[string]*DomainFeatures
|
|||
|
||||
// DomainFeatures is the collection of all discovered features of one domain.
|
||||
type DomainFeatures struct {
|
||||
Keys map[string]KeyFeatureSet `protobuf:"bytes,1,rep,name=keys"`
|
||||
Values map[string]ValueFeatureSet `protobuf:"bytes,2,rep,name=values"`
|
||||
Instances map[string]InstanceFeatureSet `protobuf:"bytes,3,rep,name=instances"`
|
||||
Keys map[string]*KeyFeatureSet `protobuf:"bytes,1,rep,name=keys"`
|
||||
Values map[string]*ValueFeatureSet `protobuf:"bytes,2,rep,name=values"`
|
||||
Instances map[string]*InstanceFeatureSet `protobuf:"bytes,3,rep,name=instances"`
|
||||
}
|
||||
|
||||
// KeyFeatureSet is a set of simple features only containing names without values.
|
||||
|
|
Loading…
Add table
Reference in a new issue