Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(driver Driver)
Register used by each driver writer to register the driver to system
func RegisterHttp ¶ added in v0.0.2
func RegisterHttp(driver HTTPDriver)
RegisterHttp used by each driver writer to register the driver to system
Types ¶
type Driver ¶
type Driver interface {
// GetName return the name of the driver
GetName() string
// RegisterGrpcResolver register the grpc resolver to handle custom scheme
RegisterGrpcResolver()
// RegisterGrpcService register dtm endpoint to target
RegisterGrpcService(target string, endpoint string) error
// ParseServerMethod parse the url to server and method.
// server will be passed to grpc.Dial, and method to grpc.ClientConn.invoke
ParseServerMethod(uri string) (server string, method string, err error)
}
Driver is the interface to do grpc service register and discover
type HTTPClient ¶ added in v0.0.2
type HTTPClient interface {
// ResolveURL register the http resolver to handle custom url
ResolveURL(url string) (string, error)
// RegisterService register dtm endpoint to service
RegisterService(service string, endpoint string) error
}
HTTPClient is the interface to do http service call.
type HTTPDriver ¶ added in v0.0.2
type HTTPDriver interface {
// GetName return the name of the driver
GetName() string
// Init will init client
Init(registryType string, host string, options string) error
// ResolveURL register the http resolver to handle custom url
ResolveURL(url string) (string, error)
// RegisterService register dtm endpoint to service
RegisterService(service string, endpoint string) error
}
HTTPDriver is the interface to do http service register and discover
Click to show internal directories.
Click to hide internal directories.