MCPcopy
hub / github.com/olric-data/olric / NewDMap

Method NewDMap

cluster_client.go:686–704  ·  view source on GitHub ↗

NewDMap returns a new DMap client with the given options.

(name string, options ...DMapOption)

Source from the content-addressed store, hash-verified

684
685// NewDMap returns a new DMap client with the given options.
686func (cl *ClusterClient) NewDMap(name string, options ...DMapOption) (DMap, error) {
687 var dc dmapConfig
688 for _, opt := range options {
689 opt(&dc)
690 }
691
692 if dc.storageEntryImplementation == nil {
693 dc.storageEntryImplementation = func() storage.Entry {
694 return entry.New()
695 }
696 }
697
698 return &ClusterDMap{name: name,
699 config: &dc,
700 newEntry: dc.storageEntryImplementation,
701 client: cl.client,
702 clusterClient: cl,
703 }, nil
704}
705
706// ClusterClientOption is a functional option for configuring a clusterClientConfig instance.
707type ClusterClientOption func(c *clusterClientConfig)

Callers 15

TestClusterClient_PutFunction · 0.95
TestClusterClient_GetFunction · 0.95
TestClusterClient_DeleteFunction · 0.95
TestClusterClient_IncrFunction · 0.95
TestClusterClient_DecrFunction · 0.95
TestClusterClient_GetPutFunction · 0.95
TestClusterClient_ExpireFunction · 0.95

Calls 1

NewFunction · 0.92

Tested by 15

TestClusterClient_PutFunction · 0.76
TestClusterClient_GetFunction · 0.76
TestClusterClient_DeleteFunction · 0.76
TestClusterClient_IncrFunction · 0.76
TestClusterClient_DecrFunction · 0.76
TestClusterClient_GetPutFunction · 0.76
TestClusterClient_ExpireFunction · 0.76