fleet/server/service/transport_hosts.go
Zachary Wasserman 85a8e92b96 Implement endpoints for host service methods (#280)
- Remove service methods for modifying hosts
2016-10-05 17:10:44 -07:00

24 lines
473 B
Go

package service
import (
"net/http"
"golang.org/x/net/context"
)
func decodeGetHostRequest(ctx context.Context, r *http.Request) (interface{}, error) {
id, err := idFromRequest(r, "id")
if err != nil {
return nil, err
}
return getHostRequest{ID: id}, nil
}
func decodeDeleteHostRequest(ctx context.Context, r *http.Request) (interface{}, error) {
id, err := idFromRequest(r, "id")
if err != nil {
return nil, err
}
return deleteHostRequest{ID: id}, nil
}