Documentation ¶
Index ¶
- Variables
- type Client
- func MustNewClient(c RpcClientConf, options ...internal.ClientOption) Client
- func NewClient(c RpcClientConf, options ...internal.ClientOption) (Client, error)
- func NewClientNoAuth(c discov.EtcdConf) (Client, error)
- func NewClientWithTarget(target string, opts ...internal.ClientOption) (Client, error)
- type RpcClient
- type RpcClientConf
- type RpcProxy
- type RpcServer
- type RpcServerConf
Constants ¶
This section is empty.
Variables ¶
View Source
var ( WithDialOption = internal.WithDialOption WithTimeout = internal.WithTimeout )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
Conn() *grpc.ClientConn
}
func MustNewClient ¶
func MustNewClient(c RpcClientConf, options ...internal.ClientOption) Client
func NewClient ¶
func NewClient(c RpcClientConf, options ...internal.ClientOption) (Client, error)
func NewClientWithTarget ¶
func NewClientWithTarget(target string, opts ...internal.ClientOption) (Client, error)
type RpcClient ¶
type RpcClient struct {
// contains filtered or unexported fields
}
func (*RpcClient) Conn ¶
func (rc *RpcClient) Conn() *grpc.ClientConn
type RpcClientConf ¶
type RpcClientConf struct { Etcd discov.EtcdConf `json:",optional"` Endpoints []string `json:",optional=!Etcd"` App string `json:",optional"` Token string `json:",optional"` Timeout int64 `json:",optional"` }
func NewDirectClientConf ¶
func NewDirectClientConf(endpoints []string, app, token string) RpcClientConf
func NewEtcdClientConf ¶
func NewEtcdClientConf(hosts []string, key, app, token string) RpcClientConf
func (RpcClientConf) HasCredential ¶
func (cc RpcClientConf) HasCredential() bool
type RpcServer ¶
type RpcServer struct {
// contains filtered or unexported fields
}
func MustNewServer ¶
func MustNewServer(c RpcServerConf, register internal.RegisterFn) *RpcServer
func NewServer ¶
func NewServer(c RpcServerConf, register internal.RegisterFn) (*RpcServer, error)
func (*RpcServer) AddOptions ¶ added in v1.0.17
func (rs *RpcServer) AddOptions(options ...grpc.ServerOption)
func (*RpcServer) AddStreamInterceptors ¶ added in v1.0.17
func (rs *RpcServer) AddStreamInterceptors(interceptors ...grpc.StreamServerInterceptor)
func (*RpcServer) AddUnaryInterceptors ¶ added in v1.0.17
func (rs *RpcServer) AddUnaryInterceptors(interceptors ...grpc.UnaryServerInterceptor)
type RpcServerConf ¶
type RpcServerConf struct { service.ServiceConf ListenOn string Etcd discov.EtcdConf `json:",optional"` Auth bool `json:",optional"` Redis redis.RedisKeyConf `json:",optional"` StrictControl bool `json:",optional"` // pending forever is not allowed // never set it to 0, if zero, the underlying will set to 2s automatically Timeout int64 `json:",default=2000"` CpuThreshold int64 `json:",default=900,range=[0:1000]"` }
func (RpcServerConf) HasEtcd ¶
func (sc RpcServerConf) HasEtcd() bool
func (RpcServerConf) Validate ¶
func (sc RpcServerConf) Validate() error
Click to show internal directories.
Click to hide internal directories.