mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-22 14:20:19 +00:00
0f2daca5c2
The new release has some important fixes available with it Ref: https://github.com/ThalesGroup/kmip-go/releases/tag/v0.0.8 Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
40 lines
788 B
Go
40 lines
788 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
|
|
}
|