Documentation ¶
Index ¶
- Constants
- Variables
- func ClientCert(certFile, keyFile string) func(*NatsOption)
- func Delay(t time.Duration) func(*NatsOption)
- func Group(group string) func(*NatsOption)
- func Id(id string) func(*NatsOption)
- func NewClient(opt *NatsOption) rpc.Client
- func NewServer(opt *NatsOption) rpc.Server
- func NewTimeout(s string) net.Error
- func NewTimeoutFunc(f func() string) net.Error
- func Options(o ...nats.Option) func(*NatsOption)
- func Queue(num int) func(*NatsOption)
- func RootCAs(ca ...string) func(*NatsOption)
- func Secure(tls ...*tls.Config) func(*NatsOption)
- func Timeout(t time.Duration) func(*NatsOption)
- func Topic(topic string) func(*NatsOption)
- func Uri(uri ...string) func(*NatsOption)
- type NatsClient
- type NatsOption
- type NatsServer
- type Pool
- type Request
- type Sequence
Constants ¶
View Source
const DEFAULT_DELAY = 45
View Source
const DEFAULT_QUEUE = 64
View Source
const DEFAULT_TIMEOUT = 15
Variables ¶
View Source
var ErrClosed = errors.New("connect is closed")
View Source
var ErrIllegalUrl = errors.New("illegal url")
View Source
var ErrNotConnect = errors.New("not connect")
View Source
var ErrTimeout = NewTimeout("request timeout")
Functions ¶
func ClientCert ¶
func ClientCert(certFile, keyFile string) func(*NatsOption)
func Delay ¶
func Delay(t time.Duration) func(*NatsOption)
func Group ¶
func Group(group string) func(*NatsOption)
func Id ¶
func Id(id string) func(*NatsOption)
func NewClient ¶
func NewClient(opt *NatsOption) rpc.Client
func NewServer ¶
func NewServer(opt *NatsOption) rpc.Server
func NewTimeout ¶
func NewTimeoutFunc ¶
func Options ¶
func Options(o ...nats.Option) func(*NatsOption)
func Queue ¶
func Queue(num int) func(*NatsOption)
func RootCAs ¶
func RootCAs(ca ...string) func(*NatsOption)
func Secure ¶
func Secure(tls ...*tls.Config) func(*NatsOption)
func Timeout ¶
func Timeout(t time.Duration) func(*NatsOption)
func Topic ¶
func Topic(topic string) func(*NatsOption)
func Uri ¶
func Uri(uri ...string) func(*NatsOption)
Types ¶
type NatsClient ¶
type NatsClient struct { rpc.BaseClient // contains filtered or unexported fields }
func (*NatsClient) Close ¶
func (nc *NatsClient) Close()
func (*NatsClient) SendAndReceive ¶
func (nc *NatsClient) SendAndReceive(data []byte, ctx *rpc.ClientContext) ([]byte, error)
type NatsOption ¶
type NatsOption struct {
// contains filtered or unexported fields
}
func NewOption ¶
func NewOption(option ...func(*NatsOption)) *NatsOption
type NatsServer ¶
type NatsServer struct { rpc.BaseService // contains filtered or unexported fields }
func (*NatsServer) Close ¶
func (ns *NatsServer) Close()
func (*NatsServer) Handle ¶
func (ns *NatsServer) Handle() error
func (*NatsServer) Restart ¶
func (ns *NatsServer) Restart()
func (*NatsServer) Start ¶
func (ns *NatsServer) Start() (err error)
func (*NatsServer) Stop ¶
func (ns *NatsServer) Stop()
func (*NatsServer) URI ¶
func (ns *NatsServer) URI() string
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) Wheel ¶
func (p *Pool) Wheel() *timer.TimingWheel
Source Files ¶
Click to show internal directories.
Click to hide internal directories.