ceph-csi/vendor/github.com/gemalto/kmip-go/op_destroy.go
Rakshith R e72ed593be rebase: vendor files required for kmip
Signed-off-by: Rakshith R <rar@redhat.com>
2022-08-18 07:41:42 +00:00

41 lines
791 B
Go

package kmip
import (
"context"
)
// DestroyRequestPayload ////////////////////////////////////////
//
type DestroyRequestPayload struct {
UniqueIdentifier string
}
// DestroyResponsePayload
type DestroyResponsePayload struct {
UniqueIdentifier string
}
type DestroyHandler struct {
Destroy func(ctx context.Context, payload *DestroyRequestPayload) (*DestroyResponsePayload, error)
}
func (h *DestroyHandler) HandleItem(ctx context.Context, req *Request) (*ResponseBatchItem, error) {
var payload DestroyRequestPayload
err := req.DecodePayload(&payload)
if err != nil {
return nil, err
}
respPayload, err := h.Destroy(ctx, &payload)
if err != nil {
return nil, err
}
// req.Key = respPayload.Key
return &ResponseBatchItem{
ResponsePayload: respPayload,
}, nil
}