func Setup()
Setup sets up MARS server
SharedData is shared and updated by any server node in Diarkis cluster. The number of shared data entry is limited and dictated by util.SharedDataLimitLength
type SharedData struct { sync.RWMutex // contains filtered or unexported fields }
func NewSharedData() *SharedData
NewSharedData creates a new SharedData instance.
func (sd *SharedData) EncodeSharedData() []byte
EncodeSharedData encodes the SharedData value into a byte array.
func (sd *SharedData) FlushRemovedKeys() map[string]int16
FlushRemovedKeys flushes out removed keys from the memory.
func (sd *SharedData) GetSharedData() map[string]interface{}
GetSharedData returns the value of SharedData.
func (sd *SharedData) Update(key string, value interface{}, set bool) bool
Update changes SharedData value and propagate the change to all pods in the cluster. Update does not change the value atomically therefore it may suffer from race condition.