代码拉取完成,页面将自动刷新
package remote
import "google.golang.org/grpc"
// RemotingOption configures how the remote infrastructure is started
type RemotingOption func(*remoteConfig)
func defaultRemoteConfig() *remoteConfig {
return &remoteConfig{
advertisedAddress: "",
dialOptions: []grpc.DialOption{grpc.WithInsecure()},
endpointWriterBatchSize: 1000,
endpointManagerBatchSize: 1000,
endpointWriterQueueSize: 1000000,
endpointManagerQueueSize: 1000000,
}
}
func WithEndpointWriterBatchSize(batchSize int) RemotingOption {
return func(config *remoteConfig) {
config.endpointWriterBatchSize = batchSize
}
}
func WithEndpointWriterQueueSize(queueSize int) RemotingOption {
return func(config *remoteConfig) {
config.endpointWriterQueueSize = queueSize
}
}
func WithEndpointManagerBatchSize(batchSize int) RemotingOption {
return func(config *remoteConfig) {
config.endpointManagerBatchSize = batchSize
}
}
func WithEndpointManagerQueueSize(queueSize int) RemotingOption {
return func(config *remoteConfig) {
config.endpointManagerQueueSize = queueSize
}
}
func WithDialOptions(options ...grpc.DialOption) RemotingOption {
return func(config *remoteConfig) {
config.dialOptions = options
}
}
func WithServerOptions(options ...grpc.ServerOption) RemotingOption {
return func(config *remoteConfig) {
config.serverOptions = options
}
}
func WithCallOptions(options ...grpc.CallOption) RemotingOption {
return func(config *remoteConfig) {
config.callOptions = options
}
}
func WithAdvertisedAddress(address string) RemotingOption {
return func(config *remoteConfig) {
config.advertisedAddress = address
}
}
type remoteConfig struct {
advertisedAddress string
serverOptions []grpc.ServerOption
callOptions []grpc.CallOption
dialOptions []grpc.DialOption
endpointWriterBatchSize int
endpointWriterQueueSize int
endpointManagerBatchSize int
endpointManagerQueueSize int
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。