// NOTE this is a generated file! do not edit!

package user_follow_user

import (
	"context"

	"github.com/golang/protobuf/proto"

	eventbus "code.justin.tv/eventbus/client"
)

const (
	DeleteEventType = "UserFollowUserDelete"
)

type Delete = UserFollowUserDelete

type UserFollowUserDeleteHandler func(context.Context, *eventbus.Header, *UserFollowUserDelete) error

func (h UserFollowUserDeleteHandler) Handler() eventbus.Handler {
	return func(ctx context.Context, message eventbus.RawMessage) error {
		dst := &UserFollowUserDelete{}
		err := proto.Unmarshal(message.Payload, dst)
		if err != nil {
			return err
		}
		return h(ctx, message.Header, dst)
	}
}

func RegisterUserFollowUserDeleteHandler(mux *eventbus.Mux, f UserFollowUserDeleteHandler) {
	mux.RegisterHandler(DeleteEventType, f.Handler())
}

func RegisterDeleteHandler(mux *eventbus.Mux, f UserFollowUserDeleteHandler) {
	RegisterUserFollowUserDeleteHandler(mux, f)
}

func (*UserFollowUserDelete) EventBusName() string {
	return DeleteEventType
}
