func (t *TaskGroup) GetAllTaskIDs() []string {
	ids := make([]string, 0)
	for id := range t.Tasks {
		ids = append(ids, id)
	}
	return ids
}
GetAllTaskIDs gets all task ids
package task
import (
	"errors"
	"github.com/lithammer/shortuuid"
	"sync"
)
var (
	taskGroupMutex = sync.RWMutex{}
	TaskGroupDoesNotExistErr = errors.New("task group does not exist")
	taskGroups = make(map[string]*TaskGroup)
)
func DoesTaskGroupExist(id string) bool {
	taskGroupMutex.RLock()
	defer taskGroupMutex.RUnlock()
	_, ok := taskGroups[id]
	return ok
}
func CreateTaskGroup(name string) string {
	taskGroupMutex.Lock()
	defer taskGroupMutex.Unlock()
	id := shortuuid.New()
	taskGroups[id] = &TaskGroup{
		Name:  name,
		ID:    id,
		Tasks: make(map[string]bool),
	}
	return id
}
func RemoveTaskGroup(id string) error {
	if !DoesTaskGroupExist(id) {
		return TaskGroupDoesNotExistErr
	}
	taskGroupMutex.Lock()
	defer taskGroupMutex.Unlock()
	delete(taskGroups, id)
	return nil
}
func GetTaskGroup(id string) (*TaskGroup, error) {
	if !DoesTaskGroupExist(id) {
		return &TaskGroup{}, TaskGroupDoesNotExistErr
	}
	taskGroupMutex.RLock()
	defer taskGroupMutex.RUnlock()
	return taskGroups[id], nil
}
func GetTaskIDs(id string) ([]string, error) {
	if !DoesTaskGroupExist(id) {
		return []string{}, TaskGroupDoesNotExistErr
	}
	taskGroupMutex.RLock()
	defer taskGroupMutex.RUnlock()
	ids := make([]string, 0)
	taskGroup := taskGroups[id]
	for id := range taskGroup.Tasks {
		ids = append(ids, id)
	}
	return ids, nil
}
func GetAllTaskGroupIDs() []string {
	taskGroupMutex.RLock()
	defer taskGroupMutex.RUnlock()
	ids := make([]string, 0)
	for id := range taskGroups {
		ids = append(ids, id)
	}
	return ids
}