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

import (
	"errors"
	"plugin"
	"strings"

	"github.com/fagongzi/gateway/pkg/filter"
)

var (
	// ErrUnknownFilter unknown filter error
	ErrUnknownFilter = errors.New("unknown filter")
)

const (
	// FilterPrepare prepare filter
	FilterPrepare =
    
func (p *Proxy) newFilter(filterSpec *FilterSpec) (filter.Filter, error) {
	if filterSpec.External {
		return newExternalFilter(filterSpec)
	}

	input := strings.ToUpper(filterSpec.Name)

	switch input {
	case FilterPrepare:
		return newPrepareFilter(), nil
	case FilterHTTPAccess:
		return newAccessFilter(), nil
	case FilterHeader:
		return newHeadersFilter(), nil
	case FilterXForward:
		return newXForwardForFilter(), nil
	case FilterAnalysis:
		return newAnalysisFilter(), nil
	case FilterBlackList:
		return newBlackListFilter(), nil
	case FilterWhiteList:
		return newWhiteListFilter(), nil
	case FilterRateLimiting:
		return newRateLimitingFilter(), nil
	case FilterCircuitBreake:
		return newCircuitBreakeFilter(), nil
	case FilterValidation:
		return newValidationFilter(), nil
	case FilterCaching:
		return newCachingFilter(p.cfg.Option.LimitBytesCaching, p.dispatcher.tw), nil
	case FilterJWT:
		return newJWTFilter(p.cfg.Option.JWTCfgFile)
	case FilterCross:
		return newCrossDomainFilter(p.cfg.Option.CrossCfgFile)
	case FilterJSPlugin:
		return p.jsEngine, nil
	default:
		return nil, ErrUnknownFilter
	}
}