fleet/server/transport_sessions.go
2016-09-05 16:03:58 -04:00

40 lines
968 B
Go

package server
import (
"net/http"
"golang.org/x/net/context"
)
func decodeGetInfoAboutSessionRequest(ctx context.Context, r *http.Request) (interface{}, error) {
id, err := idFromRequest(r, "id")
if err != nil {
return nil, err
}
return getInfoAboutSessionRequest{ID: id}, nil
}
func decodeGetInfoAboutSessionsForUserRequest(ctx context.Context, r *http.Request) (interface{}, error) {
id, err := idFromRequest(r, "id")
if err != nil {
return nil, err
}
return getInfoAboutSessionsForUserRequest{ID: id}, nil
}
func decodeDeleteSessionRequest(ctx context.Context, r *http.Request) (interface{}, error) {
id, err := idFromRequest(r, "id")
if err != nil {
return nil, err
}
return deleteSessionRequest{ID: id}, nil
}
func decodeDeleteSessionsForUserRequest(ctx context.Context, r *http.Request) (interface{}, error) {
id, err := idFromRequest(r, "id")
if err != nil {
return nil, err
}
return deleteSessionsForUserRequest{ID: id}, nil
}