registry

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: Apache-2.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

View Source
const (
	PROTOCOL_HTTP  = "http://"
	PROTOCOL_HTTPS = "https://"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientOptions

type ClientOptions struct {
	TimeoutMs            uint64 //timeout for requesting Nacos server, default value is 10000ms
	BeatInterval         int64  //the time interval for sending beat to server,default value is 5000ms
	NamespaceId          string //the namespaceId of Nacos
	AppName              string //the appName
	Endpoint             string //the endpoint for get Nacos server addresses
	RegionId             string //the regionId for kms
	AccessKey            string //the AccessKey for kms
	SecretKey            string //the SecretKey for kms
	OpenKMS              bool   //it's to open kms,default is false. https://help.aliyun.com/product/28933.html
	CacheDir             string //the directory for persist nacos service info,default value is current path
	UpdateThreadNum      int    //the number of gorutine for update nacos service info,default value is 20
	NotLoadCacheAtStart  bool   //not to load persistent nacos service info in CacheDir at start time
	UpdateCacheWhenEmpty bool   //update cache when get empty service instance from server
	Username             string //the username for nacos auth
	Password             string //the password for nacos auth
	LogDir               string //the directory for log, default is current path
	RotateTime           string //the rotate time for log, eg: 30m, 1h, 24h, default is 24h
	MaxAge               int64  //the max age of a log file, default value is 3
	LogLevel             string //the level of log, it's must be debug,info,warn,error, default value is info
	ContextPath          string //the nacos server contextpath
}

type IRegistry

type IRegistry interface {
	RegisterInstance() error
	Shutdown()
	Subscribe(serviceName string) error
	GetInstance(serviceName string) *Instance
	SelectInstances(serviceName string) ([]*Instance, error)
}
var RegistryCenter IRegistry

type Instance

type Instance struct {
	Ip       string
	Port     uint64
	Metadata map[string]string
}

func (*Instance) GetHost

func (i *Instance) GetHost() string

func (*Instance) GetUrl

func (i *Instance) GetUrl() string

type Options

type Options struct {
	ServerAddrs     []string
	ClientOptions   ClientOptions
	RegistryOptions RegistryOptions
}

type RegistryOptions

type RegistryOptions struct {
	Group       string
	ServiceName string
	ServicePort uint64
	Version     string
}

Jump to

Keyboard shortcuts

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