Documentation
¶
Index ¶
- Constants
- type Server
- func (s *Server) Endpoint() (*url.URL, error)
- func (s *Server) InitServer(opts ...ServerOption)
- func (s *Server) Name() string
- func (s *Server) RegisterSubscriber(ctx context.Context, topic string, handler broker.Handler, ...) error
- func (s *Server) Start(ctx context.Context) error
- func (s *Server) Stop(_ context.Context) error
- type ServerOption
- func Logger(logger log.Logger) ServerOption
- func Middleware(m ...middleware.Middleware) ServerOption
- func WithAddress(addrs []string) ServerOption
- func WithAuth(username string, password string) ServerOption
- func WithAutoReconnect(enable bool) ServerOption
- func WithBrokerOptions(opts ...broker.Option) ServerOption
- func WithCleanSession(enable bool) ServerOption
- func WithClientId(clientId string) ServerOption
- func WithCodec(c string) ServerOption
- func WithLogger(logger log.Logger) ServerOption
- func WithResumeSubs(enable bool) ServerOption
- func WithTLSConfig(c *tls.Config) ServerOption
- type SubscribeOption
- type SubscribeOptionMap
- type SubscriberMap
- type Transport
Constants ¶
View Source
const (
KindMQTT transport.Kind = "mqtt"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
func NewServer ¶
func NewServer(opts ...ServerOption) *Server
func (*Server) InitServer ¶
func (s *Server) InitServer(opts ...ServerOption)
func (*Server) RegisterSubscriber ¶
type ServerOption ¶
type ServerOption func(o *Server)
func Logger ¶
func Logger(logger log.Logger) ServerOption
Logger with server logger. Deprecated: use global logger instead.
func Middleware ¶
func Middleware(m ...middleware.Middleware) ServerOption
Middleware with service md option.
func WithAddress ¶
func WithAddress(addrs []string) ServerOption
func WithAuth ¶
func WithAuth(username string, password string) ServerOption
func WithAutoReconnect ¶
func WithAutoReconnect(enable bool) ServerOption
func WithBrokerOptions ¶
func WithBrokerOptions(opts ...broker.Option) ServerOption
WithBrokerOptions MQ代理配置
func WithCleanSession ¶
func WithCleanSession(enable bool) ServerOption
func WithClientId ¶
func WithClientId(clientId string) ServerOption
func WithCodec ¶
func WithCodec(c string) ServerOption
func WithLogger ¶
func WithLogger(logger log.Logger) ServerOption
func WithResumeSubs ¶
func WithResumeSubs(enable bool) ServerOption
func WithTLSConfig ¶
func WithTLSConfig(c *tls.Config) ServerOption
type SubscribeOption ¶
type SubscribeOption struct {
// contains filtered or unexported fields
}
type SubscribeOptionMap ¶
type SubscribeOptionMap map[string]*SubscribeOption
type SubscriberMap ¶
type SubscriberMap map[string]broker.Subscriber
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is an HTTP transport.
func (*Transport) PathTemplate ¶
PathTemplate returns the http path template.
func (*Transport) ReplyHeader ¶
ReplyHeader returns the reply header.
func (*Transport) RequestHeader ¶
RequestHeader returns the request header.
Click to show internal directories.
Click to hide internal directories.