code: func NewRule(scope, namePrefix, connector string) (*Rule, error) {
  	if namePrefix == "" {
  		return nil, errors.New("namePrefix could not be empty, should be defined in yaml file")
  	}
  
  	if scope == "" {
  		return nil, errors.New("scope could not be empty, should be defined in yaml file")
  	}
  
  	if strings.HasPrefix(namePrefix, "*") && len(namePrefix) != 1 {
  		// we don't support name like '*.service.v1'
  		return nil, errors.Errorf(
  			"namePrefix like %v is not supported, cannot put * at the beginning of namePrefix.", namePrefix)
  	}
  
  	globMatch := glob.MustCompile(namePrefix)
  
  	return &Rule{NamePrefix: namePrefix, Scope: scope, Connector: connector, GlobMatch: globMatch}, nil
  }
docs: // NewRule initializes Rule