Consitently use Machine pointers
This commit rewrites a bunch of the code to always use *Machine instead of a mix of both, and a mix of tailcfg.Node and Machine. Now we use *Machine, and if tailcfg.Node is needed, it is converted just before needed.
This commit is contained in:
parent
0475eb6ef7
commit
0d4a006536
5 changed files with 58 additions and 61 deletions
4
api.go
4
api.go
|
@ -213,7 +213,7 @@ func (h *Headscale) RegistrationHandler(c *gin.Context) {
|
|||
c.Data(200, "application/json; charset=utf-8", respBody)
|
||||
}
|
||||
|
||||
func (h *Headscale) getMapResponse(mKey wgkey.Key, req tailcfg.MapRequest, m Machine) (*[]byte, error) {
|
||||
func (h *Headscale) getMapResponse(mKey wgkey.Key, req tailcfg.MapRequest, m *Machine) (*[]byte, error) {
|
||||
log.Trace().
|
||||
Str("func", "getMapResponse").
|
||||
Str("machine", req.Hostinfo.Hostname).
|
||||
|
@ -286,7 +286,7 @@ func (h *Headscale) getMapResponse(mKey wgkey.Key, req tailcfg.MapRequest, m Mac
|
|||
return &data, nil
|
||||
}
|
||||
|
||||
func (h *Headscale) getMapKeepAliveResponse(mKey wgkey.Key, req tailcfg.MapRequest, m Machine) (*[]byte, error) {
|
||||
func (h *Headscale) getMapKeepAliveResponse(mKey wgkey.Key, req tailcfg.MapRequest, m *Machine) (*[]byte, error) {
|
||||
resp := tailcfg.MapResponse{
|
||||
KeepAlive: true,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue