package models import "sync" type DMX struct { Data []byte mu sync.Mutex } func NewDMXUniverse() *DMX { return &DMX{ Data: make([]byte, 512), } } func (d *DMX) GetDMXData() (data []byte) { d.mu.Lock() data = d.Data d.mu.Unlock() return data } func (d *DMX) SetValue(channel uint, value uint8) { d.mu.Lock() d.Data[channel] = value d.mu.Unlock() }