model

package
v1.2.9 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package model is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_model_base_proto protoreflect.FileDescriptor
View Source
var File_model_predict_proto protoreflect.FileDescriptor
View Source
var File_model_service_proto protoreflect.FileDescriptor
View Source
var Model_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "model.Model",
	HandlerType: (*ModelServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ModelPredict",
			Handler:    _Model_ModelPredict_Handler,
		},
		{
			MethodName: "Health",
			Handler:    _Model_Health_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "model_service.proto",
}

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

Functions

func RegisterModelHandler added in v1.2.1

func RegisterModelHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterModelHandler registers the http handlers for service Model to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterModelHandlerClient added in v1.2.1

func RegisterModelHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ModelClient) error

RegisterModelHandlerClient registers the http handlers for service Model to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ModelClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ModelClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ModelClient" to call the correct interceptors.

func RegisterModelHandlerFromEndpoint added in v1.2.1

func RegisterModelHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterModelHandlerFromEndpoint is same as RegisterModelHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterModelHandlerServer added in v1.2.1

func RegisterModelHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ModelServer) error

RegisterModelHandlerServer registers the http handlers for service Model to "mux". UnaryRPC :call ModelServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterModelHandlerFromEndpoint instead.

func RegisterModelServer added in v1.2.1

func RegisterModelServer(s grpc.ServiceRegistrar, srv ModelServer)

Types

type ModelClient added in v1.2.1

type ModelClient interface {
	ModelPredict(ctx context.Context, in *ModelPredictRequest, opts ...grpc.CallOption) (*ModelPredictResponse, error)
	Health(ctx context.Context, in *ModelHealthRequest, opts ...grpc.CallOption) (*ModelHealthResponse, error)
}

ModelClient is the client API for Model 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 NewModelClient added in v1.2.1

func NewModelClient(cc grpc.ClientConnInterface) ModelClient

type ModelHealthRequest added in v1.2.7

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

func (*ModelHealthRequest) Descriptor deprecated added in v1.2.7

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

Deprecated: Use ModelHealthRequest.ProtoReflect.Descriptor instead.

func (*ModelHealthRequest) ProtoMessage added in v1.2.7

func (*ModelHealthRequest) ProtoMessage()

func (*ModelHealthRequest) ProtoReflect added in v1.2.7

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

func (*ModelHealthRequest) Reset added in v1.2.7

func (x *ModelHealthRequest) Reset()

func (*ModelHealthRequest) String added in v1.2.7

func (x *ModelHealthRequest) String() string

type ModelHealthResponse added in v1.2.7

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

func (*ModelHealthResponse) Descriptor deprecated added in v1.2.7

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

Deprecated: Use ModelHealthResponse.ProtoReflect.Descriptor instead.

func (*ModelHealthResponse) ProtoMessage added in v1.2.7

func (*ModelHealthResponse) ProtoMessage()

func (*ModelHealthResponse) ProtoReflect added in v1.2.7

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

func (*ModelHealthResponse) Reset added in v1.2.7

func (x *ModelHealthResponse) Reset()

func (*ModelHealthResponse) String added in v1.2.7

func (x *ModelHealthResponse) String() string

type ModelPredictRequest

