From 5122df790b77fb915c910e57de260e6ed0563af7 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Thu, 20 Feb 2020 08:11:27 +0000 Subject: initial background commands --- internal/server/background/commands.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 internal/server/background/commands.go (limited to 'internal/server/background/commands.go') diff --git a/internal/server/background/commands.go b/internal/server/background/commands.go new file mode 100644 index 0000000..f789150 --- /dev/null +++ b/internal/server/background/commands.go @@ -0,0 +1,28 @@ +package background + +import ( + "context" + "sync" +) + +type command struct { + cancel context.CancelFunc + done chan struct{} +} + +type Commands struct { + mutex sync.Mutex + commands map[string]command +} + +func NewCommands() *Commands { + return &Commands{ + commands: make(map[string]command), + } +} + +func (b Commands) Add(argc int, args []string, cancel context.CancelFunc, done <-chan struct{}) { +} + +func (h Commands) Stop(argc int, args []string) { +} -- cgit v1.2.3