Documentation ¶
Overview ¶
Package hazelcast contains an implementation of the `gokv.Store` interface for Hazelcast.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultOptions = Options{ Address: "localhost:5701", MapName: "gokv", Codec: encoding.JSON, }
DefaultOptions is an Options object with default values. Addresses: "localhost:5701", MapName: "gokv", Codec: encoding.JSON
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a gokv.Store implementation for Hazelcast.
func (Client) Close ¶
Close closes the client. This must be called to properly shut down connections and services (e.g. HeartBeatService).
func (Client) Delete ¶
Delete deletes the stored value for the given key. The key must not be longer than 250 bytes (this is a restriction of Hazelcast). Deleting a non-existing key-value pair does NOT lead to an error. The key must not be "".
func (Client) Get ¶
Get retrieves the stored value for the given key. You need to pass a pointer to the value, so in case of a struct the automatic unmarshalling can populate the fields of the object that v points to with the values of the retrieved object's values. If no value is found it returns (false, nil). The key must not be "" and the pointer must not be nil.
type Options ¶
type Options struct { // Address of one Hazelcast server, including port. // The client will delegate all operations to the given server. // If the server dies, the client will automatically switch to another server in the cluster. // Optional ("localhost:5701" by default). Address string // Name of the Hazelcast distributed map to use. // Optional ("gokv" by default). MapName string // Encoding format. // Optional (encoding.JSON by default). Codec encoding.Codec }
Options are the options for the Hazelcast client.