Documentation ¶
Index ¶
- Variables
- func NewRegistry(settings ...option.Setting[RegistryOptions]) discovery.IRegistry
- type Option
- func (Option) Default() option.Setting[RegistryOptions]
- func (Option) FastAddress(addr string) option.Setting[RegistryOptions]
- func (Option) FastAuth(username, password string) option.Setting[RegistryOptions]
- func (Option) FastDB(db int) option.Setting[RegistryOptions]
- func (Option) KeyPrefix(prefix string) option.Setting[RegistryOptions]
- func (Option) RedisClient(cli *redis.Client) option.Setting[RegistryOptions]
- func (Option) RedisConfig(conf *redis.Options) option.Setting[RegistryOptions]
- func (Option) RedisURL(url string) option.Setting[RegistryOptions]
- func (Option) WatchChanSize(size int) option.Setting[RegistryOptions]
- type RegistryOptions
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) 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大小
Click to show internal directories.
Click to hide internal directories.