Documentation
¶
Index ¶
- Constants
- Variables
- type Conn
- type Invoke
- type InvokeOption
- type InvokeOptions
- type Option
- type Options
- func BuffSize(buffSize int) Options
- func Codec(cc codec.Codec) Options
- func ConfigOption(opts ...config.Options) Options
- func ConnectTimeout(connectTimeout time.Duration) Options
- func E(e *endpoint.Endpoint) Options
- func Error(err parcel.ErrorPackager) Options
- func EtcdConfig(e *clientv3.Config) Options
- func Exit(exit ...func()) Options
- func Id(id string) Options
- func KeepaliveInterval(keepaliveInterval time.Duration) Options
- func KeepaliveLifetime(keepaliveLifetime time.Duration) Options
- func Namespace(name string) Options
- func Port(port [2]int) Options
- func Signal(signal ...os.Signal) Options
- func TCPAddress(address string) Options
- func Version(version string) Options
- func Wrapper(wrappers ...parcel.Wrapper) Options
- func WssAddress(address, path string) Options
- type Service
- func (s *Service) Close()
- func (s *Service) Codec() codec.Codec
- func (s *Service) InvokeRC(c *context.Context, method string, req chan []byte, errIn chan error, ...) (chan []byte, chan error)
- func (s *Service) InvokeRR(c *context.Context, method string, req, rsp proto.Message, ...) error
- func (s *Service) InvokeRS(c *context.Context, method string, req proto.Message, opts ...InvokeOptions) (chan []byte, chan error)
- func (s *Service) RegisterChannelHandler(method string, rs parcel.ChannelHandler)
- func (s *Service) RegisterHandler(method string, rr parcel.Handler)
- func (s *Service) RegisterStreamHandler(method string, rs parcel.StreamHandler)
- func (s *Service) Run() error
- type Strategy
Constants ¶
View Source
const ( // StateBlock block is unavailable state StateBlock state = 0x01 + iota // StateReady ready is unavailable state StateReady // StateWorking is available state StateWorking )
View Source
const SupportPackageIsVersion1 = 1
Variables ¶
View Source
var ( ErrorNoneServer = errors.New("server is none to use") ErrorNoSuchServer = errors.New("no such server") )
Functions ¶
This section is empty.
Types ¶
type InvokeOption ¶
type InvokeOption struct {
// contains filtered or unexported fields
}
type InvokeOptions ¶
type InvokeOptions func(*InvokeOption)
func InvokeBuffSize ¶
func InvokeBuffSize(buffSize int) InvokeOptions
InvokeBuffSize set buff size for requestChannel
func WithAddress ¶
func WithAddress(name, address string, version ...string) InvokeOptions
WithAddress set service discover prefix with both service serviceName and address
func WithName ¶
func WithName(name string, version ...string) InvokeOptions
WithName set service discover prefix with service serviceName
type Options ¶
type Options func(option *Option)
func ConfigOption ¶
func ConnectTimeout ¶
ConnectTimeout set connect timeout
func Error ¶
func Error(err parcel.ErrorPackager) Options
func EtcdConfig ¶
EtcdConfig setting global etcd config first
func KeepaliveInterval ¶
KeepaliveInterval set keepalive interval
func KeepaliveLifetime ¶
KeepaliveLifetime set keepalive life time
func TCPAddress ¶
func WssAddress ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) InvokeRC ¶
func (s *Service) InvokeRC( c *context.Context, method string, req chan []byte, errIn chan error, opts ...InvokeOptions, ) (chan []byte, chan error)
InvokeRC rpc request requestChannel,it's multiple request and multiple response
func (*Service) InvokeRR ¶
func (s *Service) InvokeRR(c *context.Context, method string, req, rsp proto.Message, opts ...InvokeOptions) error
InvokeRR rpc request requestResponse,it's block request,one request one response
func (*Service) InvokeRS ¶
func (s *Service) InvokeRS(c *context.Context, method string, req proto.Message, opts ...InvokeOptions) ( chan []byte, chan error, )
InvokeRS rpc request requestStream,it's one request and multiple response
func (*Service) RegisterChannelHandler ¶
func (s *Service) RegisterChannelHandler(method string, rs parcel.ChannelHandler)
func (*Service) RegisterHandler ¶
func (*Service) RegisterStreamHandler ¶
func (s *Service) RegisterStreamHandler(method string, rs parcel.StreamHandler)
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
_auxiliary
|
|
|
bench/bench/api/echo_bench
command
|
|
|
bench/bench/api/echo_bench_sc
command
|
|
|
bench/bench/api/echo_bench_sub
command
|
|
|
bench/bench/test/client1
command
|
|
|
bench/bench/test/server
command
|
|
|
bench/bench/test/server1
command
|
|
|
example/config
command
|
|
|
example/rsync
command
|
|
|
example/tutorials/api/api.im
command
|
|
|
example/tutorials/api/api.requst
command
|
|
|
example/tutorials/api/api.stream
command
|
|
|
example/tutorials/srv/srv.hello
command
|
|
|
example/tutorials/srv/srv.im
command
|
|
|
cmd
|
|
|
protoc-gen-roc
command
|
|
|
roctl/project
Package rocx enable project default generator
|
Package rocx enable project default generator |
|
internal
|
|
|
metadata
Package metadata for websocket or socket from rsocket-rpc-go Metadata
|
Package metadata for websocket or socket from rsocket-rpc-go Metadata |
|
test
command
|
|
Click to show internal directories.
Click to hide internal directories.

