Documentation ¶
Index ¶
- Variables
- type Address
- type Config
- type DiscoveryConfig
- type EndpointQualifier
- type EndpointQualifierType
- type HazelcastCloudConfig
- type MemberInfo
- type MemberVersion
- type MembershipState
- type MembershipStateChangeHandler
- type MembershipStateChanged
- type SSLConfig
- func (c *SSLConfig) AddClientCertAndEncryptedKeyPath(certPath string, privateKeyPath string, password string) error
- func (c *SSLConfig) AddClientCertAndKeyPath(clientCertPath string, clientPrivateKeyPath string) error
- func (c *SSLConfig) Clone() SSLConfig
- func (c *SSLConfig) ResetTLSConfig(tlsConfig *tls.Config)
- func (c *SSLConfig) SetCAPath(path string) error
- func (c *SSLConfig) Validate() error
- type SecurityConfig
Constants ¶
This section is empty.
Variables ¶
var ErrConfigInvalidClusterName = errors.New("invalid cluster name")
var ErrConfigInvalidConnectionTimeout = errors.New("invalid connection timeout")
var ErrConfigInvalidHeartbeatInterval = errors.New("invalid heartbeat interval")
var ErrConfigInvalidHeartbeatTimeout = errors.New("invalid heartbeat timeout")
var ErrConfigInvalidInvocationTimeout = errors.New("invalid invocation timeout")
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SecurityConfig SecurityConfig SSLConfig SSLConfig Name string HazelcastCloudConfig HazelcastCloudConfig Addrs []string InvocationTimeout time.Duration HeartbeatInterval time.Duration HeartbeatTimeout time.Duration ConnectionTimeout time.Duration DiscoveryConfig DiscoveryConfig RedoOperation bool SmartRouting bool }
func (*Config) SetAddress ¶
SetAddress sets the candidate address list that client will use to establish initial connection. Other members of the cluster will be discovered when the client starts.
type DiscoveryConfig ¶
type DiscoveryConfig struct {
UsePublicIP bool
}
func NewDiscoveryConfig ¶
func NewDiscoveryConfig() DiscoveryConfig
func (DiscoveryConfig) Clone ¶
func (c DiscoveryConfig) Clone() DiscoveryConfig
func (DiscoveryConfig) Validate ¶
func (c DiscoveryConfig) Validate() error
type EndpointQualifier ¶
type EndpointQualifier struct { Identifier string Type EndpointQualifierType }
type EndpointQualifierType ¶
type EndpointQualifierType int32
const ( EndpointQualifierTypeMember EndpointQualifierType = 0 EndpointQualifierTypeClient EndpointQualifierType = 1 EndpointQualifierTypeWan EndpointQualifierType = 2 EndpointQualifierTypeRest EndpointQualifierType = 3 EndpointQualifierTypeMemCache EndpointQualifierType = 4 )
func (EndpointQualifierType) String ¶
func (t EndpointQualifierType) String() string
type HazelcastCloudConfig ¶
func NewHazelcastCloudConfig ¶
func NewHazelcastCloudConfig() HazelcastCloudConfig
func (HazelcastCloudConfig) Clone ¶
func (h HazelcastCloudConfig) Clone() HazelcastCloudConfig
func (HazelcastCloudConfig) Validate ¶
func (h HazelcastCloudConfig) Validate() error
type MemberInfo ¶
type MemberInfo struct { Attributes map[string]string AddressMap map[EndpointQualifier]Address Address Address UUID types.UUID Version MemberVersion LiteMember bool }
MemberInfo represents a member in the cluster.
func (*MemberInfo) PublicAddress ¶
func (mi *MemberInfo) PublicAddress() (addr Address, ok bool)
PublicAddress returns the public address and ok == true if member contains a public address.
func (MemberInfo) String ¶
func (mi MemberInfo) String() string
type MemberVersion ¶
MemberVersion is the version of the member
type MembershipState ¶
type MembershipState int
const ( MembershipStateAdded MembershipState = iota MembershipStateRemoved )
func (MembershipState) String ¶
func (m MembershipState) String() string
type MembershipStateChangeHandler ¶
type MembershipStateChangeHandler func(event MembershipStateChanged)
type MembershipStateChanged ¶
type MembershipStateChanged struct { Member MemberInfo State MembershipState }
func (*MembershipStateChanged) EventName ¶
func (e *MembershipStateChanged) EventName() string
type SSLConfig ¶
SSLConfig is SSL configuration for client. SSLConfig has tls.Config embedded in it so that users can set any field of tls config as they wish. SSL config also has some helpers such as SetCaPath, AddClientCertAndKeyPath to make configuration easier for users.
func NewSSLConfig ¶
func NewSSLConfig() SSLConfig
func (*SSLConfig) AddClientCertAndEncryptedKeyPath ¶
func (c *SSLConfig) AddClientCertAndEncryptedKeyPath(certPath string, privateKeyPath string, password string) error
AddClientCertAndEncryptedKeyPath decrypts the keyfile with the given password and adds client certificate path and the decrypted client private key to tls config. The files in the given paths must contain PEM encoded data. The key file should have a DEK-info header otherwise an error will be returned. In order to add multiple client certificate-key pairs one should call this function for each of them. If certificates is empty then no certificate will be sent to the server. If this is unacceptable to the server then it may abort the handshake. For mutual authentication at least one client certificate should be added. It returns an error if any of files cannot be loaded.
func (*SSLConfig) AddClientCertAndKeyPath ¶
func (c *SSLConfig) AddClientCertAndKeyPath(clientCertPath string, clientPrivateKeyPath string) error
AddClientCertAndKeyPath adds client certificate path and client private key path to tls config. The files in the given paths must contain PEM encoded data. In order to add multiple client certificate-key pairs one should call this function for each of them. If certificates is empty then no certificate will be sent to the server. If this is unacceptable to the server then it may abort the handshake. For mutual authentication at least one client certificate should be added. It returns an error if any of files cannot be loaded.
func (*SSLConfig) ResetTLSConfig ¶
type SecurityConfig ¶
func NewSecurityConfig ¶
func NewSecurityConfig() SecurityConfig
func (SecurityConfig) Clone ¶
func (c SecurityConfig) Clone() SecurityConfig
func (SecurityConfig) Validate ¶
func (c SecurityConfig) Validate() error