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: verifier.go
    path of file: ./repos/convoy/pkg/verifier
    
    the code of the file until where you have to start completion: package verifier

import (
	"crypto/hmac"
	"crypto/sha256"
	"crypto/sha512"
	"encoding/base64"
	"encoding/hex"
	"errors"
	"hash"
	"net/http"
	"strings"
)

var (
	ErrAlgoNotFound                       = errors.New("Algorithm not found")
	ErrInvalidIP                          = errors.New("Source IP not supported")
	ErrCannotReadRequest
    
func (aV *APIKeyVerifier) VerifyRequest(r *http.Request, payload []byte) error {
	authHeader := "Authorization"

	if len(strings.TrimSpace(aV.header)) != 0 {
		authHeader = aV.header
		val := r.Header.Get(authHeader)

		if len(strings.TrimSpace(val)) == 0 {
			return ErrAuthHeader
		}

		if val != aV.key {
			return ErrAuthHeader
		}

		return nil
	}

	val := r.Header.Get(authHeader)
	authInfo := strings.Split(val, " ")

	if len(authInfo) != 2 {
		return ErrInvalidHeaderStructure
	}

	if authInfo[1] != aV.key {
		return ErrAuthHeader
	}

	return nil
}