Files
HomeOps-Hub/agent/internal/utils/command_store/store.go
T
2026-06-17 16:52:30 +03:00

20 lines
343 B
Go

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
}