houston package 독립

This commit is contained in:
2023-05-21 23:37:54 +09:00
commit 3e8c79a48b
20 changed files with 3152 additions and 0 deletions

50
shared/operator.go Normal file
View File

@ -0,0 +1,50 @@
package shared
type Operation string
const (
Deploy = Operation("deploy")
Withdraw = Operation("withdraw")
Upgrade = Operation("upgrade")
Start = Operation("start")
Restart = Operation("restart")
Stop = Operation("stop")
Upload = Operation("upload")
)
type DeployRequest struct {
Name string
Version string
Url string
AccessToken string
}
type WithdrawRequest struct {
Name string
Version string
}
type StartProcessRequest struct {
Name string
Version string
Args string
}
type StopProcessRequest struct {
Name string
Version string
Pid int32
}
type RestartProcessRequest struct {
Name string
Version string
}
type UploadRequest struct {
Name string
Version string
Url string
Filter string
DeleteAfterUploaded string // true, false
}

131
shared/protos/empty.pb.go Normal file
View File

@ -0,0 +1,131 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.10
// source: protos/empty.proto
package protos
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Empty struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Empty) Reset() {
*x = Empty{}
if protoimpl.UnsafeEnabled {
mi := &file_protos_empty_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Empty) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Empty) ProtoMessage() {}
func (x *Empty) ProtoReflect() protoreflect.Message {
mi := &file_protos_empty_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Empty.ProtoReflect.Descriptor instead.
func (*Empty) Descriptor() ([]byte, []int) {
return file_protos_empty_proto_rawDescGZIP(), []int{0}
}
var File_protos_empty_proto protoreflect.FileDescriptor
var file_protos_empty_proto_rawDesc = []byte{
0x0a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x0f, 0x5a,
0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_protos_empty_proto_rawDescOnce sync.Once
file_protos_empty_proto_rawDescData = file_protos_empty_proto_rawDesc
)
func file_protos_empty_proto_rawDescGZIP() []byte {
file_protos_empty_proto_rawDescOnce.Do(func() {
file_protos_empty_proto_rawDescData = protoimpl.X.CompressGZIP(file_protos_empty_proto_rawDescData)
})
return file_protos_empty_proto_rawDescData
}
var file_protos_empty_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_protos_empty_proto_goTypes = []interface{}{
(*Empty)(nil), // 0: Empty
}
var file_protos_empty_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_protos_empty_proto_init() }
func file_protos_empty_proto_init() {
if File_protos_empty_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_protos_empty_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Empty); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_protos_empty_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_protos_empty_proto_goTypes,
DependencyIndexes: file_protos_empty_proto_depIdxs,
MessageInfos: file_protos_empty_proto_msgTypes,
}.Build()
File_protos_empty_proto = out.File
file_protos_empty_proto_rawDesc = nil
file_protos_empty_proto_goTypes = nil
file_protos_empty_proto_depIdxs = nil
}

194
shared/protos/monitor.pb.go Normal file
View File

