Compare commits
No commits in common. "0d90395eefa97e0ab020f024dd50cedcc0063801" and "2af9e734ddcce39a5794a1348e061bbce2210e35" have entirely different histories.
0d90395eef
...
2af9e734dd
3 changed files with 7 additions and 12 deletions
7
cmd/hivemind-lite/main.go
Normal file
7
cmd/hivemind-lite/main.go
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import "fmt"
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Println("hivemind lite")
|
||||||
|
}
|
||||||
|
|
@ -9,9 +9,6 @@ import (
|
||||||
"github.com/BurntSushi/toml"
|
"github.com/BurntSushi/toml"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO: make all configs have a codegen verification and merging
|
|
||||||
// assume that 0 and "" are invalid values, i.e. use -1 for unset
|
|
||||||
|
|
||||||
type Configs struct {
|
type Configs struct {
|
||||||
Master MasterConfig
|
Master MasterConfig
|
||||||
Dns DnsConfig
|
Dns DnsConfig
|
||||||
|
|
|
||||||
|
|
@ -123,15 +123,6 @@ func (r *Registry) RemoveNode(node types.Node) error {
|
||||||
|
|
||||||
func (r *Registry) Set(nodes map[string]types.Node) error {
|
func (r *Registry) Set(nodes map[string]types.Node) error {
|
||||||
r.lock.Lock()
|
r.lock.Lock()
|
||||||
equalFunc := func(a, b types.Node) bool {
|
|
||||||
return a.Hostname == b.Hostname
|
|
||||||
}
|
|
||||||
|
|
||||||
if maps.EqualFunc(r.nodes, nodes, equalFunc) {
|
|
||||||
r.lock.Unlock()
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
r.nodes = maps.Clone(nodes)
|
r.nodes = maps.Clone(nodes)
|
||||||
snapshot := r.snapshot()
|
snapshot := r.snapshot()
|
||||||
r.lock.Unlock()
|
r.lock.Unlock()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue