Documentation ¶
Index ¶
- Variables
- func RegisterLinkServer(s *grpc.Server, srv LinkServer)
- type Client
- type ClientConfig
- type ClientOptions
- type Context
- func (*Context) Descriptor() ([]byte, []int)
- func (this *Context) Equal(that interface{}) bool
- func (this *Context) GoString() string
- func (m *Context) Marshal() (dAtA []byte, err error)
- func (m *Context) MarshalTo(dAtA []byte) (int, error)
- func (m *Context) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Context) ProtoMessage()
- func (m *Context) Reset()
- func (m *Context) Size() (n int)
- func (m *Context) String() string
- func (m *Context) Unmarshal(dAtA []byte) error
- func (m *Context) XXX_DiscardUnknown()
- func (m *Context) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Context) XXX_Merge(src proto.Message)
- func (m *Context) XXX_Size() int
- func (m *Context) XXX_Unmarshal(b []byte) error
- type LinkClient
- type LinkServer
- type Link_TalkClient
- type Link_TalkServer
- type Message
- func (*Message) Descriptor() ([]byte, []int)
- func (this *Message) Equal(that interface{}) bool
- func (this *Message) GoString() string
- func (m *Message) Marshal() (dAtA []byte, err error)
- func (m *Message) MarshalTo(dAtA []byte) (int, error)
- func (m *Message) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Message) ProtoMessage()
- func (m *Message) Reset()
- func (m *Message) Retain() bool
- func (m *Message) Size() (n int)
- func (m *Message) String() string
- func (m *Message) Unmarshal(dAtA []byte) error
- func (m *Message) XXX_DiscardUnknown()
- func (m *Message) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Message) XXX_Merge(src proto.Message)
- func (m *Message) XXX_Size() int
- func (m *Message) XXX_Unmarshal(b []byte) error
- type Observer
- type Server
- type ServerOptions
- type Type
- type UnimplementedLinkServer
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthLink = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowLink = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupLink = fmt.Errorf("proto: unexpected end of group") )
var ErrClientAlreadyClosed = errors.New("client has closed")
ErrClientAlreadyClosed the client is closed
var ErrClientMessageTypeInvalid = errors.New("message type is invalid")
ErrClientMessageTypeInvalid the message type is invalid
var Type_name = map[int32]string{
0: "Msg",
1: "MsgRtn",
2: "Ack",
}
var Type_value = map[string]int32{
"Msg": 0,
"MsgRtn": 1,
"Ack": 2,
}
Functions ¶
func RegisterLinkServer ¶
func RegisterLinkServer(s *grpc.Server, srv LinkServer)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client client of contact server
func NewClient ¶
func NewClient(ops ClientOptions) (*Client, error)
NewClient creates a new client of functions server
func (*Client) CallContext ¶
CallContext calls a request with context synchronously
type ClientConfig ¶
type ClientConfig struct { Address string `yaml:"address" json:"address"` Timeout time.Duration `yaml:"timeout" json:"timeout" default:"30s"` MaxReconnectInterval time.Duration `yaml:"maxReconnectInterval" json:"maxReconnectInterval" default:"3m"` MaxMessageSize utils.Size `yaml:"maxMessageSize" json:"maxMessageSize" default:"4m"` MaxCacheMessages int `yaml:"maxCacheMessages" json:"maxCacheMessages" default:"10"` DisableAutoAck bool `yaml:"disableAutoAck" json:"disableAutoAck"` utils.Certificate `yaml:",inline" json:",inline"` }
ClientConfig client config
func (ClientConfig) ToClientOptions ¶ added in v0.1.13
func (cc ClientConfig) ToClientOptions(obs Observer) (*ClientOptions, error)
ToClientOptions converts client config to client options
type ClientOptions ¶ added in v0.1.9
type ClientOptions struct { Address string TLSConfig *tls.Config MaxMessageSize utils.Size MaxCacheMessages int MaxReconnectInterval time.Duration DisableAutoAck bool Observer Observer }
ClientOptions client options
func NewClientOptions ¶ added in v0.1.9
func NewClientOptions() ClientOptions
NewClientOptions creates client options with default values
type Context ¶
type Context struct { ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` TS uint64 `protobuf:"varint,2,opt,name=TS,proto3" json:"TS,omitempty"` QOS uint32 `protobuf:"varint,3,opt,name=QOS,proto3" json:"QOS,omitempty"` Type Type `protobuf:"varint,4,opt,name=Type,proto3,enum=link.Type" json:"Type,omitempty"` Topic string `protobuf:"bytes,5,opt,name=Topic,proto3" json:"Topic,omitempty"` }
func NewPopulatedContext ¶
func (*Context) Descriptor ¶
func (*Context) MarshalToSizedBuffer ¶
func (*Context) ProtoMessage ¶
func (*Context) ProtoMessage()
func (*Context) XXX_DiscardUnknown ¶
func (m *Context) XXX_DiscardUnknown()
func (*Context) XXX_Marshal ¶
func (*Context) XXX_Unmarshal ¶
type LinkClient ¶
type LinkClient interface { Talk(ctx context.Context, opts ...grpc.CallOption) (Link_TalkClient, error) Call(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Message, error) }
LinkClient is the client API for Link service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewLinkClient ¶
func NewLinkClient(cc *grpc.ClientConn) LinkClient
type LinkServer ¶
type LinkServer interface { Talk(Link_TalkServer) error Call(context.Context, *Message) (*Message, error) }
LinkServer is the server API for Link service.
type Link_TalkClient ¶
type Link_TalkServer ¶
type Message ¶
type Message struct { Context Context `protobuf:"bytes,1,opt,name=Context,proto3" json:"Context"` Content []byte `protobuf:"bytes,2,opt,name=Content,proto3" json:"Content,omitempty"` }
func NewPopulatedMessage ¶
func (*Message) Descriptor ¶
func (*Message) MarshalToSizedBuffer ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) XXX_DiscardUnknown ¶
func (m *Message) XXX_DiscardUnknown()
func (*Message) XXX_Marshal ¶
func (*Message) XXX_Unmarshal ¶
type Server ¶ added in v0.1.9
Server is a gRPC server to serve RPC requests.
func Launch ¶ added in v0.1.9
func Launch(ops ServerOptions) (*Server, error)
Launch launches a link server
type ServerOptions ¶ added in v0.1.9
type ServerOptions struct { Address string TLSConfig *tls.Config LinkServer LinkServer MaxMessageSize utils.Size MaxConcurrentStreams uint32 }
ServerOptions server option
func NewServerOptions ¶ added in v0.1.9
func NewServerOptions() ServerOptions
NewServerOptions creates client options with default values
type UnimplementedLinkServer ¶
type UnimplementedLinkServer struct { }
UnimplementedLinkServer can be embedded to have forward compatible implementations.
func (*UnimplementedLinkServer) Talk ¶
func (*UnimplementedLinkServer) Talk(srv Link_TalkServer) error