discovery

package
v0.0.0-...-e16029c Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Discovery_OnlineServices_FullMethodName = "/api.console.discovery.Discovery/OnlineServices"
	Discovery_KVListClusters_FullMethodName = "/api.console.discovery.Discovery/KVListClusters"
	Discovery_KVListKeys_FullMethodName     = "/api.console.discovery.Discovery/KVListKeys"
	Discovery_KVGetValue_FullMethodName     = "/api.console.discovery.Discovery/KVGetValue"
	Discovery_KVUpdateHang_FullMethodName   = "/api.console.discovery.Discovery/KVUpdateHang"
)
View Source
const OperationDiscoveryKVGetValue = "/api.console.discovery.Discovery/KVGetValue"
View Source
const OperationDiscoveryKVListClusters = "/api.console.discovery.Discovery/KVListClusters"
View Source
const OperationDiscoveryKVListKeys = "/api.console.discovery.Discovery/KVListKeys"
View Source
const OperationDiscoveryKVUpdateHang = "/api.console.discovery.Discovery/KVUpdateHang"
View Source
const OperationDiscoveryOnlineServices = "/api.console.discovery.Discovery/OnlineServices"

Variables

View Source
var Discovery_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "api.console.discovery.Discovery",
	HandlerType: (*DiscoveryServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OnlineServices",
			Handler:    _Discovery_OnlineServices_Handler,
		},
		{
			MethodName: "KVListClusters",
			Handler:    _Discovery_KVListClusters_Handler,
		},
		{
			MethodName: "KVListKeys",
			Handler:    _Discovery_KVListKeys_Handler,
		},
		{
			MethodName: "KVGetValue",
			Handler:    _Discovery_KVGetValue_Handler,
		},
		{
			MethodName: "KVUpdateHang",
			Handler:    _Discovery_KVUpdateHang_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "console/discovery/disocvery.proto",
}

Discovery_ServiceDesc is the grpc.ServiceDesc for Discovery service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_console_discovery_disocvery_proto protoreflect.FileDescriptor

Functions

func RegisterDiscoveryHTTPServer

func RegisterDiscoveryHTTPServer(s *http.Server, srv DiscoveryHTTPServer)

func RegisterDiscoveryServer

func RegisterDiscoveryServer(s grpc.ServiceRegistrar, srv DiscoveryServer)

Types

type DiscoveryClient

type DiscoveryClient interface {
	OnlineServices(ctx context.Context, in *OnlineServiceRequest, opts ...grpc.CallOption) (*OnlineServiceReply, error)
	KVListClusters(ctx context.Context, in *KVListClustersRequest, opts ...grpc.CallOption) (*KVListClustersReply, error)
	KVListKeys(ctx context.Context, in *KVListKeysRequest, opts ...grpc.CallOption) (*KVListKeysReply, error)
	KVGetValue(ctx context.Context, in *KVGetValueRequest, opts ...grpc.CallOption) (*KVGetValueReply, error)
	KVUpdateHang(ctx context.Context, in *KVUpdateHangRequest, opts ...grpc.CallOption) (*KVUpdateHangReply, error)
}

DiscoveryClient is the client API for Discovery service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewDiscoveryClient

func NewDiscoveryClient(cc grpc.ClientConnInterface) DiscoveryClient

type DiscoveryHTTPClient

type DiscoveryHTTPClient interface {
	KVGetValue(ctx context.Context, req *KVGetValueRequest, opts ...http.CallOption) (rsp *KVGetValueReply, err error)
	KVListClusters(ctx context.Context, req *KVListClustersRequest, opts ...http.CallOption) (rsp *KVListClustersReply, err error)
	KVListKeys(ctx context.Context, req *KVListKeysRequest, opts ...http.CallOption) (rsp *KVListKeysReply, err error)
	KVUpdateHang(ctx context.Context, req *KVUpdateHangRequest, opts ...http.CallOption) (rsp *KVUpdateHangReply, err error)
	OnlineServices(ctx context.Context, req *OnlineServiceRequest, opts ...http.CallOption) (rsp *OnlineServiceReply, err error)
}

