func (o *Operation) registerHandler() {
	o.handlers = []rest.Handler{
		cmdutil.NewHTTPHandler(RegisterMsgService, http.MethodPost, o.RegisterService),
		cmdutil.NewHTTPHandler(UnregisterMsgService, http.MethodPost, o.UnregisterService),
		cmdutil.NewHTTPHandler(MsgServiceList, http.MethodGet, o.Services),
		cmdutil.NewHTTPHandler(SendNewMsg, http.MethodPost, o.Send),
		cmdutil.NewHTTPHandler(SendReplyMsg, http.MethodPost, o.Reply),
		cmdutil.NewHTTPHandler(RegisterHTTPOverDIDCommService, http.MethodPost, o.RegisterHTTPService),
	}
}
registerHandler register handlers to be exposed from this protocol service as REST API endpoints.
package messaging
import (
	"fmt"
	"net/http"
	"github.com/hyperledger/aries-framework-go/pkg/controller/command"
	"github.com/hyperledger/aries-framework-go/pkg/controller/command/messaging"
	"github.com/hyperledger/aries-framework-go/pkg/controller/internal/cmdutil"
	"github.com/hyperledger/aries-framework-go/pkg/controller/rest"
	"github.com/hyperledger/aries-framework-go/pkg/didcomm/common/service"
	"github.com/hyperledger/aries-framework-go/pkg/framework/aries/api/vdr"
	"github.com/hyperledger/aries-framework-go/pkg/kms"
	"github.com/hyperledger/aries-framework-go/spi/storage"
)
const (
	httpOverDIDComm                = "/http-over-didcomm"
	RegisterHTTPOverDIDCommService = httpOverDIDComm + "/register"
	MsgServiceOperationID = "/message"
	RegisterMsgService    = MsgServiceOperationID + "/register-service"
	UnregisterMsgService  = MsgServiceOperationID + "/unregister-service"
	MsgServiceList        = MsgServiceOperationID + "/services"
	SendNewMsg            = MsgServiceOperationID + "/send"
	SendReplyMsg          = MsgServiceOperationID + "/reply"
)
type provider interface {
	VDRegistry() vdr.Registry
	Messenger() service.Messenger
	ProtocolStateStorageProvider() storage.Provider
	StorageProvider() storage.Provider
	KMS() kms.KeyManager
}
type Operation struct {
	command  *messaging.Command
	handlers []rest.Handler
}
func New(ctx provider, registrar command.MessageHandler, notifier command.Notifier) (*Operation, error) {
	msgcmd, err := messaging.New(ctx, registrar, notifier)
	if err != nil {
		return nil, fmt.Errorf("failed to create messaging controller command: %w", err)
	}
	o := &Operation{command: msgcmd}
	o.registerHandler()
	return o, nil
}
func (o *Operation) GetRESTHandlers() []rest.Handler {
	return o.handlers
}