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
20
internal/transport/dns/client.go
Normal file
20
internal/transport/dns/client.go
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
package dns
|
||||
|
||||
import (
|
||||
"git.wzray.com/homelab/hivemind/internal/transport"
|
||||
"git.wzray.com/homelab/hivemind/internal/types"
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
caller transport.Caller
|
||||
}
|
||||
|
||||
func New(caller transport.Caller) *Client {
|
||||
return &Client{
|
||||
caller: caller,
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Client) Callback(endpoint string, state types.HostState) (bool, error) {
|
||||
return callbackRoute.Call(c.caller, endpoint, state)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue