32 lines
785 B
Go
32 lines
785 B
Go
package handler
|
|
|
|
import (
|
|
"context"
|
|
|
|
"mbase/pkg/mbctl"
|
|
)
|
|
|
|
func (hand *Handler) GetDump(ctx context.Context, params *mbctl.GetDumpParams) (*mbctl.GetDumpResult, error) {
|
|
var err error
|
|
hand.log.Debugf("Handle GetDump call")
|
|
res := &mbctl.GetDumpResult{}
|
|
accountID, err := hand.Authentificate(ctx)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
res, err = hand.oper.GetDump(ctx, accountID, params)
|
|
return res, err
|
|
}
|
|
|
|
func (hand *Handler) RestoreDump(ctx context.Context, params *mbctl.RestoreDumpParams) (*mbctl.RestoreDumpResult, error) {
|
|
var err error
|
|
hand.log.Debugf("Handle GetDump call")
|
|
res := &mbctl.RestoreDumpResult{}
|
|
accountID, err := hand.Authentificate(ctx)
|
|
if err != nil {
|
|
return res, err
|
|
}
|
|
res, err = hand.oper.RestoreDump(ctx, accountID, params)
|
|
return res, err
|
|
}
|