eds

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

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

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

func NewEdsAdapter(adsAddr string, opts ...Option) (*Adapter, error)

NewAdapter eds 聚合服务发现 Adapter

func (*Adapter) Init

func (d *Adapter) Init(subscribedClusters []string) error

Init 初始化确保更新订阅列表

func (*Adapter) Register

func (d *Adapter) Register(svc *xdiscovery.Service, opts ...xdiscovery.RegisterOpts) (xdiscovery.Registry, error)

Register eds 不支持注册服务

func (*Adapter) Shutdown

func (d *Adapter) Shutdown() error

Shutdown 停止监听

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

func AllRefreshDelay(allRefreshDelay time.Duration) Option

AllRefreshDelay 定时获取所有 Cluster 轮询时间

func ConnectTimeout

func ConnectTimeout(connectTimeout time.Duration) Option

ConnectTimeout ads 服务器连接超时时间

func Container

func Container(container string) Option

Container 所在 container

func Datacenter

func Datacenter(datacenter string) Option

Datacenter 所在集群标识

func Env

func Env(env string) Option

Env 所在环境

func LocalIP

func LocalIP(ip string) Option

LocalIP 服务对外 ip

func RefreshDelay

func RefreshDelay(refreshDelay time.Duration) Option

RefreshDelay 定时获取订阅列表时间

func ServiceCluster

func ServiceCluster(cluster string) Option

ServiceCluster 服务名

func ServiceNode

func ServiceNode(node string) Option

ServiceNode 服务名

func WaitReadyTimeout

func WaitReadyTimeout(waitReadyTimeout time.Duration) Option

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 配置获取时间
}

Directories

Path Synopsis
Package mock_v2 is a generated GoMock package.
Package mock_v2 is a generated GoMock package.
xds
v2

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL