1 package sd 2 3 import ( 4 "io" 5 6 "github.com/go-kit/kit/endpoint" 7 ) 8 9 // Factory is a function that converts an instance string (e.g. host:port) to a 10 // specific endpoint. Instances that provide multiple endpoints require multiple 11 // factories. A factory also returns an io.Closer that's invoked when the 12 // instance goes away and needs to be cleaned up. Factories may return nil 13 // closers. 14 // 15 // Users are expected to provide their own factory functions that assume 16 // specific transports, or can deduce transports by parsing the instance string. 17 type Factory func(instance string) (endpoint.Endpoint, io.Closer, error) 18