refactor: sync

This commit is contained in:
2026-06-17 16:52:30 +03:00
parent 8d3509b2d8
commit 5f72d2dcb4
17 changed files with 105 additions and 44 deletions
@@ -0,0 +1,19 @@
package command_store
import (
"sync"
"github.com/lorsanstand/HomeOps-Hub/agent/internal/domain"
)
type CommandStore struct {
mutex sync.RWMutex
store map[string]*domain.Command
}
func (c *CommandStore) Get(name string) (*domain.Command, bool) {
c.mutex.RLock()
function, ok := c.store[name]
c.mutex.Unlock()
return function, ok
}