func NewDiscoveryHTTPClient

func NewDiscoveryHTTPClient(client *http.Client) DiscoveryHTTPClient

type DiscoveryHTTPClientImpl

type DiscoveryHTTPClientImpl struct {
	// contains filtered or unexported fields
}

func (*DiscoveryHTTPClientImpl) KVGetValue

func (*DiscoveryHTTPClientImpl) KVListClusters

func (*DiscoveryHTTPClientImpl) KVListKeys

func (*DiscoveryHTTPClientImpl) KVUpdateHang

func (*DiscoveryHTTPClientImpl) OnlineServices

type DiscoveryServer

type DiscoveryServer interface {
	OnlineServices(context.Context, *OnlineServiceRequest) (*OnlineServiceReply, error)
	KVListClusters(context.Context, *KVListClustersRequest) (*KVListClustersReply, error)
	KVListKeys(context.Context, *KVListKeysRequest) (*KVListKeysReply, error)
	KVGetValue(context.Context, *KVGetValueRequest) (*KVGetValueReply, error)
	KVUpdateHang(context.Context, *KVUpdateHangRequest) (*KVUpdateHangReply, error)
	// contains filtered or unexported methods
}

DiscoveryServer is the server API for Discovery service. All implementations must embed UnimplementedDiscoveryServer for forward compatibility.

type KVGetValueReply

type KVGetValueReply struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*KVGetValueReply) Descriptor deprecated

func (*KVGetValueReply) Descriptor() ([]byte, []int)

Deprecated: Use KVGetValueReply.ProtoReflect.Descriptor instead.

func (*KVGetValueReply) GetValue

func (x *KVGetValueReply) GetValue() string

func (*KVGetValueReply) ProtoMessage

func (*KVGetValueReply) ProtoMessage()

func (*KVGetValueReply) ProtoReflect

func (x *KVGetValueReply) ProtoReflect() protoreflect.Message

func (*KVGetValueReply) Reset

func (x *KVGetValueReply) Reset()

func (*KVGetValueReply) String

func (x *KVGetValueReply) String() string

type KVGetValueRequest

type KVGetValueRequest struct {
	Key     string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Cluster string `protobuf:"bytes,2,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// contains filtered or unexported fields
}

func (*KVGetValueRequest) Descriptor deprecated

func (*KVGetValueRequest) Descriptor() ([]byte, []int)

Deprecated: Use KVGetValueRequest.ProtoReflect.Descriptor instead.

func (*KVGetValueRequest) GetCluster

func (x *KVGetValueRequest) GetCluster() string

func (*KVGetValueRequest) GetKey

func (x *KVGetValueRequest) GetKey() string

func (*KVGetValueRequest) ProtoMessage

func (*KVGetValueRequest) ProtoMessage()

func (*KVGetValueRequest) ProtoReflect

func (x *KVGetValueRequest) ProtoReflect() protoreflect.Message

func (*KVGetValueRequest) Reset

func (x *KVGetValueRequest) Reset()

func (*KVGetValueRequest) String

func (x *KVGetValueRequest) String() string

type KVListClustersReply

type KVListClustersReply struct {
	Clusters []string `protobuf:"bytes,1,rep,name=clusters,proto3" json:"clusters,omitempty"`
	// contains filtered or unexported fields
}

func (*KVListClustersReply) Descriptor deprecated

func (*KVListClustersReply) Descriptor() ([]byte, []int)

Deprecated: Use KVListClustersReply.ProtoReflect.Descriptor instead.

func (*KVListClustersReply) GetClusters

func (x *KVListClustersReply) GetClusters() []string

func (*KVListClustersReply) ProtoMessage

func (*KVListClustersReply) ProtoMessage()

func (*KVListClustersReply) ProtoReflect

func (x *KVListClustersReply) ProtoReflect() protoreflect.Message

func (*KVListClustersReply) Reset

func (x *KVListClustersReply) Reset()

func (*KVListClustersReply) String

func (x *KVListClustersReply) String() string

type KVListClustersRequest

type KVListClustersRequest struct {
	// contains filtered or unexported fields
}

func (*KVListClustersRequest) Descriptor deprecated

func (*KVListClustersRequest) Descriptor() ([]byte, []int)

Deprecated: Use KVListClustersRequest.ProtoReflect.Descriptor instead.

func (*KVListClustersRequest) ProtoMessage

func (*KVListClustersRequest) ProtoMessage()

func (*KVListClustersRequest) ProtoReflect

func (x *KVListClustersRequest) ProtoReflect() protoreflect.Message

func (*KVListClustersRequest) Reset

func (x *KVListClustersRequest) Reset()

func (*KVListClustersRequest) String

func (x *KVListClustersRequest) String() string

type KVListKeysReply

type KVListKeysReply struct {
	Keys []string `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
	// contains filtered or unexported fields
}