type ModelPredictRequest struct {
	UserId             int64    `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	ModelId            int64    `protobuf:"varint,2,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"`
	PredictFileUrlList []string `protobuf:"bytes,3,rep,name=predict_file_url_list,json=predictFileUrlList,proto3" json:"predict_file_url_list,omitempty"`
	IsDicom            bool     `protobuf:"varint,4,opt,name=is_dicom,json=isDicom,proto3" json:"is_dicom,omitempty"`
	// contains filtered or unexported fields
}

func (*ModelPredictRequest) Descriptor deprecated

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

Deprecated: Use ModelPredictRequest.ProtoReflect.Descriptor instead.

func (*ModelPredictRequest) GetIsDicom

func (x *ModelPredictRequest) GetIsDicom() bool

func (*ModelPredictRequest) GetModelId

func (x *ModelPredictRequest) GetModelId() int64

func (*ModelPredictRequest) GetPredictFileUrlList

func (x *ModelPredictRequest) GetPredictFileUrlList() []string

func (*ModelPredictRequest) GetUserId added in v1.2.2

func (x *ModelPredictRequest) GetUserId() int64

func (*ModelPredictRequest) ProtoMessage

func (*ModelPredictRequest) ProtoMessage()

func (*ModelPredictRequest) ProtoReflect

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

func (*ModelPredictRequest) Reset

func (x *ModelPredictRequest) Reset()

func (*ModelPredictRequest) String

func (x *ModelPredictRequest) String() string

type ModelPredictResponse

type ModelPredictResponse struct {
	StatusCode int32                      `protobuf:"varint,1,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	Msg        string                     `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Data       *ModelPredictResponse_Data `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*ModelPredictResponse) Descriptor deprecated

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

Deprecated: Use ModelPredictResponse.ProtoReflect.Descriptor instead.

func (*ModelPredictResponse) GetData

func (*ModelPredictResponse) GetMsg

func (x *ModelPredictResponse) GetMsg() string

func (*ModelPredictResponse) GetStatusCode

func (x *ModelPredictResponse) GetStatusCode() int32

func (*ModelPredictResponse) ProtoMessage

func (*ModelPredictResponse) ProtoMessage()

func (*ModelPredictResponse) ProtoReflect

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

func (*ModelPredictResponse) Reset

func (x *ModelPredictResponse) Reset()

func (*ModelPredictResponse) String

func (x *ModelPredictResponse) String() string

type ModelPredictResponse_Data

type ModelPredictResponse_Data struct {
	ResultImageList []string                `protobuf:"bytes,1,rep,name=result_image_list,json=resultImageList,proto3" json:"result_image_list,omitempty"`
	Result          map[int32]*PredictShape `` /* 154-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ModelPredictResponse_Data) Descriptor deprecated

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

Deprecated: Use ModelPredictResponse_Data.ProtoReflect.Descriptor instead.

func (*ModelPredictResponse_Data) GetResult

func (x *ModelPredictResponse_Data) GetResult() map[int32]*PredictShape

func (*ModelPredictResponse_Data) GetResultImageList

func (x *ModelPredictResponse_Data) GetResultImageList() []string

func (*ModelPredictResponse_Data) ProtoMessage

func (*ModelPredictResponse_Data) ProtoMessage()

func (*ModelPredictResponse_Data) ProtoReflect

func (*ModelPredictResponse_Data) Reset

func (x *ModelPredictResponse_Data) Reset()

func (*ModelPredictResponse_Data) String

func (x *ModelPredictResponse_Data) String() string

type ModelServer added in v1.2.1

type ModelServer interface {
	ModelPredict(context.Context, *ModelPredictRequest) (*ModelPredictResponse, error)
	Health(context.Context, *ModelHealthRequest) (*ModelHealthResponse, error)
	// contains filtered or unexported methods
}

ModelServer is the server API for Model service. All implementations must embed UnimplementedModelServer for forward compatibility

type PredictShape

type PredictShape struct {
	Classes []*PredictShape_Class `protobuf:"bytes,1,rep,name=classes,proto3" json:"classes,omitempty"`
	// contains filtered or unexported fields
}

func (*PredictShape) Descriptor deprecated

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

Deprecated: Use PredictShape.ProtoReflect.Descriptor instead.

func (*PredictShape) GetClasses

func (x *PredictShape) GetClasses() []*PredictShape_Class

func (*PredictShape) ProtoMessage

func (*PredictShape) ProtoMessage()

func (*PredictShape) ProtoReflect

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

func (*PredictShape) Reset

func (x *PredictShape) Reset()

func (*PredictShape) String

func (x *PredictShape) String() string

type PredictShape_Class

type PredictShape_Class struct {
	Color  string                `protobuf:"bytes,1,opt,name=color,proto3" json:"color,omitempty"`
	Points []*PredictShape_Point `protobuf:"bytes,2,rep,name=points,proto3" json:"points,omitempty"`
	// contains filtered or unexported fields
}

func (*PredictShape_Class) Descriptor deprecated

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

Deprecated: Use PredictShape_Class.ProtoReflect.Descriptor instead.

func (*PredictShape_Class) GetColor

func (x *PredictShape_Class) GetColor() string

func (*PredictShape_Class) GetPoints

func (x *PredictShape_Class) GetPoints() []*PredictShape_Point

func (*PredictShape_Class) ProtoMessage

func (*PredictShape_Class) ProtoMessage()

func (*PredictShape_Class) ProtoReflect

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

func (*PredictShape_Class) Reset

func (x *PredictShape_Class) Reset()

func (*PredictShape_Class) String

func (x *PredictShape_Class) String() string

type PredictShape_Point

type PredictShape_Point struct {
	PointCoordinate []int32 `protobuf:"varint,1,rep,packed,name=point_coordinate,json=pointCoordinate,proto3" json:"point_coordinate,omitempty"`
	// contains filtered or unexported fields
}

func (*PredictShape_Point) Descriptor deprecated

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

Deprecated: Use PredictShape_Point.ProtoReflect.Descriptor instead.

func (*PredictShape_Point) GetPointCoordinate

func (x *PredictShape_Point) GetPointCoordinate() []int32

func (*PredictShape_Point) ProtoMessage

func (*PredictShape_Point) ProtoMessage()

func (*PredictShape_Point) ProtoReflect

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

func (*PredictShape_Point) Reset

func (x *PredictShape_Point) Reset()

func (*PredictShape_Point) String

func (x *PredictShape_Point) String() string

type UnimplementedModelServer added in v1.2.1

type UnimplementedModelServer struct {
}

UnimplementedModelServer must be embedded to have forward compatible implementations.

func (UnimplementedModelServer) Health added in v1.2.3

func (UnimplementedModelServer) ModelPredict added in v1.2.1

type UnsafeModelServer added in v1.2.1

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

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

Jump to

Keyboard shortcuts

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