@ -0,0 +1,194 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.10
// source: protos/monitor.proto
package protos
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Metrics struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
Cpu float32 `protobuf:"fixed32,3,opt,name=cpu,proto3" json:"cpu,omitempty"`
Total uint32 `protobuf:"varint,4,opt,name=total,proto3" json:"total,omitempty"`
Free uint32 `protobuf:"varint,5,opt,name=free,proto3" json:"free,omitempty"`
Metrics map[string]float32 `protobuf:"bytes,6,rep,name=metrics,proto3" json:"metrics,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"`
}
func (x *Metrics) Reset() {
*x = Metrics{}
if protoimpl.UnsafeEnabled {
mi := &file_protos_monitor_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Metrics) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Metrics) ProtoMessage() {}
func (x *Metrics) ProtoReflect() protoreflect.Message {
mi := &file_protos_monitor_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Metrics.ProtoReflect.Descriptor instead.
func (*Metrics) Descriptor() ([]byte, []int) {
return file_protos_monitor_proto_rawDescGZIP(), []int{0}
}
func (x *Metrics) GetHostname() string {
if x != nil {
return x.Hostname
}
return ""
}
func (x *Metrics) GetCpu() float32 {
if x != nil {
return x.Cpu
}
return 0
}
func (x *Metrics) GetTotal() uint32 {
if x != nil {
return x.Total
}
return 0
}
func (x *Metrics) GetFree() uint32 {
if x != nil {
return x.Free
}
return 0
}
func (x *Metrics) GetMetrics() map[string]float32 {
if x != nil {
return x.Metrics
}
return nil
}
var File_protos_monitor_proto protoreflect.FileDescriptor
var file_protos_monitor_proto_rawDesc = []byte{
0x0a, 0x14, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x6d, 0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x65,
0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xce, 0x01, 0x0a, 0x07, 0x4d,
0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61,
0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68, 0x6f, 0x73, 0x74, 0x6e, 0x61,
0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x70, 0x75, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52,
0x03, 0x63, 0x70, 0x75, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x04, 0x20,
0x01, 0x28, 0x0d, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72,
0x65, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x04, 0x66, 0x72, 0x65, 0x65, 0x12, 0x2f,
0x0a, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x15, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x1a,
0x3a, 0x0a, 0x0c, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x32, 0x27, 0x0a, 0x07, 0x4d,
0x6f, 0x6e, 0x69, 0x74, 0x6f, 0x72, 0x12, 0x1c, 0x0a, 0x06, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74,
0x12, 0x08, 0x2e, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x1a, 0x06, 0x2e, 0x45, 0x6d, 0x70,
0x74, 0x79, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_protos_monitor_proto_rawDescOnce sync.Once
file_protos_monitor_proto_rawDescData = file_protos_monitor_proto_rawDesc
)
func file_protos_monitor_proto_rawDescGZIP() []byte {
file_protos_monitor_proto_rawDescOnce.Do(func() {
file_protos_monitor_proto_rawDescData = protoimpl.X.CompressGZIP(file_protos_monitor_proto_rawDescData)
})
return file_protos_monitor_proto_rawDescData
}
var file_protos_monitor_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_protos_monitor_proto_goTypes = []interface{}{
(*Metrics)(nil), // 0: Metrics
nil, // 1: Metrics.MetricsEntry
(*Empty)(nil), // 2: Empty
}
var file_protos_monitor_proto_depIdxs = []int32{
1, // 0: Metrics.metrics:type_name -> Metrics.MetricsEntry
0, // 1: Monitor.Report:input_type -> Metrics
2, // 2: Monitor.Report:output_type -> Empty
2, // [2:3] is the sub-list for method output_type
1, // [1:2] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_protos_monitor_proto_init() }
func file_protos_monitor_proto_init() {
if File_protos_monitor_proto != nil {
return
}
file_protos_empty_proto_init()
if !protoimpl.UnsafeEnabled {
file_protos_monitor_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Metrics); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_protos_monitor_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_protos_monitor_proto_goTypes,
DependencyIndexes: file_protos_monitor_proto_depIdxs,
MessageInfos: file_protos_monitor_proto_msgTypes,
}.Build()
File_protos_monitor_proto = out.File
file_protos_monitor_proto_rawDesc = nil
file_protos_monitor_proto_goTypes = nil
file_protos_monitor_proto_depIdxs = nil
}

View File

@ -0,0 +1,105 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.10
// source: protos/monitor.proto
package protos
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// MonitorClient is the client API for Monitor 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.
type MonitorClient interface {
Report(ctx context.Context, in *Metrics, opts ...grpc.CallOption) (*Empty, error)
}
type monitorClient struct {
cc grpc.ClientConnInterface
}
func NewMonitorClient(cc grpc.ClientConnInterface) MonitorClient {
return &monitorClient{cc}
}
func (c *monitorClient) Report(ctx context.Context, in *Metrics, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/Monitor/Report", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MonitorServer is the server API for Monitor service.
// All implementations must embed UnimplementedMonitorServer
// for forward compatibility
type MonitorServer interface {
Report(context.Context, *Metrics) (*Empty, error)
mustEmbedUnimplementedMonitorServer()
}
// UnimplementedMonitorServer must be embedded to have forward compatible implementations.
type UnimplementedMonitorServer struct {
}
func (UnimplementedMonitorServer) Report(context.Context, *Metrics) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Report not implemented")
}
func (UnimplementedMonitorServer) mustEmbedUnimplementedMonitorServer() {}
// UnsafeMonitorServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MonitorServer will
// result in compilation errors.
type UnsafeMonitorServer interface {
mustEmbedUnimplementedMonitorServer()
}
func RegisterMonitorServer(s grpc.ServiceRegistrar, srv MonitorServer) {
s.RegisterService(&Monitor_ServiceDesc, srv)
}
func _Monitor_Report_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Metrics)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MonitorServer).Report(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Monitor/Report",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MonitorServer).Report(ctx, req.(*Metrics))
}
return interceptor(ctx, in, info, handler)
}
// Monitor_ServiceDesc is the grpc.ServiceDesc for Monitor service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Monitor_ServiceDesc = grpc.ServiceDesc{
ServiceName: "Monitor",
HandlerType: (*MonitorServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Report",
Handler: _Monitor_Report_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "protos/monitor.proto",
}

