From 560becfd32dd7355547938f3c6229060dd395aab Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Thu, 7 Mar 2024 00:54:35 +0100 Subject: chore(repo): renamed gonf subfolder to something more traditional in go land --- pkg/promises.go | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 pkg/promises.go (limited to 'pkg/promises.go') 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") +} -- cgit v1.2.3