consul

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: 17 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

View Source
const (
	DefaultCheckInterval = 5 * time.Second
	DefaultCheckTimeout  = 2 * time.Second
)

Variables

This section is empty.

Functions

func NewConsulAdapter

func NewConsulAdapter(opts *Opts) (xdiscovery.Adapter, error)

NewConsulAdapter NewConsulAdapter

Types

type Opts

type Opts struct {
	Address               []string      // consul 或者 agent 地址
	TTL                   time.Duration // 服务注册后和 agent 心跳间隔, 默认5s
	ResponseHeaderTimeout time.Duration // http 请求等待回复时间, 默认15s
	WatchWaitTime         time.Duration // watch 无变每次长轮询等待时间, 默认 50s
}

Opts Opts

Jump to

Keyboard shortcuts

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