Documentation ¶
Overview ¶
Copyright 2020 SunJun <i@sjis.me>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 SunJun <i@sjis.me>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Copyright 2020 SunJun <i@sjis.me>
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- type Adapter
- func (d *Adapter) Init(subscribedClusters []string) error
- func (d *Adapter) Register(svc *xdiscovery.Service, opts ...xdiscovery.RegisterOpts) (xdiscovery.Registry, error)
- func (d *Adapter) Shutdown() error
- func (d *Adapter) WatchList(cluster string, onUpdateList xdiscovery.OnUpdateList, ...) (xdiscovery.Watcher, error)
- type Option
- func AllRefreshDelay(allRefreshDelay time.Duration) Option
- func ConnectTimeout(connectTimeout time.Duration) Option
- func Container(container string) Option
- func Datacenter(datacenter string) Option
- func Env(env string) Option
- func LocalIP(ip string) Option
- func RefreshDelay(refreshDelay time.Duration) Option
- func ServiceCluster(cluster string) Option
- func ServiceNode(node string) Option
- func WaitReadyTimeout(waitReadyTimeout time.Duration) Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter EDS 聚合服务发现适配器
func NewEdsAdapter ¶
NewAdapter eds 聚合服务发现 Adapter
func (*Adapter) Register ¶
func (d *Adapter) Register(svc *xdiscovery.Service, opts ...xdiscovery.RegisterOpts) (xdiscovery.Registry, error)
Register eds 不支持注册服务
func (*Adapter) WatchList ¶
func (d *Adapter) WatchList(cluster string, onUpdateList xdiscovery.OnUpdateList, opts ...xdiscovery.WatchOption) (xdiscovery.Watcher, error)
WatchList WatchList
type Option ¶
type Option func(*Options)
func AllRefreshDelay ¶
AllRefreshDelay 定时获取所有 Cluster 轮询时间
func ConnectTimeout ¶
ConnectTimeout ads 服务器连接超时时间
func WaitReadyTimeout ¶
WaitReadyTimeout ads 等待第一次 ads 配置获取时间
type Options ¶
type Options struct { ServiceCluster string // 服务名 ServiceNode string // 服务节点信息 LocalIP string // 本服务 ip Env string // qa/pre/prd Container string // vm/k8s Datacenter string // 所在集群标识 RefreshDelay time.Duration // 订阅 Cluster 刷新时间 AllRefreshDelay time.Duration // 所有 Cluster 轮询时间 ConnectTimeout time.Duration // ads 服务器连接超时时间 WaitReadyTimeout time.Duration // 等待第一次 ads 配置获取时间 }