summaryrefslogtreecommitdiff
path: root/vendor/src/github.com/coreos/go-systemd/dbus/set.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/src/github.com/coreos/go-systemd/dbus/set.go')
-rw-r--r--vendor/src/github.com/coreos/go-systemd/dbus/set.go26
1 files changed, 26 insertions, 0 deletions
diff --git a/vendor/src/github.com/coreos/go-systemd/dbus/set.go b/vendor/src/github.com/coreos/go-systemd/dbus/set.go
new file mode 100644
index 0000000000..88378b29a1
--- /dev/null
+++ b/vendor/src/github.com/coreos/go-systemd/dbus/set.go
@@ -0,0 +1,26 @@
+package dbus
+
+type set struct {
+ data map[string]bool
+}
+
+func (s *set) Add(value string) {
+ s.data[value] = true
+}
+
+func (s *set) Remove(value string) {
+ delete(s.data, value)
+}
+
+func (s *set) Contains(value string) (exists bool) {
+ _, exists = s.data[value]
+ return
+}
+
+func (s *set) Length() (int) {
+ return len(s.data)
+}
+
+func newSet() (*set) {
+ return &set{make(map[string] bool)}
+}