naming

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusUp   = 0
	StatusDown = 1

	GroupID       = "TSF_GROUP_ID"
	NamespaceID   = "TSF_NAMESPACE_ID"
	ApplicationID = "TSF_APPLICATION_ID"
	Region        = "TSF_REGION"

	NsLocal  = "local"
	NsGlobal = "global"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Instance

type Instance struct {
	// 服务信息
	Service *Service `json:"service,omitempty"`
	// namespace下全局唯一的实例ID
	ID string `json:"id"`
	// 服务实例所属地域
	Region string `json:"region"`
	// 服务实例可访问的ip地址
	Host string `json:"host"`
	// 协议端口
	Port int `json:"port"`
	// 服务实例标签元信息,比如appVersion、group、weight等
	Metadata map[string]string `json:"metadata"`
	// 实例运行状态: up/down
	Status int64 `json:"status"`
	// 过滤用的标签
	Tags []string `json:"tags"`
}

Instance 服务实例信息

func FromKratosInstance

func FromKratosInstance(ki *registry.ServiceInstance) (inss []*Instance)

func (Instance) Addr

func (i Instance) Addr() string

func (Instance) ToKratosInstance

func (i Instance) ToKratosInstance() *registry.ServiceInstance

type Service

type Service struct {
	Namespace string
	Name      string
}

Service 服务信息

func NewService

func NewService(namespace string, name string) *Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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