package registry

import "os"

var (
	DefaultRegistry Registry
)

const (
	DiscoveryUrlEvn = "DISCOVERY_URL"
)

type (
	Registry interface {
		Register(instance *ServiceNode) (err error)
		Deregister(instance *ServiceNode) (err error)
		Get(name string) ([]*ServiceNode, error)
		Fetch() ([]*ServiceNode, error)
	}
)

func init() {
	DefaultRegistry = NewDiscovery(os.Getenv(DiscoveryUrlEvn))
}