View File

@ -0,0 +1,589 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.1
// protoc v3.21.10
// source: protos/operation.proto
package protos
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ProcessState int32
const (
ProcessState_Stopped ProcessState = 0
ProcessState_Stopping ProcessState = 1
ProcessState_Running ProcessState = 2
ProcessState_Error ProcessState = 3
)
// Enum value maps for ProcessState.
var (
ProcessState_name = map[int32]string{
0: "Stopped",
1: "Stopping",
2: "Running",
3: "Error",
}
ProcessState_value = map[string]int32{
"Stopped": 0,
"Stopping": 1,
"Running": 2,
"Error": 3,
}
)
func (x ProcessState) Enum() *ProcessState {
p := new(ProcessState)
*p = x
return p
}
func (x ProcessState) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ProcessState) Descriptor() protoreflect.EnumDescriptor {
return file_protos_operation_proto_enumTypes[0].Descriptor()
}
func (ProcessState) Type() protoreflect.EnumType {
return &file_protos_operation_proto_enumTypes[0]
}
func (x ProcessState) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ProcessState.Descriptor instead.
func (ProcessState) EnumDescriptor() ([]byte, []int) {
return file_protos_operation_proto_rawDescGZIP(), []int{0}
}
type VersionAndArgs struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
}
func (x *VersionAndArgs) Reset() {
*x = VersionAndArgs{}
if protoimpl.UnsafeEnabled {
mi := &file_protos_operation_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *VersionAndArgs) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*VersionAndArgs) ProtoMessage() {}
func (x *VersionAndArgs) ProtoReflect() protoreflect.Message {
mi := &file_protos_operation_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use VersionAndArgs.ProtoReflect.Descriptor instead.
func (*VersionAndArgs) Descriptor() ([]byte, []int) {
return file_protos_operation_proto_rawDescGZIP(), []int{0}
}
func (x *VersionAndArgs) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
func (x *VersionAndArgs) GetArgs() []string {
if x != nil {
return x.Args
}
return nil
}
type DeployedVersions struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Versions []*VersionAndArgs `protobuf:"bytes,2,rep,name=versions,proto3" json:"versions,omitempty"`
}
func (x *DeployedVersions) Reset() {
*x = DeployedVersions{}
if protoimpl.UnsafeEnabled {
mi := &file_protos_operation_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DeployedVersions) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DeployedVersions) ProtoMessage() {}
func (x *DeployedVersions) ProtoReflect() protoreflect.Message {
mi := &file_protos_operation_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use DeployedVersions.ProtoReflect.Descriptor instead.
func (*DeployedVersions) Descriptor() ([]byte, []int) {
return file_protos_operation_proto_rawDescGZIP(), []int{1}
}
func (x *DeployedVersions) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *DeployedVersions) GetVersions() []*VersionAndArgs {
if x != nil {
return x.Versions
}
return nil
}
type OperationQueryRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Hostname string `protobuf:"bytes,1,opt,name=hostname,proto3" json:"hostname,omitempty"`
Procs []*ProcessDescription `protobuf:"bytes,2,rep,name=procs,proto3" json:"procs,omitempty"`
Deploys []*DeployedVersions `protobuf:"bytes,3,rep,name=deploys,proto3" json:"deploys,omitempty"`
}
func (x *OperationQueryRequest) Reset() {
*x = OperationQueryRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_protos_operation_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OperationQueryRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OperationQueryRequest) ProtoMessage() {}
func (x *OperationQueryRequest) ProtoReflect() protoreflect.Message {
mi := &file_protos_operation_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OperationQueryRequest.ProtoReflect.Descriptor instead.
func (*OperationQueryRequest) Descriptor() ([]byte, []int) {
return file_protos_operation_proto_rawDescGZIP(), []int{2}
}
func (x *OperationQueryRequest) GetHostname() string {
if x != nil {
return x.Hostname
}
return ""
}
func (x *OperationQueryRequest) GetProcs() []*ProcessDescription {
if x != nil {
return x.Procs
}
return nil
}
func (x *OperationQueryRequest) GetDeploys() []*DeployedVersions {
if x != nil {
return x.Deploys
}
return nil
}
type ProcessDescription struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Args []string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty"`
Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"`
State ProcessState `protobuf:"varint,4,opt,name=state,proto3,enum=ProcessState" json:"state,omitempty"`
Pid int32 `protobuf:"varint,5,opt,name=pid,proto3" json:"pid,omitempty"`
StdoutSize int32 `protobuf:"varint,6,opt,name=stdout_size,json=stdoutSize,proto3" json:"stdout_size,omitempty"`
StderrSize int32 `protobuf:"varint,7,opt,name=stderr_size,json=stderrSize,proto3" json:"stderr_size,omitempty"`
}
func (x *ProcessDescription) Reset() {
*x = ProcessDescription{}
if protoimpl.UnsafeEnabled {
mi := &file_protos_operation_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProcessDescription) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProcessDescription) ProtoMessage() {}
func (x *ProcessDescription) ProtoReflect() protoreflect.Message {
mi := &file_protos_operation_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProcessDescription.ProtoReflect.Descriptor instead.
func (*ProcessDescription) Descriptor() ([]byte, []int) {
return file_protos_operation_proto_rawDescGZIP(), []int{3}
}
func (x *ProcessDescription) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ProcessDescription) GetArgs() []string {
if x != nil {
return x.Args
}
return nil
}
func (x *ProcessDescription) GetVersion() string {
if x != nil {
return x.Version
}
return ""
}
func (x *ProcessDescription) GetState() ProcessState {
if x != nil {
return x.State
}
return ProcessState_Stopped
}
func (x *ProcessDescription) GetPid() int32 {
if x != nil {
return x.Pid
}
return 0
}
func (x *ProcessDescription) GetStdoutSize() int32 {
if x != nil {
return x.StdoutSize
}
return 0
}
func (x *ProcessDescription) GetStderrSize() int32 {
if x != nil {
return x.StderrSize
}
return 0
}
type OperationQueryResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Operation string `protobuf:"bytes,1,opt,name=operation,proto3" json:"operation,omitempty"`
Args map[string]string `protobuf:"bytes,2,rep,name=args,proto3" json:"args,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
}
func (x *OperationQueryResponse) Reset() {
*x = OperationQueryResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_protos_operation_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OperationQueryResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OperationQueryResponse) ProtoMessage() {}
func (x *OperationQueryResponse) ProtoReflect() protoreflect.Message {
mi := &file_protos_operation_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OperationQueryResponse.ProtoReflect.Descriptor instead.
func (*OperationQueryResponse) Descriptor() ([]byte, []int) {
return file_protos_operation_proto_rawDescGZIP(), []int{4}
}
func (x *OperationQueryResponse) GetOperation() string {
if x != nil {
return x.Operation
}
return ""
}
func (x *OperationQueryResponse) GetArgs() map[string]string {
if x != nil {
return x.Args
}
return nil
}
var File_protos_operation_proto protoreflect.FileDescriptor
var file_protos_operation_proto_rawDesc = []byte{
0x0a, 0x16, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2f, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73,
0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x0e,
0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x41, 0x6e, 0x64, 0x41, 0x72, 0x67, 0x73, 0x12, 0x18,
0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72, 0x67, 0x73,
0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x22, 0x53, 0x0a, 0x10,
0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x64, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2b, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73,
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x41, 0x6e, 0x64, 0x41, 0x72, 0x67, 0x73, 0x52, 0x08, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x73, 0x22, 0x8b, 0x01, 0x0a, 0x15, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51,
0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x68,
0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x68,
0x6f, 0x73, 0x74, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x05, 0x70, 0x72, 0x6f, 0x63, 0x73,
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73,
0x44, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x05, 0x70, 0x72, 0x6f,
0x63, 0x73, 0x12, 0x2b, 0x0a, 0x07, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x73, 0x18, 0x03, 0x20,
0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x44, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x64, 0x56, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x07, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x73, 0x22,
0xcf, 0x01, 0x0a, 0x12, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x44, 0x65, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x61, 0x72,
0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x61, 0x72, 0x67, 0x73, 0x12, 0x18,
0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0d, 0x2e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73,
0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x10, 0x0a,
0x03, 0x70, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x70, 0x69, 0x64, 0x12,
0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06,
0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x64, 0x6f, 0x75, 0x74, 0x53, 0x69, 0x7a, 0x65,
0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18,
0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x73, 0x74, 0x64, 0x65, 0x72, 0x72, 0x53, 0x69, 0x7a,
0x65, 0x22, 0xa6, 0x01, 0x0a, 0x16, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51,
0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09,
0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x09, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, 0x0a, 0x04, 0x61, 0x72,
0x67, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x2e, 0x41, 0x72, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x04, 0x61, 0x72, 0x67,
0x73, 0x1a, 0x37, 0x0a, 0x09, 0x41, 0x72, 0x67, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x2a, 0x41, 0x0a, 0x0c, 0x50, 0x72,
0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x0b, 0x0a, 0x07, 0x53, 0x74,
0x6f, 0x70, 0x70, 0x65, 0x64, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x74, 0x6f, 0x70, 0x70,
0x69, 0x6e, 0x67, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x52, 0x75, 0x6e, 0x6e, 0x69, 0x6e, 0x67,
0x10, 0x02, 0x12, 0x09, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x03, 0x32, 0x78, 0x0a,
0x09, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x05, 0x51, 0x75,
0x65, 0x72, 0x79, 0x12, 0x16, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51,
0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x4f, 0x70,
0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x28, 0x01, 0x30, 0x01, 0x12, 0x2b, 0x0a, 0x07, 0x52, 0x65,
0x66, 0x72, 0x65, 0x73, 0x68, 0x12, 0x16, 0x2e, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x06, 0x2e,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x42, 0x0f, 0x5a, 0x0d, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_protos_operation_proto_rawDescOnce sync.Once
file_protos_operation_proto_rawDescData = file_protos_operation_proto_rawDesc
)
func file_protos_operation_proto_rawDescGZIP() []byte {
file_protos_operation_proto_rawDescOnce.Do(func() {
file_protos_operation_proto_rawDescData = protoimpl.X.CompressGZIP(file_protos_operation_proto_rawDescData)
})
return file_protos_operation_proto_rawDescData
}
var file_protos_operation_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_protos_operation_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_protos_operation_proto_goTypes = []interface{}{
(ProcessState)(0), // 0: ProcessState
(*VersionAndArgs)(nil), // 1: VersionAndArgs
(*DeployedVersions)(nil), // 2: DeployedVersions
(*OperationQueryRequest)(nil), // 3: OperationQueryRequest
(*ProcessDescription)(nil), // 4: ProcessDescription
(*OperationQueryResponse)(nil), // 5: OperationQueryResponse
nil, // 6: OperationQueryResponse.ArgsEntry
(*Empty)(nil), // 7: Empty
}
var file_protos_operation_proto_depIdxs = []int32{
1, // 0: DeployedVersions.versions:type_name -> VersionAndArgs
4, // 1: OperationQueryRequest.procs:type_name -> ProcessDescription
2, // 2: OperationQueryRequest.deploys:type_name -> DeployedVersions
0, // 3: ProcessDescription.state:type_name -> ProcessState
6, // 4: OperationQueryResponse.args:type_name -> OperationQueryResponse.ArgsEntry
3, // 5: Operation.Query:input_type -> OperationQueryRequest
3, // 6: Operation.Refresh:input_type -> OperationQueryRequest
5, // 7: Operation.Query:output_type -> OperationQueryResponse
7, // 8: Operation.Refresh:output_type -> Empty
7, // [7:9] is the sub-list for method output_type
5, // [5:7] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_protos_operation_proto_init() }
func file_protos_operation_proto_init() {
if File_protos_operation_proto != nil {
return
}
file_protos_empty_proto_init()
if !protoimpl.UnsafeEnabled {
file_protos_operation_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*VersionAndArgs); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protos_operation_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DeployedVersions); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protos_operation_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OperationQueryRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protos_operation_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProcessDescription); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_protos_operation_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OperationQueryResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_protos_operation_proto_rawDesc,
NumEnums: 1,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_protos_operation_proto_goTypes,
DependencyIndexes: file_protos_operation_proto_depIdxs,
EnumInfos: file_protos_operation_proto_enumTypes,
MessageInfos: file_protos_operation_proto_msgTypes,
}.Build()
File_protos_operation_proto = out.File
file_protos_operation_proto_rawDesc = nil
file_protos_operation_proto_goTypes = nil
file_protos_operation_proto_depIdxs = nil
}

View File

@ -0,0 +1,174 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.21.10
// source: protos/operation.proto
package protos
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
// OperationClient is the client API for Operation 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.
type OperationClient interface {
Query(ctx context.Context, opts ...grpc.CallOption) (Operation_QueryClient, error)
Refresh(ctx context.Context, in *OperationQueryRequest, opts ...grpc.CallOption) (*Empty, error)
}
type operationClient struct {
cc grpc.ClientConnInterface
}
func NewOperationClient(cc grpc.ClientConnInterface) OperationClient {
return &operationClient{cc}
}
func (c *operationClient) Query(ctx context.Context, opts ...grpc.CallOption) (Operation_QueryClient, error) {
stream, err := c.cc.NewStream(ctx, &Operation_ServiceDesc.Streams[0], "/Operation/Query", opts...)
if err != nil {
return nil, err
}
x := &operationQueryClient{stream}
return x, nil
}
type Operation_QueryClient interface {
Send(*OperationQueryRequest) error
Recv() (*OperationQueryResponse, error)
grpc.ClientStream
}
type operationQueryClient struct {
grpc.ClientStream
}
func (x *operationQueryClient) Send(m *OperationQueryRequest) error {
return x.ClientStream.SendMsg(m)
}
func (x *operationQueryClient) Recv() (*OperationQueryResponse, error) {
m := new(OperationQueryResponse)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func (c *operationClient) Refresh(ctx context.Context, in *OperationQueryRequest, opts ...grpc.CallOption) (*Empty, error) {
out := new(Empty)
err := c.cc.Invoke(ctx, "/Operation/Refresh", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// OperationServer is the server API for Operation service.
// All implementations must embed UnimplementedOperationServer
// for forward compatibility
type OperationServer interface {
Query(Operation_QueryServer) error
Refresh(context.Context, *OperationQueryRequest) (*Empty, error)
mustEmbedUnimplementedOperationServer()
}
// UnimplementedOperationServer must be embedded to have forward compatible implementations.
type UnimplementedOperationServer struct {
}
func (UnimplementedOperationServer) Query(Operation_QueryServer) error {
return status.Errorf(codes.Unimplemented, "method Query not implemented")
}
func (UnimplementedOperationServer) Refresh(context.Context, *OperationQueryRequest) (*Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method Refresh not implemented")
}
func (UnimplementedOperationServer) mustEmbedUnimplementedOperationServer() {}
// UnsafeOperationServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to OperationServer will
// result in compilation errors.
type UnsafeOperationServer interface {
mustEmbedUnimplementedOperationServer()
}
func RegisterOperationServer(s grpc.ServiceRegistrar, srv OperationServer) {
s.RegisterService(&Operation_ServiceDesc, srv)
}
func _Operation_Query_Handler(srv interface{}, stream grpc.ServerStream) error {
return srv.(OperationServer).Query(&operationQueryServer{stream})
}
type Operation_QueryServer interface {
Send(*OperationQueryResponse) error
Recv() (*OperationQueryRequest, error)
grpc.ServerStream
}
type operationQueryServer struct {
grpc.ServerStream
}
func (x *operationQueryServer) Send(m *OperationQueryResponse) error {
return x.ServerStream.SendMsg(m)
}
func (x *operationQueryServer) Recv() (*OperationQueryRequest, error) {
m := new(OperationQueryRequest)
if err := x.ServerStream.RecvMsg(m); err != nil {
return nil, err
}
return m, nil
}
func _Operation_Refresh_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(OperationQueryRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OperationServer).Refresh(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Operation/Refresh",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OperationServer).Refresh(ctx, req.(*OperationQueryRequest))
}
return interceptor(ctx, in, info, handler)
}
// Operation_ServiceDesc is the grpc.ServiceDesc for Operation service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Operation_ServiceDesc = grpc.ServiceDesc{
ServiceName: "Operation",
HandlerType: (*OperationServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Refresh",
Handler: _Operation_Refresh_Handler,
},
},
Streams: []grpc.StreamDesc{
{
StreamName: "Query",
Handler: _Operation_Query_Handler,
ServerStreams: true,
ClientStreams: true,
},
},
Metadata: "protos/operation.proto",
}