etcd

package module
v0.8.6 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

README

概述

基于 ETCD 的 FNS 服务注册与发现。

安装

go get github.com/aacfactory/fns-contrib/discovery/etcd

使用

配置文件,其中kind必须是etcd,且必须小写。

{
  "services": {
    "discovery": {
      "enable": true,
      "kind": "etcd",
      "config": {
        "endpoints": [
          ""
        ],
        "username": "",
        "password": "",
        "dialTimeoutSecond": 10,
        "grantTtlSecond": 10,
        "ssl": false,
        "caFilePath": "",
        "certFilePath": "",
        "keyFilePath": "",
        "insecureSkipVerify": false
      }
    }
  }
}

代码注入,没有其它操作了。

import _ "github.com/aacfactory/fns-contrib/discovery/etcd"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Retriever

func Retriever(option fns.ServiceDiscoveryOption) (discovery fns.ServiceDiscovery, err error)

Types

type Config

type Config struct {
	Endpoints          []string `json:"endpoints"`
	Username           string   `json:"username,omitempty"`
	Password           string   `json:"password,omitempty"`
	DialTimeoutSecond  int      `json:"dialTimeoutSecond,omitempty"`
	GrantTTLSecond     int      `json:"grantTtlSecond,omitempty"`
	SSL                bool     `json:"ssl,omitempty"`
	CaFilePath         string   `json:"caFilePath,omitempty"`
	CertFilePath       string   `json:"certFilePath,omitempty"`
	KeyFilePath        string   `json:"keyFilePath,omitempty"`
	InsecureSkipVerify bool     `json:"insecureSkipVerify,omitempty"`
}

Jump to

Keyboard shortcuts

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