Documentation ¶
Index ¶
- Constants
- Variables
- type Address
- type AddressImpl
- type Config
- type EndpointQualifier
- type Member
- type MemberInfo
- func (mi MemberInfo) Address() Address
- func (mi MemberInfo) AddressMap() map[EndpointQualifier]Address
- func (mi MemberInfo) Attributes() map[string]string
- func (mi MemberInfo) LiteMember() bool
- func (mi MemberInfo) String() string
- func (mi MemberInfo) UUID() types.UUID
- func (mi MemberInfo) Version() MemberVersion
- 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 ¶
const ( DefaultHost = "localhost" DefaultPort = 5701 )
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 AddressImpl ¶
type AddressImpl struct {
// contains filtered or unexported fields
}
func NewAddress ¶
func NewAddress(host string, port int32) *AddressImpl
func NewAddressWithHostPort ¶
func NewAddressWithHostPort(host string, port int) *AddressImpl
TODO: merge this one with NewAddress
func (AddressImpl) Clone ¶
func (a AddressImpl) Clone() Address
func (AddressImpl) Host ¶
func (a AddressImpl) Host() string
func (AddressImpl) Port ¶
func (a AddressImpl) Port() int
func (AddressImpl) String ¶
func (a AddressImpl) String() string
type Config ¶
type Config struct { SecurityConfig SecurityConfig Name string SSLConfig SSLConfig Addrs []string HeartbeatInterval time.Duration HeartbeatTimeout time.Duration InvocationTimeout time.Duration ConnectionTimeout time.Duration 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 EndpointQualifier ¶
type Member ¶
type Member interface { fmt.Stringer // Addr returns the address of this member. Address() Address // UUID returns the uuid of this member. UUID() types.UUID // IsLiteMember returns true if this member is a lite member. LiteMember() bool // Attributes returns configured attributes for this member. Attributes() map[string]string }
Member represents a member in the cluster with its address, uuid, lite member status and attributes.
type MemberInfo ¶
type MemberInfo struct {
// contains filtered or unexported fields
}
MemberInfo represents a member in the cluster with its address, uuid, lite member status, attributes and version.
func NewMemberInfo ¶
func NewMemberInfo(address Address, uuid types.UUID, attributes map[string]string, liteMember bool, version MemberVersion, isAddressMapExists bool, addressMap interface{}) MemberInfo
func (MemberInfo) Address ¶
func (mi MemberInfo) Address() Address
func (MemberInfo) AddressMap ¶
func (mi MemberInfo) AddressMap() map[EndpointQualifier]Address
func (MemberInfo) Attributes ¶
func (mi MemberInfo) Attributes() map[string]string
func (MemberInfo) LiteMember ¶
func (mi MemberInfo) LiteMember() bool
func (MemberInfo) String ¶
func (mi MemberInfo) String() string
func (MemberInfo) UUID ¶
func (mi MemberInfo) UUID() types.UUID
func (MemberInfo) Version ¶
func (mi MemberInfo) Version() MemberVersion
type MemberVersion ¶
type MemberVersion struct {
// contains filtered or unexported fields
}
MemberVersion
func NewMemberVersion ¶
func NewMemberVersion(major, minor, patch byte) MemberVersion
func (MemberVersion) Major ¶
func (memberVersion MemberVersion) Major() byte
func (MemberVersion) Minor ¶
func (memberVersion MemberVersion) Minor() byte
func (MemberVersion) Patch ¶
func (memberVersion MemberVersion) Patch() byte
type MembershipState ¶
type MembershipState int
const ( MembershipStateAdded MembershipState = iota MembershipStateRemoved )
type MembershipStateChangeHandler ¶
type MembershipStateChangeHandler func(event MembershipStateChanged)
type MembershipStateChanged ¶
type MembershipStateChanged struct { Member Member 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