dtmdriver

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2021 License: MIT Imports: 2 Imported by: 5

README

dtmdriver

dtm接入gRPC类微服务接口

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 Use

func Use(name string) error

Use called by users who want to use dtmgrpc.

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 uri 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 interface to do service register and discover

func GetDriver

func GetDriver() Driver

GetDriver called by dtm

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL