You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: iterator-ender.go
    path of file: ./repos/openreplay/backend/pkg/messages
    
    the code of the file until where you have to start completion: package messages

type enderIteratorImpl struct {
	coreIterator MessageIterator
	handler      MessageHandler
	lastMessage  Message
}

func NewEnderMessageIterator(messageHandler MessageHandler, messageFilter []int, autoDecode bool) Mes
    
func (e *enderIteratorImpl) Iterate(batchData []byte, batchInfo *BatchInfo) {
	// Reset last message
	e.lastMessage = nil
	// Call core iterator
	e.coreIterator.Iterate(batchData, batchInfo)
	// Call handler if last message is not nil
	if e.lastMessage != nil {
		e.handler(e.lastMessage)
	}
}