// 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 (
	CreateEventType = "UserFollowUserCreate"
)

type Create = UserFollowUserCreate

type UserFollowUserCreateHandler func(context.Context, *eventbus.Header, *UserFollowUserCreate) error

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

func RegisterUserFollowUserCreateHandler(mux *eventbus.Mux, f UserFollowUserCreateHandler) {
	mux.RegisterHandler(CreateEventType, f.Handler())
}

func RegisterCreateHandler(mux *eventbus.Mux, f UserFollowUserCreateHandler) {
	RegisterUserFollowUserCreateHandler(mux, f)
}

func (*UserFollowUserCreate) EventBusName() string {
	return CreateEventType
}
