Documentation ¶
Index ¶
Constants ¶
const ( // MemcachedDefaultSetValue will be used if the "Set" check method is enabled // and "MemcachedSetOptions.Value" is _not_ set. MemcachedDefaultSetValue = "go-health/memcached-check" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Memcached ¶
type Memcached struct { Config *MemcachedConfig // contains filtered or unexported fields }
func NewMemcached ¶
func NewMemcached(cfg *MemcachedConfig) (*Memcached, error)
type MemcachedClient ¶
type MemcachedClientWrapper ¶
type MemcachedClientWrapper struct {
MemcachedClient
}
Used to simplify testing routines
func (MemcachedClientWrapper) GetClient ¶
func (mcw MemcachedClientWrapper) GetClient() MemcachedClient
type MemcachedConfig ¶
type MemcachedConfig struct { Url string Timeout int32 Ping bool Set *MemcachedSetOptions Get *MemcachedGetOptions }
MongoConfig is used for configuring the go-mongo check.
"Url" is _required_; memcached connection url, format is "10.0.0.1:11011". Port (:11011) is mandatory "Timeout" defines timeout for socket write/read (useful for servers hosted on different machine) "Ping" is optional; Ping establishes tcp connection to memcached server.
type MemcachedGetOptions ¶
MemcachedGetOptions contains attributes that can alter the behavior of the memcached "GET" check.
"Key" is _required_; the name of the key that we are attempting to "GET".
"Expect" is optional; optionally verify that the value for the key matches the Expect value.
"NoErrorMissingKey" is optional; by default, the "GET" check will error if the key we are fetching does not exist; flip this bool if that is normal/expected/ok.
type MemcachedSetOptions ¶
MemcachedSetOptions contains attributes that can alter the behavior of the memcached "SET" check.
"Key" is _required_; the name of the key we are attempting to "SET".
"Value" is optional; what the value should hold; if not set, it will be set to "MemcachedDefaultSetValue".
"Expiration" is optional; if set, a TTL will be attached to the key.