Documentation ¶
Overview ¶
Package memory provides NSM registry chain elements to building memory-based registries
Code generated by "-output ns_sync_map.gen.go -type NetworkServiceSyncMap<string,*github.com/networkservicemesh/api/pkg/api/registry.NetworkService> -output ns_sync_map.gen.go -type NetworkServiceSyncMap<string,*github.com/networkservicemesh/api/pkg/api/registry.NetworkService>"; DO NOT EDIT.
Code generated by "-output nse_sync_map.gen.go -type NetworkServiceEndpointSyncMap<string,*github.com/networkservicemesh/api/pkg/api/registry.NetworkServiceEndpoint> -output nse_sync_map.gen.go -type NetworkServiceEndpointSyncMap<string,*github.com/networkservicemesh/api/pkg/api/registry.NetworkServiceEndpoint>"; DO NOT EDIT.
Index ¶
- func NewNetworkServiceEndpointRegistryServer(options ...Option) registry.NetworkServiceEndpointRegistryServer
- func NewNetworkServiceRegistryServer(options ...Option) registry.NetworkServiceRegistryServer
- type NetworkServiceEndpointSyncMap
- func (m *NetworkServiceEndpointSyncMap) Delete(key string)
- func (m *NetworkServiceEndpointSyncMap) Load(key string) (*registry.NetworkServiceEndpoint, bool)
- func (m *NetworkServiceEndpointSyncMap) LoadAndDelete(key string) (value *registry.NetworkServiceEndpoint, loaded bool)
- func (m *NetworkServiceEndpointSyncMap) LoadOrStore(key string, value *registry.NetworkServiceEndpoint) (*registry.NetworkServiceEndpoint, bool)
- func (m *NetworkServiceEndpointSyncMap) Range(f func(key string, value *registry.NetworkServiceEndpoint) bool)
- func (m *NetworkServiceEndpointSyncMap) Store(key string, value *registry.NetworkServiceEndpoint)
- type NetworkServiceSyncMap
- func (m *NetworkServiceSyncMap) Delete(key string)
- func (m *NetworkServiceSyncMap) Load(key string) (*registry.NetworkService, bool)
- func (m *NetworkServiceSyncMap) LoadAndDelete(key string) (value *registry.NetworkService, loaded bool)
- func (m *NetworkServiceSyncMap) LoadOrStore(key string, value *registry.NetworkService) (*registry.NetworkService, bool)
- func (m *NetworkServiceSyncMap) Range(f func(key string, value *registry.NetworkService) bool)
- func (m *NetworkServiceSyncMap) Store(key string, value *registry.NetworkService)
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNetworkServiceEndpointRegistryServer ¶
func NewNetworkServiceEndpointRegistryServer(options ...Option) registry.NetworkServiceEndpointRegistryServer
NewNetworkServiceEndpointRegistryServer creates new memory based NetworkServiceEndpointRegistryServer
func NewNetworkServiceRegistryServer ¶
func NewNetworkServiceRegistryServer(options ...Option) registry.NetworkServiceRegistryServer
NewNetworkServiceRegistryServer creates new memory based NetworkServiceRegistryServer
Types ¶
type NetworkServiceEndpointSyncMap ¶
NetworkServiceEndpointSyncMap is like a Go map[string]*registry.NetworkServiceEndpoint but is safe for concurrent use by multiple goroutines without additional locking or coordination.
func (*NetworkServiceEndpointSyncMap) Delete ¶
func (m *NetworkServiceEndpointSyncMap) Delete(key string)
Delete deletes the value for a key.
func (*NetworkServiceEndpointSyncMap) Load ¶
func (m *NetworkServiceEndpointSyncMap) Load(key string) (*registry.NetworkServiceEndpoint, bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*NetworkServiceEndpointSyncMap) LoadAndDelete ¶
func (m *NetworkServiceEndpointSyncMap) LoadAndDelete(key string) (value *registry.NetworkServiceEndpoint, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present.
func (*NetworkServiceEndpointSyncMap) LoadOrStore ¶
func (m *NetworkServiceEndpointSyncMap) LoadOrStore(key string, value *registry.NetworkServiceEndpoint) (*registry.NetworkServiceEndpoint, bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
func (*NetworkServiceEndpointSyncMap) Range ¶
func (m *NetworkServiceEndpointSyncMap) Range(f func(key string, value *registry.NetworkServiceEndpoint) bool)
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
Range may be O(N) with the number of elements in the map even if f returns false after a constant number of calls.
func (*NetworkServiceEndpointSyncMap) Store ¶
func (m *NetworkServiceEndpointSyncMap) Store(key string, value *registry.NetworkServiceEndpoint)
Store sets the value for a key.
type NetworkServiceSyncMap ¶
NetworkServiceSyncMap is like a Go map[string]*registry.NetworkService but is safe for concurrent use by multiple goroutines without additional locking or coordination.
func (*NetworkServiceSyncMap) Delete ¶
func (m *NetworkServiceSyncMap) Delete(key string)
Delete deletes the value for a key.
func (*NetworkServiceSyncMap) Load ¶
func (m *NetworkServiceSyncMap) Load(key string) (*registry.NetworkService, bool)
Load returns the value stored in the map for a key, or nil if no value is present. The ok result indicates whether value was found in the map.
func (*NetworkServiceSyncMap) LoadAndDelete ¶
func (m *NetworkServiceSyncMap) LoadAndDelete(key string) (value *registry.NetworkService, loaded bool)
LoadAndDelete deletes the value for a key, returning the previous value if any. The loaded result reports whether the key was present.
func (*NetworkServiceSyncMap) LoadOrStore ¶
func (m *NetworkServiceSyncMap) LoadOrStore(key string, value *registry.NetworkService) (*registry.NetworkService, bool)
LoadOrStore returns the existing value for the key if present. Otherwise, it stores and returns the given value. The loaded result is true if the value was loaded, false if stored.
func (*NetworkServiceSyncMap) Range ¶
func (m *NetworkServiceSyncMap) Range(f func(key string, value *registry.NetworkService) bool)
Range calls f sequentially for each key and value present in the map. If f returns false, range stops the iteration.
Range does not necessarily correspond to any consistent snapshot of the Map's contents: no key will be visited more than once, but if the value for any key is stored or deleted concurrently, Range may reflect any mapping for that key from any point during the Range call.
Range may be O(N) with the number of elements in the map even if f returns false after a constant number of calls.
func (*NetworkServiceSyncMap) Store ¶
func (m *NetworkServiceSyncMap) Store(key string, value *registry.NetworkService)
Store sets the value for a key.