types

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientNode

type ClientNode struct {
	Name     string              `json:"name" toml:"name"`
	Scheme   string              `json:"schema" toml:"scheme"`
	Address  string              `json:"address" toml:"address"`
	Labels   map[string]string   `json:"labels" toml:"labels"`
	Services map[string]*Service `json:"services" toml:"services"`
}

ClientNode ...

type Config

type Config struct {
	Disable bool   `json:"enable" toml:"enable"`
	Group   string `json:"group" toml:"group"`
	Weight  int    `json:"weight" toml:"weight"`
}

type GroupInfo

type GroupInfo struct {
	Name   string `json:"name" toml:"name"`
	Weight int    `json:"weight" toml:"weight"`
}

GroupInfo ...

type Meta

type Meta struct {
	Info   ServerNode `json:"info,omitempty" toml:"info"`
	Config Config     `json:"config" toml:"config"`
}

Meta ...

type RegionInfo

type RegionInfo struct {
	Name string `json:"name" toml:"name"`
}

RegionInfo ...

type ServerNode

type ServerNode struct {
	Name     string              `json:"name" toml:"name"`
	Scheme   string              `json:"scheme" toml:"scheme"` // http | grpc
	Address  string              `json:"address" toml:"address"`
	Labels   map[string]string   `json:"labels" toml:"labels"` // 标签: group, weight, enable 等
	Services map[string]*Service `json:"services" toml:"services"`
}

ServerNode ...

func (ServerNode) Label

func (n ServerNode) Label() string

Label register label to etcd

type Service

type Service struct {
	Namespace string            `json:"namespace" toml:"namespace"`
	Name      string            `json:"name" toml:"name"`
	Labels    map[string]string `json:"labels" toml:"labels"`
	Methods   []string          `json:"methods" toml:"methods"`
}

一个Server可以实现多个Service接口

type ServiceInfo

type ServiceInfo struct {
	Env      string   `json:"env" toml:"env"`
	IID      string   `json:"iid" toml:"iid"`
	AppID    string   `json:"app_id" toml:"app_id"`
	AppName  string   `json:"app_name" toml:"app_name"`
	Hostname string   `json:"hostname" toml:"hostname"`
	Version  string   `json:"version" toml:"version"`
	Schema   string   `json:"schema" toml:"schema"`
	Address  string   `json:"address" toml:"address"`
	Methods  []string `json:"methods" toml:"methods"`
	Name     string   `json:"name" toml:"name"`
	// 服务元信息
	ServiceMeta []map[string]string `json:"metadata" toml:"metadata"`
}

ServiceInfo represents a server the client connects to.

func (ServiceInfo) RegisterKey

func (si ServiceInfo) RegisterKey() string

RegisterKey ...

type ServiceMeta

type ServiceMeta struct {
	Op       naming.Operation
	Addr     string
	Metadata interface{}
	Meta     Meta `json:"meta" toml:"meta"`
}

ServiceMeta ...

type TrafficInfo

type TrafficInfo struct {
	Groups []GroupInfo `json:"groups" toml:"groups"`
	Region RegionInfo  `json:"region" toml:"region"`
	Switch bool        `json:"switch" toml:"switch"`
}

TrafficInfo ...

type WorkerNode

type WorkerNode struct {
	Name string `json:"name" toml:"name"`
	Spec string `json:"spec" toml:"spec"`
}

WorkerNode ...

Jump to

Keyboard shortcuts

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