package consul
- Alphabetic
- By Inheritance
- consul
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
trait
Candidate
extends AnyRef
Represents a candidate in the leader election
-
class
Consul
extends AnyRef
Encapsulates functions towards Consul.
-
case class
ConsulHost
(host: String, port: Int = 8500) extends Product with Serializable
Connection information to a Consul instance
Connection information to a Consul instance
- host
The host
- port
Optional port (default 8500)
-
case class
DeleteKeyValue
(key: String, compareAndSet: Option[Int] = None, recursive: Boolean = false) extends Product with Serializable
Data for deleting a key/value
Data for deleting a key/value
- key
The name/path of the key (e.g. foo/bar/my-data)
- compareAndSet
Will only delete the key/value of this value matches the ModifyIndex of the key stored in Consul
- recursive
If all key/values in the provided path shall be deleted
-
trait
ElectionObserver
extends AnyRef
Observer to be notified for changes in election state.
-
case class
GetKeyValue
(key: String, modifyIndex: Option[Int] = None, maxWait: Option[FiniteDuration] = None, recursive: Boolean = false) extends Product with Serializable
Data for setting a key/value
Data for setting a key/value
- key
The name/path of the key (e.g. foo/bar/my-data)
- modifyIndex
Optional modification index value to block on
- maxWait
Optional max wait time, used in conjunction with modifyIndex
-
case class
KeyValue
(createIndex: Int, modifyIndex: Int, lockIndex: Int, key: String, value: Option[String], session: Option[String]) extends Product with Serializable
Represents a key/value stored in Consul
Represents a key/value stored in Consul
- createIndex
The CreateIndex value as stored in Consul
- modifyIndex
The ModifyIndex value as stored in Consul
- lockIndex
The LockIndex value as stored in Consul
- key
The name/path of the key
- value
The value in plain string format already Base64 decoded
- session
Optional owner (session ÍD) of the key
-
class
Semaphore
extends AnyRef
A semaphore is a construction to control access to a common resource in a concurrent system.
A semaphore is a construction to control access to a common resource in a concurrent system. The semaphore in this library allows for creation of a distributed lock. In principle a semaphore is initiated with 1..n permits, instances of a semaphore then try to acquire one permit either succeeding or failing in case there are no more permits left to take. The simplest form is a binary semaphore which has only one permit thus only allowing a single instance to acquire a permit. Semaphores are traditionally used to control access to a protected source like a database or some task that only should be executed by a single process.
Each instance of the Semaphore class can hold exactly 0 or 1 permit thus invoking any of the tryAcquire functions mulitple times will not acquire additional permits.
-
case class
SemaphoreDestroyed
(name: String) extends Exception with Product with Serializable
Indicates that the .destroy method has been invoked on semaphore
Indicates that the .destroy method has been invoked on semaphore
- name
The name of the semaphore
-
case class
Session
(name: Option[String] = None, lockDelay: Option[FiniteDuration] = None, node: Option[String] = None, behavior: Option[String] = None, ttl: Option[FiniteDuration] = None) extends Product with Serializable
Represents stored session data in Consul
Represents stored session data in Consul
- name
Optional name of the session
- lockDelay
Optional lock delay
- node
Optional Consul node for the session
- behavior
Optional behavior of the session
- ttl
Optional Time-To-Live of the session, not providing this will in practice be a session that never times out
- type SessionID = String
-
case class
SetKeyValue
(key: String, value: Option[String] = None, compareAndSet: Option[Int] = None, acquire: Option[SessionID] = None, release: Option[SessionID] = None) extends Product with Serializable
Data for setting a key/value
Data for setting a key/value
- key
The name/path of the key (e.g. foo/bar/my-data)
- value
Optional value of the key/data
- compareAndSet
Will only write the key/value of this value matches the ModifyIndex of the key stored in Consul
- acquire
Attempts to take a lock on the key using the provided session ID
- release
Attempts to release a lock on the key using the provided session ID