Documentation ¶
Overview ¶
* User: cr-mao Date: 2023/8/19 10:06 Email: crmao@qq.com Desc: constant.go
* User: cr-mao Date: 2023/8/19 10:38 Email: crmao@qq.com Desc: grpc_server.go
* User: cr-mao Date: 2023/8/18 15:21 Email: crmao@qq.com Desc: node_client.go
* User: cr-mao Date: 2023/8/19 09:49 Email: crmao@qq.com Desc: transport.go
Index ¶
- Variables
- type Gate
- type NodeGrpcClient
- type Option
- func WithAuthTimeOut(t int64) Option
- func WithContext(ctx context.Context) Option
- func WithID(id string) Option
- func WithLocator(locator locate.Locator) Option
- func WithName(name string) Option
- func WithRegistry(r registry.Registry) Option
- func WithServer(server network.Server) Option
- func WithTimeout(timeout time.Duration) Option
- func WithTransport(t *Transport) Option
- func WithWeight(weight int) Option
- type ServerOptions
- type TransOptionFunc
- type Transport
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidArgument = errors.New("ErrInvalidArgument")
View Source
var ErrNotFoundUserSource = errors.New("not found user source")
Functions ¶
This section is empty.
Types ¶
type NodeGrpcClient ¶
type NodeGrpcClient struct {
// contains filtered or unexported fields
}
func NewNodeClient ¶
func NewNodeClient(cc *grpc.ClientConn) *NodeGrpcClient
func (*NodeGrpcClient) Deliver ¶
func (c *NodeGrpcClient) Deliver(ctx context.Context, args *cluster.DeliverArgs) (miss bool, err error)
Deliver 投递消息
func (*NodeGrpcClient) Trigger ¶
func (c *NodeGrpcClient) Trigger(ctx context.Context, args *cluster.TriggerArgs) (miss bool, err error)
Trigger 触发事件
type ServerOptions ¶
type ServerOptions struct { Addr string ServerOpts []mygrpc.ServerOption }
type TransOptionFunc ¶
type TransOptionFunc func(o *transOptions)
func WithClientDialOptions ¶
func WithClientDialOptions(opts ...grpc.DialOption) TransOptionFunc
WithClientDialOptions 设置客户端拨号选项
func WithClientPoolSize ¶
func WithClientPoolSize(size int) TransOptionFunc
WithClientPoolSize 设置客户端连接池大小
func WithServerListenAddr ¶
func WithServerListenAddr(addr string) TransOptionFunc
WithServerListenAddr 设置服务器监听地址
func WithServerOptions ¶
func WithServerOptions(opts ...mygrpc.ServerOption) TransOptionFunc
WithServerOptions 设置服务器选项
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
func NewTransport ¶
func NewTransport(opts ...TransOptionFunc) *Transport
func (*Transport) NewGateServer ¶
func (*Transport) NewNodeClient ¶
func (t *Transport) NewNodeClient(ep *endpoint.Endpoint) (*NodeGrpcClient, error)
Click to show internal directories.
Click to hide internal directories.