2016-05-25 15:39:18 -06:00
|
|
|
package sd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/go-kit/kit/endpoint"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Factory is a function that converts an instance string (e.g. host:port) to a
|
|
|
|
// specific endpoint. Instances that provide multiple endpoints require multiple
|
|
|
|
// factories. A factory also returns an io.Closer that's invoked when the
|
2016-05-28 09:07:44 -04:00
|
|
|
// instance goes away and needs to be cleaned up. Factories may return nil
|
|
|
|
// closers.
|
2016-05-25 15:39:18 -06:00
|
|
|
//
|
|
|
|
// 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)
|