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

import (
	"fmt"
	"regexp"

	"github.com/fagongzi/gateway/pkg/expr"
	"github.com/fagongzi/gateway/pkg/pb/metapb"
	"github.com/fagongzi/gateway/pkg/plugin"
)

// ValidateRouting validate routing
func ValidateRouting(value *metapb.Routing) error {
	if value.API == 0 {
		return fmt.Errorf("missing api")
	}

	if value.ClusterID == 0 {
		return fmt.Errorf("missing cluster")
	}

	if value.Name == "" {
		return fmt.Errorf("missing name
    
func ValidateAPI(value *metapb.API) error {
	if value.Name == "" {
		return fmt.Errorf("missing api name")
	}

	if value.URLPattern == "" {
		return fmt.Errorf("missing URLPattern")
	}

	for _, n := range value.Nodes {
		if n.URLRewrite != "" {
			_, err := expr.Parse([]byte(n.URLRewrite))
			if err != nil {
				return err
			}
		}

		for _, v := range n.Validations {
			for _, r := range v.Rules {
				if r.RuleType == metapb.RuleRegexp {
					_, err := regexp.Compile(r.Expression)
					if err != nil {
						return err
					}
				}
			}
		}
	}

	return nil
}