From 102816ac7f64077c73a0fc3a51594e8666e4e826 Mon Sep 17 00:00:00 2001 From: Armon Dadgar Date: Wed, 7 Jan 2015 14:01:27 -0800 Subject: [PATCH] api: Adding constants for session behaviors --- api/session.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/session.go b/api/session.go index 02306e8a5..e889bbe0d 100644 --- a/api/session.go +++ b/api/session.go @@ -4,6 +4,17 @@ import ( "time" ) +const ( + // SessionBehaviorRelease is the default behavior and causes + // all associated locks to be released on session invalidation. + SessionBehaviorRelease = "release" + + // SessionBehaviorDelete is new in Consul 0.5 and changes the + // behavior to delete all associated locks on session invalidation. + // It can be used in a way similar to Ephemeral Nodes in ZooKeeper. + SessionBehaviorDelete = "delete" +) + // SessionEntry represents a session in consul type SessionEntry struct { CreateIndex uint64