Codebase list golang-github-go-kit-kit / 0ad6191 loadbalancer / factory.go
0ad6191

Tree @0ad6191 (Download .tar.gz)

factory.go @0ad6191raw · history · blame

package loadbalancer

import (
	"io"

	"github.com/go-kit/kit/endpoint"
)

// Factory is a function that converts an instance string, e.g. a host:port,
// to a usable endpoint. Factories are used by load balancers to convert
// instances returned by Publishers (typically host:port strings) into
// endpoints. Users are expected to provide their own factory functions that
// assume specific transports, or can deduce transports by parsing the
// instance string.
type Factory func(instance string) (endpoint.Endpoint, io.Closer, error)