Documentation ¶
Index ¶
- Constants
- Variables
- func AllGoods() *sync.Map
- func CreateUnzipPath(dir string) error
- func NewSysProcAttr() *syscall.SysProcAttr
- func NewWSStdInOut(ps *GoodsProcess) goodsStdInOut
- func RegisterTrailerServer(s grpc.ServiceRegistrar, srv TrailerServer)
- func Remove(uuid string)
- func RemoveBy(uuid, by string)
- func RemoveUnzipPath(dir string) error
- func StartProcess(goods GoodsInfo) error
- func Stop()
- func StopProcess(goods GoodsInfo) error
- func Unzip(zipPath string, targetDir string) error
- func ValidatePackage(mf AppManifest) error
- func Zip(files []string, targetPath string) error
- type AppManifest
- type Column
- func (*Column) Descriptor() ([]byte, []int)deprecated
- func (x *Column) GetDescription() string
- func (x *Column) GetName() string
- func (x *Column) GetType() ValueType
- func (*Column) ProtoMessage()
- func (x *Column) ProtoReflect() protoreflect.Message
- func (x *Column) Reset()
- func (x *Column) String() string
- type ColumnValue
- func (*ColumnValue) Descriptor() ([]byte, []int)deprecated
- func (x *ColumnValue) GetId() string
- func (x *ColumnValue) GetName() string
- func (x *ColumnValue) GetType() ValueType
- func (x *ColumnValue) GetValue() []byte
- func (*ColumnValue) ProtoMessage()
- func (x *ColumnValue) ProtoReflect() protoreflect.Message
- func (x *ColumnValue) Reset()
- func (x *ColumnValue) String() string
- type Config
- type DataRow
- type DataRowsRequest
- type DataRowsResponse
- type GoodsInfo
- type GoodsProcess
- type ProcessInfo
- type Request
- type Response
- type SchemaRequest
- type SchemaResponse
- func (*SchemaResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SchemaResponse) GetCode() int32
- func (x *SchemaResponse) GetColumns() []*Column
- func (x *SchemaResponse) GetMessage() string
- func (*SchemaResponse) ProtoMessage()
- func (x *SchemaResponse) ProtoReflect() protoreflect.Message
- func (x *SchemaResponse) Reset()
- func (x *SchemaResponse) String() string
- type ServiceRequest
- func (*ServiceRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ServiceRequest) GetArgs() []byte
- func (x *ServiceRequest) GetCmd() []byte
- func (*ServiceRequest) ProtoMessage()
- func (x *ServiceRequest) ProtoReflect() protoreflect.Message
- func (x *ServiceRequest) Reset()
- func (x *ServiceRequest) String() string
- type ServiceResponse
- func (*ServiceResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ServiceResponse) GetCode() int32
- func (x *ServiceResponse) GetData() []byte
- func (*ServiceResponse) ProtoMessage()
- func (x *ServiceResponse) ProtoReflect() protoreflect.Message
- func (x *ServiceResponse) Reset()
- func (x *ServiceResponse) String() string
- type StatusResponse
- func (*StatusResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StatusResponse) GetMessage() string
- func (x *StatusResponse) GetStatus() StatusResponse_Status
- func (*StatusResponse) ProtoMessage()
- func (x *StatusResponse) ProtoReflect() protoreflect.Message
- func (x *StatusResponse) Reset()
- func (x *StatusResponse) String() string
- type StatusResponse_Status
- func (StatusResponse_Status) Descriptor() protoreflect.EnumDescriptor
- func (x StatusResponse_Status) Enum() *StatusResponse_Status
- func (StatusResponse_Status) EnumDescriptor() ([]byte, []int)deprecated
- func (x StatusResponse_Status) Number() protoreflect.EnumNumber
- func (x StatusResponse_Status) String() string
- func (StatusResponse_Status) Type() protoreflect.EnumType
- type StreamRequest
- type StreamResponse
- func (*StreamResponse) Descriptor() ([]byte, []int)deprecated
- func (x *StreamResponse) GetCode() int32
- func (x *StreamResponse) GetData() []byte
- func (*StreamResponse) ProtoMessage()
- func (x *StreamResponse) ProtoReflect() protoreflect.Message
- func (x *StreamResponse) Reset()
- func (x *StreamResponse) String() string
- type TrailerClient
- type TrailerRuntime
- type TrailerServer
- type Trailer_OnStreamClient
- type Trailer_OnStreamServer
- type UnimplementedTrailerServer
- func (UnimplementedTrailerServer) Init(context.Context, *Config) (*Response, error)
- func (UnimplementedTrailerServer) OnStream(Trailer_OnStreamServer) error
- func (UnimplementedTrailerServer) Query(context.Context, *DataRowsRequest) (*DataRowsResponse, error)
- func (UnimplementedTrailerServer) Schema(context.Context, *SchemaRequest) (*SchemaResponse, error)
- func (UnimplementedTrailerServer) Service(context.Context, *ServiceRequest) (*ServiceResponse, error)
- func (UnimplementedTrailerServer) Start(context.Context, *Request) (*Response, error)
- func (UnimplementedTrailerServer) Status(context.Context, *Request) (*StatusResponse, error)
- func (UnimplementedTrailerServer) Stop(context.Context, *Request) (*Response, error)
- type UnsafeTrailerServer
- type ValueType
Constants ¶
const ( Trailer_Init_FullMethodName = "/trailer.Trailer/Init" Trailer_Start_FullMethodName = "/trailer.Trailer/Start" Trailer_Status_FullMethodName = "/trailer.Trailer/Status" Trailer_Service_FullMethodName = "/trailer.Trailer/Service" Trailer_OnStream_FullMethodName = "/trailer.Trailer/OnStream" Trailer_Query_FullMethodName = "/trailer.Trailer/Query" Trailer_Schema_FullMethodName = "/trailer.Trailer/Schema" Trailer_Stop_FullMethodName = "/trailer.Trailer/Stop" )
Variables ¶
var ( ValueType_name = map[int32]string{ 0: "STRING", 1: "NUMBER", 2: "BOOL", } ValueType_value = map[string]int32{ "STRING": 0, "NUMBER": 1, "BOOL": 2, } )
Enum value maps for ValueType.
var ( StatusResponse_Status_name = map[int32]string{ 0: "RUNNING", 1: "ERROR", 2: "STOPED", } StatusResponse_Status_value = map[string]int32{ "RUNNING": 0, "ERROR": 1, "STOPED": 2, } )
Enum value maps for StatusResponse_Status.
var ExecuteType = map[string]string{
".jar": "JAVA",
".exe": "EXE",
".py": "PYTHON",
".js": "NODEJS",
".lua": "LUA",
}
* * 针对脚本语言 *
var File_trailer_proto protoreflect.FileDescriptor
var Trailer_ServiceDesc = grpc.ServiceDesc{ ServiceName: "trailer.Trailer", HandlerType: (*TrailerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Init", Handler: _Trailer_Init_Handler, }, { MethodName: "Start", Handler: _Trailer_Start_Handler, }, { MethodName: "Status", Handler: _Trailer_Status_Handler, }, { MethodName: "Service", Handler: _Trailer_Service_Handler, }, { MethodName: "Query", Handler: _Trailer_Query_Handler, }, { MethodName: "Schema", Handler: _Trailer_Schema_Handler, }, { MethodName: "Stop", Handler: _Trailer_Stop_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "OnStream", Handler: _Trailer_OnStream_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "trailer.proto", }
Trailer_ServiceDesc is the grpc.ServiceDesc for Trailer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func CreateUnzipPath ¶
*
- 解压文件的路径: unzip -d ./upload/TrailerGoods/GOODSQUNK3Z/ app.zip 路径下应该包含了所有解压的文件 ll ./upload/TrailerGoods/GOODSQUNK3Z
- manifest.json
- app.exe
*
func NewSysProcAttr ¶
func NewSysProcAttr() *syscall.SysProcAttr
func NewWSStdInOut ¶
func NewWSStdInOut(ps *GoodsProcess) goodsStdInOut
func RegisterTrailerServer ¶
func RegisterTrailerServer(s grpc.ServiceRegistrar, srv TrailerServer)
func RemoveUnzipPath ¶
* * 删除解压文件夹 rm -r ./upload/TrailerGoods/GOODSQUNK3Z *
func ValidatePackage ¶
func ValidatePackage(mf AppManifest) error
Types ¶
type AppManifest ¶
type AppManifest struct { Native bool `json:"native"` ScriptHost string `json:"scripthost"` Executable string `json:"executable"` Env []string `json:"env"` }
* * 包内部配置 *
func ReadManifestFromZip ¶
func ReadManifestFromZip(zipPath string, targetFile string) (AppManifest, error)
type Column ¶
type Column struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Type ValueType `protobuf:"varint,2,opt,name=type,proto3,enum=trailer.ValueType" json:"type,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // contains filtered or unexported fields }
列定义
func (*Column) Descriptor
deprecated
func (*Column) GetDescription ¶
func (*Column) ProtoMessage ¶
func (*Column) ProtoMessage()
func (*Column) ProtoReflect ¶
func (x *Column) ProtoReflect() protoreflect.Message
type ColumnValue ¶
type ColumnValue struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Type ValueType `protobuf:"varint,2,opt,name=type,proto3,enum=trailer.ValueType" json:"type,omitempty"` Id string `protobuf:"bytes,3,opt,name=id,proto3" json:"id,omitempty"` Value []byte `protobuf:"bytes,4,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
查出来的数据列
func (*ColumnValue) Descriptor
deprecated
func (*ColumnValue) Descriptor() ([]byte, []int)
Deprecated: Use ColumnValue.ProtoReflect.Descriptor instead.
func (*ColumnValue) GetId ¶
func (x *ColumnValue) GetId() string
func (*ColumnValue) GetName ¶
func (x *ColumnValue) GetName() string
func (*ColumnValue) GetType ¶
func (x *ColumnValue) GetType() ValueType
func (*ColumnValue) GetValue ¶
func (x *ColumnValue) GetValue() []byte
func (*ColumnValue) ProtoMessage ¶
func (*ColumnValue) ProtoMessage()
func (*ColumnValue) ProtoReflect ¶
func (x *ColumnValue) ProtoReflect() protoreflect.Message
func (*ColumnValue) Reset ¶
func (x *ColumnValue) Reset()
func (*ColumnValue) String ¶
func (x *ColumnValue) String() string
type Config ¶
type Config struct { Kv []byte `protobuf:"bytes,1,opt,name=kv,proto3" json:"kv,omitempty"` // contains filtered or unexported fields }
通用配置
func (*Config) Descriptor
deprecated
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
func (*Config) ProtoReflect ¶
func (x *Config) ProtoReflect() protoreflect.Message
type DataRow ¶
type DataRow struct { Column []*ColumnValue `protobuf:"bytes,1,rep,name=column,proto3" json:"column,omitempty"` // 一行多列 // contains filtered or unexported fields }
行定义
func (*DataRow) Descriptor
deprecated
func (*DataRow) GetColumn ¶
func (x *DataRow) GetColumn() []*ColumnValue
func (*DataRow) ProtoMessage ¶
func (*DataRow) ProtoMessage()
func (*DataRow) ProtoReflect ¶
func (x *DataRow) ProtoReflect() protoreflect.Message
type DataRowsRequest ¶
type DataRowsRequest struct { Query []byte `protobuf:"bytes,1,opt,name=query,proto3" json:"query,omitempty"` // SQL or other query // contains filtered or unexported fields }
请求查询
func (*DataRowsRequest) Descriptor
deprecated
func (*DataRowsRequest) Descriptor() ([]byte, []int)
Deprecated: Use DataRowsRequest.ProtoReflect.Descriptor instead.
func (*DataRowsRequest) GetQuery ¶
func (x *DataRowsRequest) GetQuery() []byte
func (*DataRowsRequest) ProtoMessage ¶
func (*DataRowsRequest) ProtoMessage()
func (*DataRowsRequest) ProtoReflect ¶
func (x *DataRowsRequest) ProtoReflect() protoreflect.Message
func (*DataRowsRequest) Reset ¶
func (x *DataRowsRequest) Reset()
func (*DataRowsRequest) String ¶
func (x *DataRowsRequest) String() string
type DataRowsResponse ¶
type DataRowsResponse struct { Row []*DataRow `protobuf:"bytes,1,rep,name=row,proto3" json:"row,omitempty"` // 多行 // contains filtered or unexported fields }
查询结果
func (*DataRowsResponse) Descriptor
deprecated
func (*DataRowsResponse) Descriptor() ([]byte, []int)
Deprecated: Use DataRowsResponse.ProtoReflect.Descriptor instead.
func (*DataRowsResponse) GetRow ¶
func (x *DataRowsResponse) GetRow() []*DataRow
func (*DataRowsResponse) ProtoMessage ¶
func (*DataRowsResponse) ProtoMessage()
func (*DataRowsResponse) ProtoReflect ¶
func (x *DataRowsResponse) ProtoReflect() protoreflect.Message
func (*DataRowsResponse) Reset ¶
func (x *DataRowsResponse) Reset()
func (*DataRowsResponse) String ¶
func (x *DataRowsResponse) String() string
type GoodsInfo ¶
type GoodsInfo struct { UUID string `json:"uuid"` Name string `json:"name"` // 进程名 GoodsType string `json:"goods_type"` // LOCAL(RULEX原始设备), EXTERNAL(外部RPC设备) ExecuteType string `json:"execute_type"` // exe,elf,jar,py, nodejs.... AutoStart *bool `json:"auto_start"` // 是否开启自启动,目前全部是自启动 LocalPath string `json:"local_path"` // TCP or Unix Socket NetAddr string `json:"net_addr"` // RPC addr Description string `json:"description"` // Description text // Additional Args Args string `json:"args"` // 使用空格分割 , such: la -al KilledBy string // 进程被谁干死的, 一般用来处理要不要抢救进程 }
* * 子进程的配置, 将 SocketAddr 传入 GRPC 客户端, Args 传入外挂的启动参数 * $> /test_driver Args
type GoodsProcess ¶
type GoodsProcess struct { Info GoodsInfo // contains filtered or unexported fields }
func NewGoodsProcess ¶
func NewGoodsProcess() *GoodsProcess
func (*GoodsProcess) ConnectToRpc ¶
func (goodsProcess *GoodsProcess) ConnectToRpc() (TrailerClient, error)
* * 尝试新建一个RPC客户端 *
func (*GoodsProcess) Pid ¶
func (goodsProcess *GoodsProcess) Pid() int
func (*GoodsProcess) PsRunning ¶
func (goodsProcess *GoodsProcess) PsRunning() bool
func (*GoodsProcess) Stop ¶
func (goodsPs *GoodsProcess) Stop()
func (*GoodsProcess) StopBy ¶
func (goodsPs *GoodsProcess) StopBy(r string)
func (GoodsProcess) String ¶
func (g GoodsProcess) String() string
type ProcessInfo ¶
type ProcessInfo struct { CPU string `json:"cpu"` Memory string `json:"memory"` VSZ string `json:"vsz"` RSS string `json:"rss"` TTY string `json:"tty"` Stat string `json:"stat"` Start string `json:"start"` Time string `json:"time"` Command string `json:"command"` }
func RunningProcessDetail ¶
func RunningProcessDetail(pid int) (ProcessInfo, error)
`ps` 命令的输出中各列的含义如下: 1. `%CPU`:进程的 CPU 使用率百分比。它表示进程占用 CPU 时间的百分比。 2. `%MEM`:进程的内存使用率百分比。它表示进程占用系统内存的百分比。 3. `VSZ`:进程的虚拟内存大小(以KB为单位)。它包括了进程占用的实际内存和虚拟内存,虚拟内存是物理内存和交换空间的组合。 4. `RSS`:进程的常驻内存大小(以KB为单位)。它表示实际分配给进程的物理内存。 5. `TT`:进程的终端类型,指示与进程关联的终端。 6. `STAT`:进程的状态,表示进程当前的状态。常见的状态包括 R(运行)、S(睡眠)、Z(僵尸)、T(暂停)等。 7. `STARTED`:进程的启动时间,表示进程启动的日期和时间。 8. `TIME`:进程的累积 CPU 时间,表示进程自启动以来已经占用的 CPU 时间。 9. `COMMAND`:进程的命令行,显示了启动进程的命令和参数。 这些列提供了有关正在运行的进程的重要信息,包括它们的 CPU 和内存使用情况、状态以及启动时间等。在分析和监视进程时,这些信息非常有用。
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) Descriptor
deprecated
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Response ¶
type Response struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetMessage ¶
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type SchemaRequest ¶
type SchemaRequest struct {
// contains filtered or unexported fields
}
请求拿表结构
func (*SchemaRequest) Descriptor
deprecated
func (*SchemaRequest) Descriptor() ([]byte, []int)
Deprecated: Use SchemaRequest.ProtoReflect.Descriptor instead.
func (*SchemaRequest) ProtoMessage ¶
func (*SchemaRequest) ProtoMessage()
func (*SchemaRequest) ProtoReflect ¶
func (x *SchemaRequest) ProtoReflect() protoreflect.Message
func (*SchemaRequest) Reset ¶
func (x *SchemaRequest) Reset()
func (*SchemaRequest) String ¶
func (x *SchemaRequest) String() string
type SchemaResponse ¶
type SchemaResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Columns []*Column `protobuf:"bytes,3,rep,name=columns,proto3" json:"columns,omitempty"` // contains filtered or unexported fields }
表结构返回
func (*SchemaResponse) Descriptor
deprecated
func (*SchemaResponse) Descriptor() ([]byte, []int)
Deprecated: Use SchemaResponse.ProtoReflect.Descriptor instead.
func (*SchemaResponse) GetCode ¶
func (x *SchemaResponse) GetCode() int32
func (*SchemaResponse) GetColumns ¶
func (x *SchemaResponse) GetColumns() []*Column
func (*SchemaResponse) GetMessage ¶
func (x *SchemaResponse) GetMessage() string
func (*SchemaResponse) ProtoMessage ¶
func (*SchemaResponse) ProtoMessage()
func (*SchemaResponse) ProtoReflect ¶
func (x *SchemaResponse) ProtoReflect() protoreflect.Message
func (*SchemaResponse) Reset ¶
func (x *SchemaResponse) Reset()
func (*SchemaResponse) String ¶
func (x *SchemaResponse) String() string
type ServiceRequest ¶
type ServiceRequest struct { Cmd []byte `protobuf:"bytes,1,opt,name=cmd,proto3" json:"cmd,omitempty"` Args []byte `protobuf:"bytes,2,opt,name=args,proto3" json:"args,omitempty"` // contains filtered or unexported fields }
func (*ServiceRequest) Descriptor
deprecated
func (*ServiceRequest) Descriptor() ([]byte, []int)
Deprecated: Use ServiceRequest.ProtoReflect.Descriptor instead.
func (*ServiceRequest) GetArgs ¶
func (x *ServiceRequest) GetArgs() []byte
func (*ServiceRequest) GetCmd ¶
func (x *ServiceRequest) GetCmd() []byte
func (*ServiceRequest) ProtoMessage ¶
func (*ServiceRequest) ProtoMessage()
func (*ServiceRequest) ProtoReflect ¶
func (x *ServiceRequest) ProtoReflect() protoreflect.Message
func (*ServiceRequest) Reset ¶
func (x *ServiceRequest) Reset()
func (*ServiceRequest) String ¶
func (x *ServiceRequest) String() string
type ServiceResponse ¶
type ServiceResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*ServiceResponse) Descriptor
deprecated
func (*ServiceResponse) Descriptor() ([]byte, []int)
Deprecated: Use ServiceResponse.ProtoReflect.Descriptor instead.
func (*ServiceResponse) GetCode ¶
func (x *ServiceResponse) GetCode() int32
func (*ServiceResponse) GetData ¶
func (x *ServiceResponse) GetData() []byte
func (*ServiceResponse) ProtoMessage ¶
func (*ServiceResponse) ProtoMessage()
func (*ServiceResponse) ProtoReflect ¶
func (x *ServiceResponse) ProtoReflect() protoreflect.Message
func (*ServiceResponse) Reset ¶
func (x *ServiceResponse) Reset()
func (*ServiceResponse) String ¶
func (x *ServiceResponse) String() string
type StatusResponse ¶
type StatusResponse struct { Status StatusResponse_Status `protobuf:"varint,1,opt,name=status,proto3,enum=trailer.StatusResponse_Status" json:"status,omitempty"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func (*StatusResponse) Descriptor
deprecated
func (*StatusResponse) Descriptor() ([]byte, []int)
Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead.
func (*StatusResponse) GetMessage ¶
func (x *StatusResponse) GetMessage() string
func (*StatusResponse) GetStatus ¶
func (x *StatusResponse) GetStatus() StatusResponse_Status
func (*StatusResponse) ProtoMessage ¶
func (*StatusResponse) ProtoMessage()
func (*StatusResponse) ProtoReflect ¶
func (x *StatusResponse) ProtoReflect() protoreflect.Message
func (*StatusResponse) Reset ¶
func (x *StatusResponse) Reset()
func (*StatusResponse) String ¶
func (x *StatusResponse) String() string
type StatusResponse_Status ¶
type StatusResponse_Status int32
const ( StatusResponse_RUNNING StatusResponse_Status = 0 StatusResponse_ERROR StatusResponse_Status = 1 StatusResponse_STOPED StatusResponse_Status = 2 )
func (StatusResponse_Status) Descriptor ¶
func (StatusResponse_Status) Descriptor() protoreflect.EnumDescriptor
func (StatusResponse_Status) Enum ¶
func (x StatusResponse_Status) Enum() *StatusResponse_Status
func (StatusResponse_Status) EnumDescriptor
deprecated
func (StatusResponse_Status) EnumDescriptor() ([]byte, []int)
Deprecated: Use StatusResponse_Status.Descriptor instead.
func (StatusResponse_Status) Number ¶
func (x StatusResponse_Status) Number() protoreflect.EnumNumber
func (StatusResponse_Status) String ¶
func (x StatusResponse_Status) String() string
func (StatusResponse_Status) Type ¶
func (StatusResponse_Status) Type() protoreflect.EnumType
type StreamRequest ¶
type StreamRequest struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*StreamRequest) Descriptor
deprecated
func (*StreamRequest) Descriptor() ([]byte, []int)
Deprecated: Use StreamRequest.ProtoReflect.Descriptor instead.
func (*StreamRequest) GetData ¶
func (x *StreamRequest) GetData() []byte
func (*StreamRequest) ProtoMessage ¶
func (*StreamRequest) ProtoMessage()
func (*StreamRequest) ProtoReflect ¶
func (x *StreamRequest) ProtoReflect() protoreflect.Message
func (*StreamRequest) Reset ¶
func (x *StreamRequest) Reset()
func (*StreamRequest) String ¶
func (x *StreamRequest) String() string
type StreamResponse ¶
type StreamResponse struct { Code int32 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"` Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` // contains filtered or unexported fields }
func (*StreamResponse) Descriptor
deprecated
func (*StreamResponse) Descriptor() ([]byte, []int)
Deprecated: Use StreamResponse.ProtoReflect.Descriptor instead.
func (*StreamResponse) GetCode ¶
func (x *StreamResponse) GetCode() int32
func (*StreamResponse) GetData ¶
func (x *StreamResponse) GetData() []byte
func (*StreamResponse) ProtoMessage ¶
func (*StreamResponse) ProtoMessage()
func (*StreamResponse) ProtoReflect ¶
func (x *StreamResponse) ProtoReflect() protoreflect.Message
func (*StreamResponse) Reset ¶
func (x *StreamResponse) Reset()
func (*StreamResponse) String ¶
func (x *StreamResponse) String() string
type TrailerClient ¶
type TrailerClient interface { // 初始化, 主要是为了传配置进去 Init(ctx context.Context, in *Config, opts ...grpc.CallOption) (*Response, error) // 启动 Start(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) // 获取状态 Status(ctx context.Context, in *Request, opts ...grpc.CallOption) (*StatusResponse, error) // 服务调用 Service(ctx context.Context, in *ServiceRequest, opts ...grpc.CallOption) (*ServiceResponse, error) // 流数据 OnStream(ctx context.Context, opts ...grpc.CallOption) (Trailer_OnStreamClient, error) // 数据查询 Query(ctx context.Context, in *DataRowsRequest, opts ...grpc.CallOption) (*DataRowsResponse, error) // 数据模型 Schema(ctx context.Context, in *SchemaRequest, opts ...grpc.CallOption) (*SchemaResponse, error) // 停止 Stop(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error) }
TrailerClient is the client API for Trailer 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 NewTrailerClient ¶
func NewTrailerClient(cc grpc.ClientConnInterface) TrailerClient
type TrailerRuntime ¶
type TrailerRuntime struct {
// contains filtered or unexported fields
}
func InitTrailerRuntime ¶
func InitTrailerRuntime(re typex.RuleX) *TrailerRuntime
* * RULEX RPC Server 默认运行在 2588 *
type TrailerServer ¶
type TrailerServer interface { // 初始化, 主要是为了传配置进去 Init(context.Context, *Config) (*Response, error) // 启动 Start(context.Context, *Request) (*Response, error) // 获取状态 Status(context.Context, *Request) (*StatusResponse, error) // 服务调用 Service(context.Context, *ServiceRequest) (*ServiceResponse, error) // 流数据 OnStream(Trailer_OnStreamServer) error // 数据查询 Query(context.Context, *DataRowsRequest) (*DataRowsResponse, error) // 数据模型 Schema(context.Context, *SchemaRequest) (*SchemaResponse, error) // 停止 Stop(context.Context, *Request) (*Response, error) // contains filtered or unexported methods }
TrailerServer is the server API for Trailer service. All implementations must embed UnimplementedTrailerServer for forward compatibility
type Trailer_OnStreamClient ¶
type Trailer_OnStreamClient interface { Send(*StreamRequest) error Recv() (*StreamResponse, error) grpc.ClientStream }
type Trailer_OnStreamServer ¶
type Trailer_OnStreamServer interface { Send(*StreamResponse) error Recv() (*StreamRequest, error) grpc.ServerStream }
type UnimplementedTrailerServer ¶
type UnimplementedTrailerServer struct { }
UnimplementedTrailerServer must be embedded to have forward compatible implementations.
func (UnimplementedTrailerServer) OnStream ¶
func (UnimplementedTrailerServer) OnStream(Trailer_OnStreamServer) error
func (UnimplementedTrailerServer) Query ¶
func (UnimplementedTrailerServer) Query(context.Context, *DataRowsRequest) (*DataRowsResponse, error)
func (UnimplementedTrailerServer) Schema ¶
func (UnimplementedTrailerServer) Schema(context.Context, *SchemaRequest) (*SchemaResponse, error)
func (UnimplementedTrailerServer) Service ¶
func (UnimplementedTrailerServer) Service(context.Context, *ServiceRequest) (*ServiceResponse, error)
func (UnimplementedTrailerServer) Status ¶
func (UnimplementedTrailerServer) Status(context.Context, *Request) (*StatusResponse, error)
type UnsafeTrailerServer ¶
type UnsafeTrailerServer interface {
// contains filtered or unexported methods
}
UnsafeTrailerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TrailerServer will result in compilation errors.
type ValueType ¶
type ValueType int32
数据列类型, 主要为了和前端JavaScript匹配,分了3类
func (ValueType) Descriptor ¶
func (ValueType) Descriptor() protoreflect.EnumDescriptor
func (ValueType) EnumDescriptor
deprecated
func (ValueType) Number ¶
func (x ValueType) Number() protoreflect.EnumNumber
func (ValueType) Type ¶
func (ValueType) Type() protoreflect.EnumType