Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
- type Data
- func (*Data) Descriptor() ([]byte, []int)deprecated
- func (x *Data) GetBoolVal() bool
- func (x *Data) GetBytesVal() []byte
- func (x *Data) GetDoubleVal() float64
- func (x *Data) GetFloatVal() float32
- func (x *Data) GetInt64Val() int64
- func (x *Data) GetIntVal() int32
- func (x *Data) GetStringVal() string
- func (x *Data) GetUint64Val() uint64
- func (x *Data) GetUintVal() uint32
- func (m *Data) GetVal() isData_Val
- func (*Data) ProtoMessage()
- func (x *Data) ProtoReflect() protoreflect.Message
- func (x *Data) Reset()
- func (x *Data) String() string
- type DataType
- type DataVector
- func (*DataVector) Descriptor() ([]byte, []int)deprecated
- func (x *DataVector) GetConst() bool
- func (x *DataVector) GetData() []*Data
- func (x *DataVector) GetLength() int64
- func (x *DataVector) GetScale() int32
- func (x *DataVector) GetType() DataType
- func (*DataVector) ProtoMessage()
- func (x *DataVector) ProtoReflect() protoreflect.Message
- func (x *DataVector) Reset()
- func (x *DataVector) String() string
- type Data_BoolVal
- type Data_BytesVal
- type Data_DoubleVal
- type Data_FloatVal
- type Data_Int64Val
- type Data_IntVal
- type Data_StringVal
- type Data_Uint64Val
- type Data_UintVal
- type Package
- type PkgReader
- type PkgUploader
- type Request
- func (*Request) Descriptor() ([]byte, []int)deprecated
- func (x *Request) GetContext() map[string]string
- func (x *Request) GetLength() int64
- func (x *Request) GetType() RequestType
- func (x *Request) GetUdf() *Udf
- func (x *Request) GetVectors() []*DataVector
- func (*Request) ProtoMessage()
- func (x *Request) ProtoReflect() protoreflect.Message
- func (x *Request) Reset()
- func (x *Request) String() string
- type RequestType
- func (RequestType) Descriptor() protoreflect.EnumDescriptor
- func (x RequestType) Enum() *RequestType
- func (RequestType) EnumDescriptor() ([]byte, []int)deprecated
- func (x RequestType) Number() protoreflect.EnumNumber
- func (x RequestType) String() string
- func (RequestType) Type() protoreflect.EnumType
- type Response
- type ResponseType
- func (ResponseType) Descriptor() protoreflect.EnumDescriptor
- func (x ResponseType) Enum() *ResponseType
- func (ResponseType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ResponseType) Number() protoreflect.EnumNumber
- func (x ResponseType) String() string
- func (ResponseType) Type() protoreflect.EnumType
- type Service
- type ServiceClient
- type ServiceServer
- type Service_RunClient
- type Service_RunServer
- type Udf
- func (*Udf) Descriptor() ([]byte, []int)deprecated
- func (x *Udf) GetBody() string
- func (x *Udf) GetDb() string
- func (x *Udf) GetHandler() string
- func (x *Udf) GetImportPkg() *Package
- func (x *Udf) GetIsImport() bool
- func (x *Udf) GetLanguage() string
- func (x *Udf) GetModifiedTime() string
- func (x *Udf) GetRetType() DataType
- func (*Udf) ProtoMessage()
- func (x *Udf) ProtoReflect() protoreflect.Message
- func (x *Udf) Reset()
- func (x *Udf) String() string
- type UnimplementedServiceServer
- type UnsafeServiceServer
Constants ¶
const (
LanguagePython = "python"
)
Variables ¶
var ( RequestType_name = map[int32]string{ 0: "UnknownRequest", 1: "DataRequest", 2: "PkgResponse", } RequestType_value = map[string]int32{ "UnknownRequest": 0, "DataRequest": 1, "PkgResponse": 2, } )
Enum value maps for RequestType.
var ( ResponseType_name = map[int32]string{ 0: "UnknownResponse", 1: "DataResponse", 2: "PkgRequest", } ResponseType_value = map[string]int32{ "UnknownResponse": 0, "DataResponse": 1, "PkgRequest": 2, } )
Enum value maps for ResponseType.
var ( DataType_name = map[int32]string{ 0: "UNKNOWN", 10: "BOOL", 20: "INT8", 21: "INT16", 22: "INT32", 23: "INT64", 30: "UINT8", 31: "UINT16", 32: "UINT32", 33: "UINT64", 40: "FLOAT32", 41: "FLOAT64", 50: "CHAR", 51: "VARCHAR", 52: "TEXT", 53: "JSON", 54: "UUID", 60: "TIME", 61: "DATE", 62: "DATETIME", 63: "TIMESTAMP", 70: "DECIMAL64", 71: "DECIMAL128", 80: "BINARY", 81: "VARBINARY", 82: "BLOB", } DataType_value = map[string]int32{ "UNKNOWN": 0, "BOOL": 10, "INT8": 20, "INT16": 21, "INT32": 22, "INT64": 23, "UINT8": 30, "UINT16": 31, "UINT32": 32, "UINT64": 33, "FLOAT32": 40, "FLOAT64": 41, "CHAR": 50, "VARCHAR": 51, "TEXT": 52, "JSON": 53, "UUID": 54, "TIME": 60, "DATE": 61, "DATETIME": 62, "TIMESTAMP": 63, "DECIMAL64": 70, "DECIMAL128": 71, "BINARY": 80, "VARBINARY": 81, "BLOB": 82, } )
Enum value maps for DataType.
var File_udf_proto protoreflect.FileDescriptor
var Service_ServiceDesc = grpc.ServiceDesc{ ServiceName: "udf.Service", HandlerType: (*ServiceServer)(nil), Methods: []grpc.MethodDesc{}, Streams: []grpc.StreamDesc{ { StreamName: "run", Handler: _Service_Run_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "udf.proto", }
Service_ServiceDesc is the grpc.ServiceDesc for Service service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterServiceServer ¶
func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer)
Types ¶
type Data ¶
type Data struct { // Types that are assignable to Val: // // *Data_BoolVal // *Data_IntVal // *Data_Int64Val // *Data_UintVal // *Data_Uint64Val // *Data_FloatVal // *Data_DoubleVal // *Data_StringVal // *Data_BytesVal Val isData_Val `protobuf_oneof:"val"` // contains filtered or unexported fields }
func (*Data) Descriptor
deprecated
func (*Data) GetBoolVal ¶
func (*Data) GetBytesVal ¶
func (*Data) GetDoubleVal ¶
func (*Data) GetFloatVal ¶
func (*Data) GetInt64Val ¶
func (*Data) GetStringVal ¶
func (*Data) GetUint64Val ¶
func (*Data) GetUintVal ¶
func (*Data) ProtoMessage ¶
func (*Data) ProtoMessage()
func (*Data) ProtoReflect ¶
func (x *Data) ProtoReflect() protoreflect.Message
type DataType ¶
type DataType int32
const ( DataType_UNKNOWN DataType = 0 DataType_BOOL DataType = 10 DataType_INT8 DataType = 20 DataType_INT16 DataType = 21 DataType_INT32 DataType = 22 DataType_INT64 DataType = 23 DataType_UINT8 DataType = 30 DataType_UINT16 DataType = 31 DataType_UINT32 DataType = 32 DataType_UINT64 DataType = 33 DataType_FLOAT32 DataType = 40 DataType_FLOAT64 DataType = 41 DataType_CHAR DataType = 50 DataType_VARCHAR DataType = 51 DataType_TEXT DataType = 52 DataType_JSON DataType = 53 DataType_UUID DataType = 54 DataType_TIME DataType = 60 DataType_DATE DataType = 61 DataType_DATETIME DataType = 62 DataType_TIMESTAMP DataType = 63 DataType_DECIMAL64 DataType = 70 DataType_DECIMAL128 DataType = 71 DataType_BINARY DataType = 80 DataType_VARBINARY DataType = 81 DataType_BLOB DataType = 82 )
func (DataType) Descriptor ¶
func (DataType) Descriptor() protoreflect.EnumDescriptor
func (DataType) EnumDescriptor
deprecated
func (DataType) Number ¶
func (x DataType) Number() protoreflect.EnumNumber
func (DataType) Type ¶
func (DataType) Type() protoreflect.EnumType
type DataVector ¶
type DataVector struct { Data []*Data `protobuf:"bytes,1,rep,name=data,proto3" json:"data,omitempty"` Const bool `protobuf:"varint,2,opt,name=const,proto3" json:"const,omitempty"` Length int64 `protobuf:"varint,3,opt,name=length,proto3" json:"length,omitempty"` Type DataType `protobuf:"varint,4,opt,name=type,proto3,enum=udf.DataType" json:"type,omitempty"` Scale int32 `protobuf:"varint,5,opt,name=scale,proto3" json:"scale,omitempty"` // contains filtered or unexported fields }
func (*DataVector) Descriptor
deprecated
func (*DataVector) Descriptor() ([]byte, []int)
Deprecated: Use DataVector.ProtoReflect.Descriptor instead.
func (*DataVector) GetConst ¶
func (x *DataVector) GetConst() bool
func (*DataVector) GetData ¶
func (x *DataVector) GetData() []*Data
func (*DataVector) GetLength ¶
func (x *DataVector) GetLength() int64
func (*DataVector) GetScale ¶
func (x *DataVector) GetScale() int32
func (*DataVector) GetType ¶
func (x *DataVector) GetType() DataType
func (*DataVector) ProtoMessage ¶
func (*DataVector) ProtoMessage()
func (*DataVector) ProtoReflect ¶
func (x *DataVector) ProtoReflect() protoreflect.Message
func (*DataVector) Reset ¶
func (x *DataVector) Reset()
func (*DataVector) String ¶
func (x *DataVector) String() string
type Data_BoolVal ¶
type Data_BoolVal struct {
BoolVal bool `protobuf:"varint,1,opt,name=boolVal,proto3,oneof"` // bool
}
type Data_BytesVal ¶
type Data_BytesVal struct {
BytesVal []byte `protobuf:"bytes,9,opt,name=bytesVal,proto3,oneof"` // binary, varbinary, blob
}
type Data_DoubleVal ¶
type Data_DoubleVal struct {
DoubleVal float64 `protobuf:"fixed64,7,opt,name=doubleVal,proto3,oneof"` // float64
}
type Data_FloatVal ¶
type Data_FloatVal struct {
FloatVal float32 `protobuf:"fixed32,6,opt,name=floatVal,proto3,oneof"` // float32
}
type Data_Int64Val ¶
type Data_Int64Val struct {
Int64Val int64 `protobuf:"zigzag64,3,opt,name=int64Val,proto3,oneof"` // int64
}
type Data_IntVal ¶
type Data_IntVal struct {
IntVal int32 `protobuf:"zigzag32,2,opt,name=intVal,proto3,oneof"` // int8, int16, int32
}
type Data_StringVal ¶
type Data_StringVal struct {
StringVal string `protobuf:"bytes,8,opt,name=stringVal,proto3,oneof"` // char, varchar, text, json, uuid | time, date, datetime, timestamp | Decimal64, Decimal128
}
type Data_Uint64Val ¶
type Data_Uint64Val struct {
Uint64Val uint64 `protobuf:"varint,5,opt,name=uint64Val,proto3,oneof"` // uint64
}
type Data_UintVal ¶
type Data_UintVal struct {
UintVal uint32 `protobuf:"varint,4,opt,name=uintVal,proto3,oneof"` // uint8, uint16, uint32
}
type Package ¶
type Package struct { Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"` Last bool `protobuf:"varint,2,opt,name=last,proto3" json:"last,omitempty"` // contains filtered or unexported fields }
func (*Package) Descriptor
deprecated
func (*Package) ProtoMessage ¶
func (*Package) ProtoMessage()
func (*Package) ProtoReflect ¶
func (x *Package) ProtoReflect() protoreflect.Message
type PkgReader ¶
type PkgReader interface {
Get(ctx context.Context, path string) (reader io.ReadCloser, err error)
}
PkgReader read udf package from storage
type PkgUploader ¶
type PkgUploader interface {
Upload(ctx context.Context, localPath string, storageDir string) (storagePath string, err error)
}
PkgUploader upload udf package to storage
type Request ¶
type Request struct { Udf *Udf `protobuf:"bytes,1,opt,name=udf,proto3" json:"udf,omitempty"` Vectors []*DataVector `protobuf:"bytes,2,rep,name=vectors,proto3" json:"vectors,omitempty"` Length int64 `protobuf:"varint,3,opt,name=length,proto3" json:"length,omitempty"` Type RequestType `protobuf:"varint,4,opt,name=type,proto3,enum=udf.RequestType" json:"type,omitempty"` Context map[string]string `` // currently just transfer, not used /* 155-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Request) Descriptor
deprecated
func (*Request) GetContext ¶
func (*Request) GetType ¶
func (x *Request) GetType() RequestType
func (*Request) GetVectors ¶
func (x *Request) GetVectors() []*DataVector
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type RequestType ¶
type RequestType int32
const ( RequestType_UnknownRequest RequestType = 0 RequestType_DataRequest RequestType = 1 // request with data for function result RequestType_PkgResponse RequestType = 2 // response with package )
func (RequestType) Descriptor ¶
func (RequestType) Descriptor() protoreflect.EnumDescriptor
func (RequestType) Enum ¶
func (x RequestType) Enum() *RequestType
func (RequestType) EnumDescriptor
deprecated
func (RequestType) EnumDescriptor() ([]byte, []int)
Deprecated: Use RequestType.Descriptor instead.
func (RequestType) Number ¶
func (x RequestType) Number() protoreflect.EnumNumber
func (RequestType) String ¶
func (x RequestType) String() string
func (RequestType) Type ¶
func (RequestType) Type() protoreflect.EnumType
type Response ¶
type Response struct { Vector *DataVector `protobuf:"bytes,1,opt,name=vector,proto3" json:"vector,omitempty"` Type ResponseType `protobuf:"varint,2,opt,name=type,proto3,enum=udf.ResponseType" json:"type,omitempty"` // contains filtered or unexported fields }
func (*Response) Descriptor
deprecated
func (*Response) GetType ¶
func (x *Response) GetType() ResponseType
func (*Response) GetVector ¶
func (x *Response) GetVector() *DataVector
func (*Response) ProtoMessage ¶
func (*Response) ProtoMessage()
func (*Response) ProtoReflect ¶
func (x *Response) ProtoReflect() protoreflect.Message
type ResponseType ¶
type ResponseType int32
const ( ResponseType_UnknownResponse ResponseType = 0 ResponseType_DataResponse ResponseType = 1 // response with function result ResponseType_PkgRequest ResponseType = 2 // request for package )
func (ResponseType) Descriptor ¶
func (ResponseType) Descriptor() protoreflect.EnumDescriptor
func (ResponseType) Enum ¶
func (x ResponseType) Enum() *ResponseType
func (ResponseType) EnumDescriptor
deprecated
func (ResponseType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ResponseType.Descriptor instead.
func (ResponseType) Number ¶
func (x ResponseType) Number() protoreflect.EnumNumber
func (ResponseType) String ¶
func (x ResponseType) String() string
func (ResponseType) Type ¶
func (ResponseType) Type() protoreflect.EnumType
type Service ¶
type Service interface { Language() string Run(ctx context.Context, request *Request, pkgReader PkgReader) (*Response, error) }
Service handle non-sql udf in cn
func NewService ¶
type ServiceClient ¶
type ServiceClient interface {
Run(ctx context.Context, opts ...grpc.CallOption) (Service_RunClient, error)
}
ServiceClient is the client API for Service 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 NewServiceClient ¶
func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient
type ServiceServer ¶
type ServiceServer interface { Run(Service_RunServer) error // contains filtered or unexported methods }
ServiceServer is the server API for Service service. All implementations must embed UnimplementedServiceServer for forward compatibility
type Service_RunClient ¶
type Service_RunServer ¶
type Udf ¶
type Udf struct { Handler string `protobuf:"bytes,1,opt,name=handler,proto3" json:"handler,omitempty"` IsImport bool `protobuf:"varint,2,opt,name=isImport,proto3" json:"isImport,omitempty"` Body string `protobuf:"bytes,3,opt,name=body,proto3" json:"body,omitempty"` ImportPkg *Package `protobuf:"bytes,4,opt,name=importPkg,proto3" json:"importPkg,omitempty"` RetType DataType `protobuf:"varint,5,opt,name=retType,proto3,enum=udf.DataType" json:"retType,omitempty"` Language string `protobuf:"bytes,6,opt,name=language,proto3" json:"language,omitempty"` ModifiedTime string `protobuf:"bytes,7,opt,name=modifiedTime,proto3" json:"modifiedTime,omitempty"` Db string `protobuf:"bytes,8,opt,name=db,proto3" json:"db,omitempty"` // contains filtered or unexported fields }
func (*Udf) Descriptor
deprecated
func (*Udf) GetHandler ¶
func (*Udf) GetImportPkg ¶
func (*Udf) GetIsImport ¶
func (*Udf) GetLanguage ¶
func (*Udf) GetModifiedTime ¶
func (*Udf) GetRetType ¶
func (*Udf) ProtoMessage ¶
func (*Udf) ProtoMessage()
func (*Udf) ProtoReflect ¶
func (x *Udf) ProtoReflect() protoreflect.Message
type UnimplementedServiceServer ¶
type UnimplementedServiceServer struct { }
UnimplementedServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedServiceServer) Run ¶
func (UnimplementedServiceServer) Run(Service_RunServer) error
type UnsafeServiceServer ¶
type UnsafeServiceServer interface {
// contains filtered or unexported methods
}
UnsafeServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ServiceServer will result in compilation errors.