<commit_before>package discovery

import (
	"fmt"
	"github.com/golang/glog"
	"net/url"
	"strings"
)

type Service interface {
	Get(key string) ([]string, error)
}

type DisabledDiscovery struct{}

func NewDisabledDiscovery() *DisabledDiscovery {
	return &DisabledDiscovery{}
}

func (d *DisabledDiscovery) Get(serviceName string) ([]string, error) {
	return []string{}, nil
}

func New(discoveryUrl string) (Service, error) {

	if !strings.Contains(discoveryUrl, ":") {
		discoveryUrl = discoveryUrl + "://"
	}

	u, err := url.Parse(discoveryUrl)

	if err != nil {
		return nil, err
	}

	switch u.Scheme {
	case "disabled":
		return NewDisabledDiscovery(), nil
	case "rackspace":<commit_msg>Call it noop discovery.<commit_after>package discovery

import (
	"fmt"
	"github.com/golang/glog"
	"net/url"
	"strings"
)

type Service interface {
	Get(key string) ([]string, error)
}

type NoopDiscovery struct{}

func NewNoopDiscovery() *NoopDiscovery {
	return &NoopDiscovery{}
}

func (d *NoopDiscovery) Get(serviceName string) ([]string, error) {
	return []string{}, nil
}

func New(discoveryUrl string) (Service, error) {

	if !strings.Contains(discoveryUrl, ":") {
		discoveryUrl = discoveryUrl + "://"
	}

	u, err := url.Parse(discoveryUrl)

	if err != nil {
		return nil, err
	}

	switch u.Scheme {
	case "noop":
		return NewNoopDiscovery(), nil
	case "disabled":
		return NewNoopDiscovery(), nil
	case "rackspace":
{'fraction_non_alphanumeric': 0.14346289752650176, 'fraction_numerical': 0.0, 'mean_word_length': 4.686746987951807, 'pattern_counts': {'":': 9, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5409251', 'n_tokens_mistral': 518, 'n_tokens_neox': 487, 'n_words': 125}