refactor: move http api to a new transport layer
This commit is contained in:
parent
476c4b056f
commit
0448f66ab2
41 changed files with 822 additions and 390 deletions
35
internal/app/state.go
Normal file
35
internal/app/state.go
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
package app
|
||||
|
||||
import (
|
||||
"git.wzray.com/homelab/hivemind/internal/registry"
|
||||
"git.wzray.com/homelab/hivemind/internal/transport/dns"
|
||||
"git.wzray.com/homelab/hivemind/internal/transport/host"
|
||||
"git.wzray.com/homelab/hivemind/internal/transport/master"
|
||||
"git.wzray.com/homelab/hivemind/internal/transport/node"
|
||||
"git.wzray.com/homelab/hivemind/internal/types"
|
||||
)
|
||||
|
||||
type Clients struct {
|
||||
Master *master.Client
|
||||
DNS *dns.Client
|
||||
Host *host.Client
|
||||
Node *node.Client
|
||||
}
|
||||
|
||||
type State struct {
|
||||
Registry *registry.Registry
|
||||
Self types.Node
|
||||
Clients Clients
|
||||
}
|
||||
|
||||
func NewState(
|
||||
registry *registry.Registry,
|
||||
self types.Node,
|
||||
clients Clients,
|
||||
) *State {
|
||||
return &State{
|
||||
Registry: registry,
|
||||
Self: self,
|
||||
Clients: clients,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue