metadata

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultVersion = "v1.0.0"

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceMetadata

type ServiceMetadata struct {
	ServiceName  string            `json:"service_name"`  // 服务名称
	Version      string            `json:"version"`       // 服务版本
	Address      string            `json:"address"`       // 服务地址
	Env          string            `json:"env"`           // 服务环境
	Weight       int               `json:"weight"`        // 服务权重,用于负载均衡
	Tags         []string          `json:"tags"`          // 服务标签
	Status       ServiceStatus     `json:"status"`        // 服务状态:up, down, starting, stopping
	RegisterTime int64             `json:"register_time"` // 注册时间
	InstanceID   string            `json:"instance_id"`   // 服务实例ID
	Properties   map[string]string `json:"properties"`    // 额外属性
}

ServiceMetadata 服务元数据

func (*ServiceMetadata) String

func (s *ServiceMetadata) String() string

func (*ServiceMetadata) Unmarshal

func (s *ServiceMetadata) Unmarshal(value []byte) error

type ServiceRegister

type ServiceRegister interface {
	RegisterMetadata() ServiceRegisterMetadata
	UnsafeServiceRegister
}

type ServiceRegisterMetadata

type ServiceRegisterMetadata struct {
	AppName     string
	ServiceName string
	Version     string
	Env         string
	Tags        []string
}

type ServiceStatus

type ServiceStatus string

ServiceStatus 服务状态

const (
	ServiceStatusUp       ServiceStatus = "up"
	ServiceStatusDown     ServiceStatus = "down"
	ServiceStatusStarting ServiceStatus = "starting"
	ServiceStatusStopping ServiceStatus = "stopping"
)

type UnimplementedServiceRegister

type UnimplementedServiceRegister struct{}

func (UnimplementedServiceRegister) RegisterMetadata

type UnsafeServiceRegister

type UnsafeServiceRegister interface {
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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