go.ligato.io/vpp-agent/v3@v3.5.0/plugins/kvscheduler/internal/registry/registry_api.go (about) 1 // Copyright (c) 2018 Cisco and/or its affiliates. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at: 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package registry 16 17 import ( 18 . "go.ligato.io/vpp-agent/v3/plugins/kvscheduler/api" 19 ) 20 21 // Registry can be used to register all descriptors and get quick (cached, O(log)) 22 // lookups by keys. 23 type Registry interface { 24 // RegisterDescriptor add new descriptor into the registry. 25 RegisterDescriptor(descriptor *KVDescriptor) 26 27 // GetAllDescriptors returns all registered descriptors ordered by retrieve-dependencies. 28 GetAllDescriptors() []*KVDescriptor 29 30 // GetDescriptor returns descriptor with the given name. 31 GetDescriptor(name string) *KVDescriptor 32 33 // GetDescriptorForKey returns descriptor handling the given key. 34 GetDescriptorForKey(key string) *KVDescriptor 35 }