Documentation ¶
Index ¶
Constants ¶
View Source
const (
ConnNameTypeID = "2d281e77-3133-4718-a5b7-9eea069591ca"
)
View Source
const (
ConnsTypeID = "7bf0a017-ef0c-496a-b04c-b1dc262abc8d"
)
Variables ¶
This section is empty.
Functions ¶
func ConnNameConfigTypeLive ¶
func ConnNameConfigTypeLive() *dot.ConfigTypeLive
jayce edit return config of ConnName
func ConnNameTypeLives ¶
func ConnsConfigTypeLive ¶
func ConnsConfigTypeLive() *dot.ConfigTypeLive
jayce edit return config of Conn
func ConnsTypeLives ¶
Data structure needed when generating newer component
Types ¶
type ClientContext ¶
type ClientContext struct { ClientConn *grpc.ClientConn Ctx context.Context Cancel context.CancelFunc }
type ConnName ¶
type ConnName struct { Conns_ Conns `dot:"?"` //可选组件,优先使用etcd // contains filtered or unexported fields }
func NewTestConnName ¶
func (*ConnName) AfterAllInject ¶
func (*ConnName) ClientContext ¶
func (c *ConnName) ClientContext() *ClientContext
func (*ConnName) Conn ¶
func (c *ConnName) Conn() *grpc.ClientConn
func (*ConnName) ServerName ¶
type Conns ¶
type Conns interface { //Return default connection, only one connection DefaultClientConn() *grpc.ClientConn //Return server name corresponding connection ClientConn(serviceName string) *grpc.ClientConn //Return ClientContext ClientContext(serviceName string) *ClientContext //return service name ServiceName() []string //return schemeName, Scheme is defined at https://github.com/grpc/grpc/blob/master/doc/naming.md SchemeName() string }
grpc connection, support one Scheme, multi services are below, every service can have multi address(ClientConn load balancing)
func NewTestConns ¶
func NewTestConns(conf *ConnsConfig) Conns
type ConnsConfig ¶
type ConnsConfig struct { Scheme string `json:"scheme"` Services []ServiceConfig `json:"services"` //与etcd是并列的关系,如果name相同时,etcd更优先 }
Click to show internal directories.
Click to hide internal directories.