summaryrefslogtreecommitdiff
path: root/pkg/promises.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/promises.go')
-rw-r--r--pkg/promises.go50
1 files changed, 50 insertions, 0 deletions
diff --git a/pkg/promises.go b/pkg/promises.go
new file mode 100644
index 0000000..326d500
--- /dev/null
+++ b/pkg/promises.go
@@ -0,0 +1,50 @@
+package gonf
+
+type Promise interface {
+ IfRepaired(...Promise) Promise
+ Promise() Promise
+ Resolve()
+}
+
+//type Operation int
+//
+//const (
+// AND = iota
+// OR
+// NOT
+//)
+//
+//func (o Operation) String() string {
+// switch o {
+// case AND:
+// return "and"
+// case OR:
+// return "or"
+// case NOT:
+// return "not"
+// }
+// panic("unknown")
+//}
+
+type Status int
+
+const (
+ PROMISED = iota
+ BROKEN
+ KEPT
+ REPAIRED
+)
+
+func (s Status) String() string {
+ switch s {
+ case PROMISED:
+ return "promised"
+ case BROKEN:
+ return "broken"
+ case KEPT:
+ return "kept"
+ case REPAIRED:
+ return "repaired"
+ }
+ panic("unknown")
+}