Documentation
¶
Index ¶
- Variables
- type HazelcastProperties
- func (hp *HazelcastProperties) GetBoolean(property *HazelcastProperty) bool
- func (hp *HazelcastProperties) GetDuration(property *HazelcastProperty) time.Duration
- func (hp *HazelcastProperties) GetPositiveDurationOrDef(property *HazelcastProperty) time.Duration
- func (hp *HazelcastProperties) GetString(property *HazelcastProperty) string
- type HazelcastProperty
- func NewHazelcastProperty(name string) *HazelcastProperty
- func NewHazelcastPropertyBool(name string, defaultValue bool) *HazelcastProperty
- func NewHazelcastPropertyInt64WithTimeUnit(name string, defaultValue int64, timeUnit time.Duration) *HazelcastProperty
- func NewHazelcastPropertyString(name string, defaultValue string) *HazelcastProperty
Constants ¶
This section is empty.
Variables ¶
var ( // HeartbeatTimeout is the duration for client sending heartbeat messages to the members. // If there is not any message passing between the client and member within the given time via this property, // the connection will be closed. HeartbeatTimeout = NewHazelcastPropertyInt64WithTimeUnit("hazelcast.client.heartbeat.timeout", 60000, time.Millisecond) // HeartbeatInterval is the time interval between the heartbeats sent by the client to the nodes. HeartbeatInterval = NewHazelcastPropertyInt64WithTimeUnit("hazelcast.client.heartbeat.interval", 5000, time.Millisecond) // InvocationTimeoutSeconds is used when an invocation gets an error because : // * Member throws an exception. // * Connection between the client and member is closed. // * Client's heartbeat requests are timed out. // Time passed since invocation started is compared with this property. // If the time is already passed, then the error is delegated to the user. If not, the invocation is retried. // Note that, if invocation gets no error and it is a long running one, then it will not get any error, // no matter how small this timeout is set. InvocationTimeoutSeconds = NewHazelcastPropertyInt64WithTimeUnit("hazelcast.client.invocation.timeout.seconds", 120, time.Second) // InvocationRetryPause time is the pause time between each retry cycle of an invocation in milliseconds. InvocationRetryPause = NewHazelcastPropertyInt64WithTimeUnit("hazelcast.client.invocation.retry.pause.millis", 1000, time.Millisecond) // HazelcastCloudDiscoveryToken is a token to use discovering cluster via hazelcast.cloud. HazelcastCloudDiscoveryToken = NewHazelcastProperty("hazelcast.client.cloud.discovery.token") // StatisticsPeriodSeconds is the period in seconds to collect statistics. StatisticsPeriodSeconds = NewHazelcastPropertyInt64WithTimeUnit("hazelcast.client.statistics.period.seconds", 3, time.Second) // StatisticsEnabled is used to enable the client statistics collection. StatisticsEnabled = NewHazelcastPropertyBool("hazelcast.client.statistics.enabled", false) // LoggingLevel is used to configure logging level in the client. // This is used only for default logging, if you use other loggers this has no effect. LoggingLevel = NewHazelcastPropertyString("hazelcast.client.logging.level", "info") )
Functions ¶
This section is empty.
Types ¶
type HazelcastProperties ¶
type HazelcastProperties struct {
// contains filtered or unexported fields
}
HazelcastProperties is a container for configured Hazelcast properties. A Hazelcast property can be set via:
- an environmental variable
- programmatic configuration Config.SetProperty
func NewHazelcastProperties ¶
func NewHazelcastProperties(properties config.Properties) *HazelcastProperties
NewHazelcastProperties returns HazelcastProperties with the given properties.
func (*HazelcastProperties) GetBoolean ¶
func (hp *HazelcastProperties) GetBoolean(property *HazelcastProperty) bool
GetBoolean returns the boolean value of the given property. It returns true if the value is equal to "true" (case-insensitive).
func (*HazelcastProperties) GetDuration ¶
func (hp *HazelcastProperties) GetDuration(property *HazelcastProperty) time.Duration
GetDuration returns the time duration from the given property. It returns the default value if the set time duration cannot be parsed. It panics if the set and default values cannot be parsed to time.Duration.
func (*HazelcastProperties) GetPositiveDurationOrDef ¶
func (hp *HazelcastProperties) GetPositiveDurationOrDef(property *HazelcastProperty) time.Duration
GetPositiveDurationOrDef returns the time duration as GetDuration except it returns the default value if the set time duration is a non-positive value.
func (*HazelcastProperties) GetString ¶
func (hp *HazelcastProperties) GetString(property *HazelcastProperty) string
GetString returns the value for the given property. It first checks config, then environment variables, and lastly if it is not found in those it returns the default value.
type HazelcastProperty ¶
type HazelcastProperty struct {
// contains filtered or unexported fields
}
HazelcastProperty is a struct for client properties.
func NewHazelcastProperty ¶
func NewHazelcastProperty(name string) *HazelcastProperty
NewHazelcastProperty returns a Hazelcast property with the given name.
func NewHazelcastPropertyBool ¶
func NewHazelcastPropertyBool(name string, defaultValue bool) *HazelcastProperty
NewHazelcastPropertyBool returns a Hazelcast property with the given defaultValue.
func NewHazelcastPropertyInt64WithTimeUnit ¶
func NewHazelcastPropertyInt64WithTimeUnit(name string, defaultValue int64, timeUnit time.Duration) *HazelcastProperty
func NewHazelcastPropertyString ¶
func NewHazelcastPropertyString(name string, defaultValue string) *HazelcastProperty
NewHazelcastPropertyString returns a Hazelcast property with the given defaultValue.
func (*HazelcastProperty) DefaultValue ¶
func (h *HazelcastProperty) DefaultValue() string
DefaultValue returns the default value of this Hazelcast property.
func (*HazelcastProperty) Name ¶
func (h *HazelcastProperty) Name() string
Name returns the name of this Hazelcast property.
func (*HazelcastProperty) SetName ¶
func (h *HazelcastProperty) SetName(name string)
SetName sets the name of this Hazelcast property as the given name.
func (*HazelcastProperty) String ¶
func (h *HazelcastProperty) String() string
func (*HazelcastProperty) TimeUnit ¶
func (h *HazelcastProperty) TimeUnit() time.Duration
TimeUnit returns the time unit for this property.