mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 05:45:46 +00:00
f2902e6608
This commit adds a sameness-group config entry to the API and structs packages. It includes some validation logic and a new memdb index that tracks the default sameness-group for each partition. Sameness groups will simplify the effort of managing failovers / intentions / exports for peers and partitions. Note that this change purely to introduce the configuration entry and does not include the full functionality of sameness-groups.
26 lines
975 B
Go
26 lines
975 B
Go
package api
|
|
|
|
type SamenessGroupConfigEntry struct {
|
|
Kind string
|
|
Name string
|
|
Partition string `json:",omitempty"`
|
|
IsDefault bool `json:",omitempty" alias:"is_default"`
|
|
Members []SamenessGroupMember
|
|
Meta map[string]string `json:",omitempty"`
|
|
CreateIndex uint64
|
|
ModifyIndex uint64
|
|
}
|
|
|
|
type SamenessGroupMember struct {
|
|
Partition string
|
|
Peer string
|
|
}
|
|
|
|
func (s *SamenessGroupConfigEntry) GetKind() string { return s.Kind }
|
|
func (s *SamenessGroupConfigEntry) GetName() string { return s.Name }
|
|
func (s *SamenessGroupConfigEntry) GetPartition() string { return s.Partition }
|
|
func (s *SamenessGroupConfigEntry) GetNamespace() string { return "" }
|
|
func (s *SamenessGroupConfigEntry) GetCreateIndex() uint64 { return s.CreateIndex }
|
|
func (s *SamenessGroupConfigEntry) GetModifyIndex() uint64 { return s.ModifyIndex }
|
|
func (s *SamenessGroupConfigEntry) GetMeta() map[string]string { return s.Meta }
|