func (*KVListKeysReply) Descriptor deprecated

func (*KVListKeysReply) Descriptor() ([]byte, []int)

Deprecated: Use KVListKeysReply.ProtoReflect.Descriptor instead.

func (*KVListKeysReply) GetKeys

func (x *KVListKeysReply) GetKeys() []string

func (*KVListKeysReply) ProtoMessage

func (*KVListKeysReply) ProtoMessage()

func (*KVListKeysReply) ProtoReflect

func (x *KVListKeysReply) ProtoReflect() protoreflect.Message

func (*KVListKeysReply) Reset

func (x *KVListKeysReply) Reset()

func (*KVListKeysReply) String

func (x *KVListKeysReply) String() string

type KVListKeysRequest

type KVListKeysRequest struct {
	Cluster string `protobuf:"bytes,1,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// contains filtered or unexported fields
}

func (*KVListKeysRequest) Descriptor deprecated

func (*KVListKeysRequest) Descriptor() ([]byte, []int)

Deprecated: Use KVListKeysRequest.ProtoReflect.Descriptor instead.

func (*KVListKeysRequest) GetCluster

func (x *KVListKeysRequest) GetCluster() string

func (*KVListKeysRequest) ProtoMessage

func (*KVListKeysRequest) ProtoMessage()

func (*KVListKeysRequest) ProtoReflect

func (x *KVListKeysRequest) ProtoReflect() protoreflect.Message

func (*KVListKeysRequest) Reset

func (x *KVListKeysRequest) Reset()

func (*KVListKeysRequest) String

func (x *KVListKeysRequest) String() string

type KVUpdateHangReply

type KVUpdateHangReply struct {
	// contains filtered or unexported fields
}

func (*KVUpdateHangReply) Descriptor deprecated

func (*KVUpdateHangReply) Descriptor() ([]byte, []int)

Deprecated: Use KVUpdateHangReply.ProtoReflect.Descriptor instead.

func (*KVUpdateHangReply) ProtoMessage

func (*KVUpdateHangReply) ProtoMessage()

func (*KVUpdateHangReply) ProtoReflect

func (x *KVUpdateHangReply) ProtoReflect() protoreflect.Message

func (*KVUpdateHangReply) Reset

func (x *KVUpdateHangReply) Reset()

func (*KVUpdateHangReply) String

func (x *KVUpdateHangReply) String() string

type KVUpdateHangRequest

type KVUpdateHangRequest struct {

	// 主键
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// 挂起状态 true 为挂起1111
	Hang bool `protobuf:"varint,2,opt,name=hang,proto3" json:"hang,omitempty"`
	// contains filtered or unexported fields
}

func (*KVUpdateHangRequest) Descriptor deprecated

func (*KVUpdateHangRequest) Descriptor() ([]byte, []int)

Deprecated: Use KVUpdateHangRequest.ProtoReflect.Descriptor instead.

func (*KVUpdateHangRequest) GetHang

func (x *KVUpdateHangRequest) GetHang() bool

func (*KVUpdateHangRequest) GetId

func (x *KVUpdateHangRequest) GetId() int64

func (*KVUpdateHangRequest) ProtoMessage

func (*KVUpdateHangRequest) ProtoMessage()

func (*KVUpdateHangRequest) ProtoReflect

func (x *KVUpdateHangRequest) ProtoReflect() protoreflect.Message

func (*KVUpdateHangRequest) Reset

func (x *KVUpdateHangRequest) Reset()

func (*KVUpdateHangRequest) String

func (x *KVUpdateHangRequest) String() string

type OnlineServiceReply

type OnlineServiceReply struct {
	Pagination *protobuf.Pagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
	Data       []*ServiceGroup      `protobuf:"bytes,2,rep,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*OnlineServiceReply) Descriptor deprecated

func (*OnlineServiceReply) Descriptor() ([]byte, []int)

Deprecated: Use OnlineServiceReply.ProtoReflect.Descriptor instead.

func (*OnlineServiceReply) GetData

func (x *OnlineServiceReply) GetData() []*ServiceGroup

func (*OnlineServiceReply) GetPagination

func (x *OnlineServiceReply) GetPagination() *protobuf.Pagination

func (*OnlineServiceReply) ProtoMessage

func (*OnlineServiceReply) ProtoMessage()

func (*OnlineServiceReply) ProtoReflect

func (x *OnlineServiceReply) ProtoReflect() protoreflect.Message

func (*OnlineServiceReply) Reset

func (x *OnlineServiceReply) Reset()

func (*OnlineServiceReply) String

func (x *OnlineServiceReply) String() string

type OnlineServiceRequest

type OnlineServiceRequest struct {

	// pagination filter
	Pagination *protobuf.Pagination `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"`
	// service name
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// service namespace
	Namespace string `protobuf:"bytes,3,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

func (*OnlineServiceRequest) Descriptor deprecated

func (*OnlineServiceRequest) Descriptor() ([]byte, []int)

Deprecated: Use OnlineServiceRequest.ProtoReflect.Descriptor instead.

func (*OnlineServiceRequest) GetName

func (x *OnlineServiceRequest) GetName() string

func (*OnlineServiceRequest) GetNamespace

func (x *OnlineServiceRequest) GetNamespace() string

func (*OnlineServiceRequest) GetPagination

func (x *OnlineServiceRequest) GetPagination() *protobuf.Pagination

func (*OnlineServiceRequest) ProtoMessage

func (*OnlineServiceRequest) ProtoMessage()

func (*OnlineServiceRequest) ProtoReflect

func (x *OnlineServiceRequest) ProtoReflect() protoreflect.Message

func (*OnlineServiceRequest) Reset

func (x *OnlineServiceRequest) Reset()

func (*OnlineServiceRequest) String

func (x *OnlineServiceRequest) String() string

type Service

type Service struct {
	Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// 唯一标识
	Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// 主机名
	Hostname string `protobuf:"bytes,3,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// 服务名称
	Name string `protobuf:"bytes,4,opt,name=name,proto3" json:"name,omitempty"`
	// 版本
	Version string `protobuf:"bytes,5,opt,name=version,proto3" json:"version,omitempty"`
	// 服务地址
	Endpoints []string `protobuf:"bytes,6,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
	// 集群
	Cluster string `protobuf:"bytes,7,opt,name=cluster,proto3" json:"cluster,omitempty"`
	// 挂起状态 true 为挂起
	Hang bool `protobuf:"varint,8,opt,name=hang,proto3" json:"hang,omitempty"`
	// 元信息
	Metadata map[string]string `` /* 143-byte string literal not displayed */
	// 命名空间
	Namespace string `protobuf:"bytes,10,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// 上次心跳间隔
	LastHealthySec int32 `protobuf:"varint,11,opt,name=last_healthy_sec,json=lastHealthySec,proto3" json:"last_healthy_sec,omitempty"`
	// contains filtered or unexported fields
}

func (*Service) Descriptor deprecated

func (*Service) Descriptor() ([]byte, []int)

Deprecated: Use Service.ProtoReflect.Descriptor instead.

func (*Service) GetCluster

func (x *Service) GetCluster() string

func (*Service) GetEndpoints

func (x *Service) GetEndpoints() []string

func (*Service) GetHang

func (x *Service) GetHang() bool

func (*Service) GetHostname

func (x *Service) GetHostname() string

func (*Service) GetId

func (x *Service) GetId() int64

func (*Service) GetKey

func (x *Service) GetKey() string

func (*Service) GetLastHealthySec

func (x *Service) GetLastHealthySec() int32

func (*Service) GetMetadata

func (x *Service) GetMetadata() map[string]string

func (*Service) GetName

func (x *Service) GetName() string

func (*Service) GetNamespace

func (x *Service) GetNamespace() string

func (*Service) GetVersion

func (x *Service) GetVersion() string

func (*Service) ProtoMessage

func (*Service) ProtoMessage()

func (*Service) ProtoReflect

func (x *Service) ProtoReflect() protoreflect.Message

func (*Service) Reset

func (x *Service) Reset()

func (*Service) String

func (x *Service) String() string

type ServiceGroup

type ServiceGroup struct {

	// 唯一标识
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// 主机名
	Hostname string `protobuf:"bytes,2,opt,name=hostname,proto3" json:"hostname,omitempty"`
	// 服务名称
	Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
	// 版本
	Version string `protobuf:"bytes,4,opt,name=version,proto3" json:"version,omitempty"`
	// 服务地址
	Endpoints []string `protobuf:"bytes,5,rep,name=endpoints,proto3" json:"endpoints,omitempty"`
	// 集群
	Clusters []string `protobuf:"bytes,6,rep,name=clusters,proto3" json:"clusters,omitempty"`
	// 同服务,不同实例的数组信息
	Children []*Service `protobuf:"bytes,7,rep,name=children,proto3" json:"children,omitempty"`
	// 命名空间
	Namespace string `protobuf:"bytes,8,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// 数据类型
	IsGroup bool `protobuf:"varint,9,opt,name=is_group,json=isGroup,proto3" json:"is_group,omitempty"`
	// contains filtered or unexported fields
}

func (*ServiceGroup) Descriptor deprecated

func (*ServiceGroup) Descriptor() ([]byte, []int)

Deprecated: Use ServiceGroup.ProtoReflect.Descriptor instead.

func (*ServiceGroup) GetChildren

func (x *ServiceGroup) GetChildren() []*Service

func (*ServiceGroup) GetClusters

func (x *ServiceGroup) GetClusters() []string

func (*ServiceGroup) GetEndpoints

func (x *ServiceGroup) GetEndpoints() []string

func (*ServiceGroup) GetHostname

func (x *ServiceGroup) GetHostname() string

func (*ServiceGroup) GetIsGroup

func (x *ServiceGroup) GetIsGroup() bool

func (*ServiceGroup) GetKey

func (x *ServiceGroup) GetKey() string

func (*ServiceGroup) GetName

func (x *ServiceGroup) GetName() string

func (*ServiceGroup) GetNamespace

func (x *ServiceGroup) GetNamespace() string

func (*ServiceGroup) GetVersion

func (x *ServiceGroup) GetVersion() string

func (*ServiceGroup) ProtoMessage

func (*ServiceGroup) ProtoMessage()

func (*ServiceGroup) ProtoReflect

func (x *ServiceGroup) ProtoReflect() protoreflect.Message

func (*ServiceGroup) Reset

func (x *ServiceGroup) Reset()

func (*ServiceGroup) String

func (x *ServiceGroup) String() string

type UnimplementedDiscoveryServer

type UnimplementedDiscoveryServer struct{}

UnimplementedDiscoveryServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedDiscoveryServer) KVGetValue

func (UnimplementedDiscoveryServer) KVListClusters

func (UnimplementedDiscoveryServer) KVListKeys

func (UnimplementedDiscoveryServer) KVUpdateHang

func (UnimplementedDiscoveryServer) OnlineServices

type UnsafeDiscoveryServer

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

UnsafeDiscoveryServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DiscoveryServer will result in compilation errors.

Jump to

Keyboard shortcuts

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