Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Version polaris plugin version Version = "0.0.1" // DefaultNamespace name space DefaultNamespace = "default" // DefaultService Default service name DefaultService = "GoGF-polaris" // DefaultPort default service port DefaultPort = 8199 // TTL .The timeout period, if the node wants to call heartbeat to report, // it must be filled in, otherwise it will be 400141 error code, unit: second TTL int = 2 )
Variables ¶
View Source
var (
CfgGlobal config.Configuration
)
Functions ¶
func InitConfigPolaris ¶
func InitConfigPolaris() error
InitConfigPolaris Polaris plug-in initialization.
Types ¶
type ConfigPolaris ¶
type ConfigPolaris struct { // IsHeartbeat whether to enable heartbeat reporting IsHeartbeat uint `json:"isHeartbeat"` // LoggerPath log directory LoggerPath string `json:"loggerPath"` // BackupPath backup directory BackupPath string `json:"backupPath"` }
ConfigPolaris config
type GfPolarisPlugin ¶
type GfPolarisPlugin struct {
Listener ConfigListener
}
GfPolarisPlugin .
func (GfPolarisPlugin) Description ¶
func (p GfPolarisPlugin) Description() string
Description desc of plugin
func (GfPolarisPlugin) Install ¶
func (p GfPolarisPlugin) Install(s *ghttp.Server) error
Install plugin installation
func (GfPolarisPlugin) Version ¶
func (p GfPolarisPlugin) Version() string
Version gf Polaris plugin version
type InstanceRequest ¶
type InstanceRequest struct { // Service Required, service name Service string // ServiceToken Required, service access token ServiceToken string // Namespace Required, namespace Namespace string // Host Required, service monitoring host, support IPv 6 address Host string // Port Required, service instance monitor port Port int // The following fields are optional, the default nil means that the client is not configured, and the server configuration is used // Protocol Service Agreement Protocol string // Weight Service weight, default 100, range 0-10000 Weight int // Priority Instance priority, the default is 0, the smaller the value, the higher the priority Priority int // Version Instance provides service version number Version string // Metadata user defined metadata information Metadata map[string]string // Healthy Whether the service instance is healthy, the default is healthy Healthy bool // Isolate Whether the service instance is isolated, not isolated by default Isolate bool // TTL timeout, if the node wants to call heartbeat to report, // it must be filled in, otherwise it will be 400141 error code, unit: second TTL int // Timeout Optional, single query timeout time, the default is to directly obtain the global timeout configuration // The user's total maximum timeout time is (1+RetryCount) Timeout Timeout time.Duration // RetryCount Optional, the number of retries, the global timeout configuration is directly obtained by default RetryCount int }
InstanceRequest .
func GetInstanceConfig ¶
func GetInstanceConfig(ctx context.Context) (*InstanceRequest, error)
GetInstanceConfig .instance Config
type Polaris ¶
type Polaris struct { // Config polaris configuration Config *ConfigPolaris `json:"config"` // Instance Service configuration information Instance *InstanceRequest `json:"server"` }
Polaris .
Click to show internal directories.
Click to hide internal directories.