grim/convey

Add state documentation.
cleanup-on-signal
2017-10-11, Eric Fritz
82ebdcf95c48
Parents b5b85405beca
Children b42db46c6621
Add state documentation.
--- a/state/state.go Wed Oct 11 22:04:33 2017 -0500
+++ b/state/state.go Wed Oct 11 22:05:18 2017 -0500
@@ -225,6 +225,10 @@
}
}
+// MarkRunning will add the given container name into the list
+// of containers currently running. This falls through directly to
+// the root state so that states wrapping the global one do not have
+// to sync additional running container names.
func (st *State) MarkRunning(name string) {
if st.parent != nil {
st.parent.MarkRunning(name)
@@ -236,6 +240,7 @@
st.runningContainers[name] = struct{}{}
}
+// UnmarkRunning removes a container from the list of running containers.
func (st *State) UnmarkRunning(name string) {
if st.parent != nil {
st.parent.UnmarkRunning(name)
@@ -247,6 +252,7 @@
delete(st.runningContainers, name)
}
+// GetRunning returns a list of all running containers.
func (st *State) GetRunning() []string {
if st.parent != nil {
return st.parent.GetRunning()