From 68d9c2ed8019ed4a4e196f18ebe6f7eea4f93d62 Mon Sep 17 00:00:00 2001 From: Matt Brittan Date: Fri, 29 Jan 2021 09:39:56 +1300 Subject: [PATCH] Remove markdown code blocks from comments (as godoc does not handle this) Signed-off-by: Matt Brittan --- client.go | 36 ++++++++++++++++++------------------ options.go | 12 ++++++------ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/client.go b/client.go index 8558f3bf..fade7f49 100644 --- a/client.go +++ b/client.go @@ -79,19 +79,19 @@ type Client interface { // Subscribe starts a new subscription. Provide a MessageHandler to be executed when // a message is published on the topic provided, or nil for the default handler. // - // If `options.OrderMatters` is true (the default) then `callback` must not block or - // call functions within this package that may block (e.g. `Publish`) other than in + // If options.OrderMatters is true (the default) then callback must not block or + // call functions within this package that may block (e.g. Publish) other than in // a new go routine. - // `callback` must be safe for concurrent use by multiple goroutines. + // callback must be safe for concurrent use by multiple goroutines. Subscribe(topic string, qos byte, callback MessageHandler) Token // SubscribeMultiple starts a new subscription for multiple topics. Provide a MessageHandler to // be executed when a message is published on one of the topics provided, or nil for the // default handler. // - // If `options.OrderMatters` is true (the default) then `callback` must not block or - // call functions within this package that may block (e.g. `Publish`) other than in + // If options.OrderMatters is true (the default) then callback must not block or + // call functions within this package that may block (e.g. Publish) other than in // a new go routine. - // `callback` must be safe for concurrent use by multiple goroutines. + // callback must be safe for concurrent use by multiple goroutines. SubscribeMultiple(filters map[string]byte, callback MessageHandler) Token // Unsubscribe will end the subscription from each of the topics provided. // Messages published to those topics from other clients will no longer be @@ -102,10 +102,10 @@ type Client interface { // for parts of a wildcard subscription or for receiving retained messages // upon connection (before Sub scribe can be processed). // - // If `options.OrderMatters` is true (the default) then `callback` must not block or - // call functions within this package that may block (e.g. `Publish`) other than in + // If options.OrderMatters is true (the default) then callback must not block or + // call functions within this package that may block (e.g. Publish) other than in // a new go routine. - // `callback` must be safe for concurrent use by multiple goroutines. + // callback must be safe for concurrent use by multiple goroutines. AddRoute(topic string, callback MessageHandler) // OptionsReader returns a ClientOptionsReader which is a copy of the clientoptions // in use by the client. @@ -174,10 +174,10 @@ func NewClient(o *ClientOptions) Client { // without making a subscription. For example having a different handler // for parts of a wildcard subscription // -// If `options.OrderMatters` is true (the default) then `callback` must not block or -// call functions within this package that may block (e.g. `Publish`) other than in +// If options.OrderMatters is true (the default) then callback must not block or +// call functions within this package that may block (e.g. Publish) other than in // a new go routine. -// `callback` must be safe for concurrent use by multiple goroutines. +// callback must be safe for concurrent use by multiple goroutines. func (c *client) AddRoute(topic string, callback MessageHandler) { if callback != nil { c.msgRouter.addRoute(topic, callback) @@ -711,10 +711,10 @@ func (c *client) Publish(topic string, qos byte, retained bool, payload interfac // Subscribe starts a new subscription. Provide a MessageHandler to be executed when // a message is published on the topic provided. // -// If `options.OrderMatters` is true (the default) then `callback` must not block or -// call functions within this package that may block (e.g. `Publish`) other than in +// If options.OrderMatters is true (the default) then callback must not block or +// call functions within this package that may block (e.g. Publish) other than in // a new go routine. -// `callback` must be safe for concurrent use by multiple goroutines. +// callback must be safe for concurrent use by multiple goroutines. func (c *client) Subscribe(topic string, qos byte, callback MessageHandler) Token { token := newToken(packets.Subscribe).(*SubscribeToken) DEBUG.Println(CLI, "enter Subscribe") @@ -792,10 +792,10 @@ func (c *client) Subscribe(topic string, qos byte, callback MessageHandler) Toke // SubscribeMultiple starts a new subscription for multiple topics. Provide a MessageHandler to // be executed when a message is published on one of the topics provided. // -// If `options.OrderMatters` is true (the default) then `callback` must not block or -// call functions within this package that may block (e.g. `Publish`) other than in +// If options.OrderMatters is true (the default) then callback must not block or +// call functions within this package that may block (e.g. Publish) other than in // a new go routine. -// `callback` must be safe for concurrent use by multiple goroutines. +// callback must be safe for concurrent use by multiple goroutines. func (c *client) SubscribeMultiple(filters map[string]byte, callback MessageHandler) Token { var err error token := newToken(packets.Subscribe).(*SubscribeToken) diff --git a/options.go b/options.go index ee2e71b0..04f8ae67 100644 --- a/options.go +++ b/options.go @@ -50,7 +50,7 @@ type OnConnectHandler func(Client) type ReconnectHandler func(Client, *ClientOptions) // ClientOptions contains configurable options for an Client. Note that these should be set using the -// relevant methods (e.g. `AddBroker`) rather than directly. See those functions for information on usage. +// relevant methods (e.g. AddBroker) rather than directly. See those functions for information on usage. type ClientOptions struct { Servers []*url.URL ClientID string @@ -209,8 +209,8 @@ func (o *ClientOptions) SetCleanSession(clean bool) *ClientOptions { // from the client to the application and possibly arrive out of order. // Specifically, the message handler is called in its own go routine. // Note that setting this to true does not guarantee in-order delivery -// (this is subject to broker settings like `max_inflight_messages=1` in mosquitto) -// and if `true` then handlers must not block. +// (this is subject to broker settings like "max_inflight_messages=1" in mosquitto) +// and if true then handlers must not block. func (o *ClientOptions) SetOrderMatters(order bool) *ClientOptions { o.Order = order return o @@ -291,10 +291,10 @@ func (o *ClientOptions) SetBinaryWill(topic string, payload []byte, qos byte, re // SetDefaultPublishHandler sets the MessageHandler that will be called when a message // is received that does not match any known subscriptions. // -// If `options.OrderMatters` is true (the default) then `defaultHandler` must not block or -// call functions within this package that may block (e.g. `Publish`) other than in +// If OrderMatters is true (the defaultHandler) then callback must not block or +// call functions within this package that may block (e.g. Publish) other than in // a new go routine. -// `defaultHandler` must be safe for concurrent use by multiple goroutines. +// defaultHandler must be safe for concurrent use by multiple goroutines. func (o *ClientOptions) SetDefaultPublishHandler(defaultHandler MessageHandler) *ClientOptions { o.DefaultPublishHandler = defaultHandler return o