redis_discovery

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: LGPL-2.1 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Install   = plugin.Install
	Uninstall = plugin.Uninstall
)

Functions

func NewRegistry

func NewRegistry(settings ...option.Setting[RegistryOptions]) discovery.IRegistry

NewRegistry 创建registry插件,可以配合cache registry将数据缓存本地,提高查询效率

Types

type Option

type Option struct{}

Option 所有选项设置器

func (Option) Default

func (Option) Default() option.Setting[RegistryOptions]

Default 默认值

func (Option) FastAddress

func (Option) FastAddress(addr string) option.Setting[RegistryOptions]

FastAddress 快速设置redis服务地址

func (Option) FastAuth

func (Option) FastAuth(username, password string) option.Setting[RegistryOptions]

FastAuth 快速设置redis鉴权信息

func (Option) FastDB

func (Option) FastDB(db int) option.Setting[RegistryOptions]

FastDB 快速设置redis db

func (Option) KeyPrefix

func (Option) KeyPrefix(prefix string) option.Setting[RegistryOptions]

KeyPrefix 所有key的前缀

func (Option) RedisClient

func (Option) RedisClient(cli *redis.Client) option.Setting[RegistryOptions]

RedisClient redis客户端,1st优先使用

func (Option) RedisConfig

func (Option) RedisConfig(conf *redis.Options) option.Setting[RegistryOptions]

RedisConfig redis配置,2nd优先使用

func (Option) RedisURL

func (Option) RedisURL(url string) option.Setting[RegistryOptions]

RedisURL redis连接url,3rd优先使用

func (Option) WatchChanSize

func (Option) WatchChanSize(size int) option.Setting[RegistryOptions]

WatchChanSize 监控服务变化的channel大小

type RegistryOptions

type RegistryOptions struct {
	RedisClient   *redis.Client
	RedisConfig   *redis.Options
	RedisURL      string
	KeyPrefix     string
	WatchChanSize int
	FastUsername  string
	FastPassword  string
	FastAddress   string
	FastDB        int
}

RegistryOptions 所有选项

Jump to

Keyboard shortcuts

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