Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceManageServer(s grpc.ServiceRegistrar, srv ServiceManageServer)
- type AllServices
- type IsPriority
- type Service
- type ServiceHost
- type ServiceManage
- type ServiceManageClient
- type ServiceManageServer
- type ServicePrefix
- type TimeSeriesData
- type UnimplementedServiceManageServer
- type UnsafeServiceManageServer
Constants ¶
const (
AppName = "ServiceManage"
)
const (
ServiceManage_RecoverService_FullMethodName = "/ServiceManage/RecoverService"
)
Variables ¶
var File_ServiceManage_proto protoreflect.FileDescriptor
var ServiceManage_ServiceDesc = grpc.ServiceDesc{ ServiceName: "ServiceManage", HandlerType: (*ServiceManageServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "RecoverService", Handler: _ServiceManage_RecoverService_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "ServiceManage.proto", }
ServiceManage_ServiceDesc is the grpc.ServiceDesc for ServiceManage service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceManageServer ¶
func RegisterServiceManageServer(s grpc.ServiceRegistrar, srv ServiceManageServer)
Types ¶
type AllServices ¶
type AllServices struct {
ServiceInstances []map[string]map[string][]string `json:"service_instances"` //map[projectname: string]{map[servicename: string]:[{service: string...}]}
}
func (*AllServices) String ¶
func (a *AllServices) String() string
type IsPriority ¶
type IsPriority struct {
Priority bool `json:"priority"`
}
type ServiceHost ¶
type ServiceHost struct { ServiceHost string `protobuf:"bytes,1,opt,name=ServiceHost,proto3" json:"ServiceHost,omitempty"` // contains filtered or unexported fields }
func (*ServiceHost) Descriptor
deprecated
func (*ServiceHost) Descriptor() ([]byte, []int)
Deprecated: Use ServiceHost.ProtoReflect.Descriptor instead.
func (*ServiceHost) GetServiceHost ¶
func (x *ServiceHost) GetServiceHost() string
func (*ServiceHost) ProtoMessage ¶
func (*ServiceHost) ProtoMessage()
func (*ServiceHost) ProtoReflect ¶
func (x *ServiceHost) ProtoReflect() protoreflect.Message
func (*ServiceHost) Reset ¶
func (x *ServiceHost) Reset()
func (*ServiceHost) String ¶
func (x *ServiceHost) String() string
type ServiceManage ¶
type ServiceManage interface { //TODO implement 获取服务状态 FetchServiceStatus(ctx context.Context, service *Service) (*IsPriority, error) //TODO implement 获取服务信息 FetchServiceInfo(ctx context.Context) (*AllServices, error) //TODO implement http 服务注销 UnRegisterService(ctx context.Context, Service *Service) error //TODO implement http 指定服务为最优 SetBestService(ctx context.Context, Service *Service) error //TODO implement http 指定服务为不是优 UnSetBestService(ctx context.Context, Service *Service) error //TODO 获取指定服务2小时的指标 FetchMetricsForServiceLastTwoHour(ctx context.Context, service *Service) (*TimeSeriesData, error) //TODO 取指定服务的6小时内的指标 FetchMetricsForServiceLastSixHour(ctx context.Context, service *Service) (*TimeSeriesData, error) //TODO 获取指定服务12小时内的指标 FetchMetricsForServiceRecent(ctx context.Context, service *Service) (*TimeSeriesData, error) //TODO 获取指定服务24小时内的指标 FetchServiceMetricsForLastDay(ctx context.Context, service *Service) (*TimeSeriesData, error) }
type ServiceManageClient ¶
type ServiceManageClient interface { // 服务发现 获取最佳节点地址 RecoverService(ctx context.Context, in *ServicePrefix, opts ...grpc.CallOption) (*ServiceHost, error) }
ServiceManageClient is the client API for ServiceManage 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 NewServiceManageClient ¶
func NewServiceManageClient(cc grpc.ClientConnInterface) ServiceManageClient
type ServiceManageServer ¶
type ServiceManageServer interface { // 服务发现 获取最佳节点地址 RecoverService(context.Context, *ServicePrefix) (*ServiceHost, error) // contains filtered or unexported methods }
ServiceManageServer is the server API for ServiceManage service. All implementations must embed UnimplementedServiceManageServer for forward compatibility
type ServicePrefix ¶
type ServicePrefix struct { ServicePrefix string `protobuf:"bytes,1,opt,name=ServiceName,proto3" json:"ServiceName,omitempty"` // contains filtered or unexported fields }
func (*ServicePrefix) Descriptor
deprecated
func (*ServicePrefix) Descriptor() ([]byte, []int)
Deprecated: Use ServiceName.ProtoReflect.Descriptor instead.
func (*ServicePrefix) GetServicePrefix ¶
func (x *ServicePrefix) GetServicePrefix() string
func (*ServicePrefix) ProtoMessage ¶
func (*ServicePrefix) ProtoMessage()
func (*ServicePrefix) ProtoReflect ¶
func (x *ServicePrefix) ProtoReflect() protoreflect.Message
func (*ServicePrefix) Reset ¶
func (x *ServicePrefix) Reset()
func (*ServicePrefix) String ¶
func (x *ServicePrefix) String() string
type TimeSeriesData ¶
type TimeSeriesData struct { Timestamps []string `json:"timestamps"` CpuUsages []float64 `json:"cpuUsages"` MemoryUsages []float64 `json:"memoryUsages"` IcmpDelays []int64 `json:"icmpDelays"` }
func (*TimeSeriesData) String ¶
func (a *TimeSeriesData) String() string
type UnimplementedServiceManageServer ¶
type UnimplementedServiceManageServer struct { }
UnimplementedServiceManageServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceManageServer) RecoverService ¶
func (UnimplementedServiceManageServer) RecoverService(context.Context, *ServicePrefix) (*ServiceHost, error)
type UnsafeServiceManageServer ¶
type UnsafeServiceManageServer interface {
// contains filtered or unexported methods
}
UnsafeServiceManageServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceManageServer will result in compilation errors.