代码拉取完成,页面将自动刷新
package stomp
import (
"context"
"time"
"gitee.com/sasukebo/go-micro/v4/broker"
)
// SubscribeHeaders sets headers for subscriptions
func SubscribeHeaders(h map[string]string) broker.SubscribeOption {
return setSubscribeOption(subscribeHeaderKey{}, h)
}
type subscribeContextKey struct{}
// SubscribeContext set the context for broker.SubscribeOption
func SubscribeContext(ctx context.Context) broker.SubscribeOption {
return setSubscribeOption(subscribeContextKey{}, ctx)
}
type ackSuccessKey struct{}
// AckOnSuccess will automatically acknowledge messages when no error is returned
func AckOnSuccess() broker.SubscribeOption {
return setSubscribeOption(ackSuccessKey{}, true)
}
// Durable sets a durable subscription
func Durable() broker.SubscribeOption {
return setSubscribeOption(durableQueueKey{}, true)
}
// Receipt requests a receipt for the delivery should be received
func Receipt(ct time.Duration) broker.PublishOption {
return setPublishOption(receiptKey{}, true)
}
// SuppressContentLength requests that send does not include a content length
func SuppressContentLength(ct time.Duration) broker.PublishOption {
return setPublishOption(suppressContentLengthKey{}, true)
}
// ConnectTimeout sets the connection timeout duration
func ConnectTimeout(ct time.Duration) broker.Option {
return setBrokerOption(connectTimeoutKey{}, ct)
}
// Auth sets the authentication information
func Auth(username string, password string) broker.Option {
return setBrokerOption(authKey{}, &authRecord{
username: username,
password: password,
})
}
// ConnectHeaders adds headers for the connection
func ConnectHeaders(h map[string]string) broker.Option {
return setBrokerOption(connectHeaderKey{}, h)
}
// VirtualHost adds host header to define the vhost
func VirtualHost(h string) broker.Option {
return setBrokerOption(vHostKey{}, h)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。