Documentation ¶
Overview ¶
Package run is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterRunnerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterRunnerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RunnerClient) error
- func RegisterRunnerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterRunnerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RunnerServer) error
- func RegisterRunnerServer(s grpc.ServiceRegistrar, srv RunnerServer)
- type CodeRequest
- type CodeResponse
- func (*CodeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *CodeResponse) GetCode() string
- func (x *CodeResponse) GetError() string
- func (x *CodeResponse) GetOutput() string
- func (*CodeResponse) ProtoMessage()
- func (x *CodeResponse) ProtoReflect() protoreflect.Message
- func (x *CodeResponse) Reset()
- func (x *CodeResponse) String() string
- type DeleteCodeRequest
- func (*DeleteCodeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteCodeRequest) GetId() int64
- func (x *DeleteCodeRequest) GetUserId() int64
- func (*DeleteCodeRequest) ProtoMessage()
- func (x *DeleteCodeRequest) ProtoReflect() protoreflect.Message
- func (x *DeleteCodeRequest) Reset()
- func (x *DeleteCodeRequest) String() string
- type DeleteCodeResponse
- func (*DeleteCodeResponse) Descriptor() ([]byte, []int)deprecated
- func (x *DeleteCodeResponse) GetSuccess() bool
- func (*DeleteCodeResponse) ProtoMessage()
- func (x *DeleteCodeResponse) ProtoReflect() protoreflect.Message
- func (x *DeleteCodeResponse) Reset()
- func (x *DeleteCodeResponse) String() string
- type IdRequest
- type RunnerClient
- type RunnerServer
- type ShareResponse
- type UnimplementedRunnerServer
- func (UnimplementedRunnerServer) DeleteCode(context.Context, *DeleteCodeRequest) (*DeleteCodeResponse, error)
- func (UnimplementedRunnerServer) GetCodeByID(context.Context, *IdRequest) (*CodeResponse, error)
- func (UnimplementedRunnerServer) RunCode(context.Context, *CodeRequest) (*CodeResponse, error)
- func (UnimplementedRunnerServer) ShareCode(context.Context, *CodeRequest) (*ShareResponse, error)
- type UnsafeRunnerServer
Constants ¶
This section is empty.
Variables ¶
var File_runner_runner_proto protoreflect.FileDescriptor
var Runner_ServiceDesc = grpc.ServiceDesc{ ServiceName: "runner.Runner", HandlerType: (*RunnerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "RunCode", Handler: _Runner_RunCode_Handler, }, { MethodName: "ShareCode", Handler: _Runner_ShareCode_Handler, }, { MethodName: "GetCodeByID", Handler: _Runner_GetCodeByID_Handler, }, { MethodName: "DeleteCode", Handler: _Runner_DeleteCode_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "runner/runner.proto", }
Runner_ServiceDesc is the grpc.ServiceDesc for Runner service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterRunnerHandler ¶ added in v0.0.6
RegisterRunnerHandler registers the http handlers for service Runner to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterRunnerHandlerClient ¶ added in v0.0.6
func RegisterRunnerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client RunnerClient) error
RegisterRunnerHandlerClient registers the http handlers for service Runner to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "RunnerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "RunnerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "RunnerClient" to call the correct interceptors.
func RegisterRunnerHandlerFromEndpoint ¶ added in v0.0.6
func RegisterRunnerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterRunnerHandlerFromEndpoint is same as RegisterRunnerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterRunnerHandlerServer ¶ added in v0.0.6
func RegisterRunnerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server RunnerServer) error
RegisterRunnerHandlerServer registers the http handlers for service Runner to "mux". UnaryRPC :call RunnerServer 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 RegisterRunnerHandlerFromEndpoint instead.
func RegisterRunnerServer ¶
func RegisterRunnerServer(s grpc.ServiceRegistrar, srv RunnerServer)
Types ¶
type CodeRequest ¶
type CodeRequest struct { Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` // contains filtered or unexported fields }
func (*CodeRequest) Descriptor
deprecated
func (*CodeRequest) Descriptor() ([]byte, []int)
Deprecated: Use CodeRequest.ProtoReflect.Descriptor instead.
func (*CodeRequest) GetCode ¶
func (x *CodeRequest) GetCode() string
func (*CodeRequest) ProtoMessage ¶
func (*CodeRequest) ProtoMessage()
func (*CodeRequest) ProtoReflect ¶
func (x *CodeRequest) ProtoReflect() protoreflect.Message
func (*CodeRequest) Reset ¶
func (x *CodeRequest) Reset()
func (*CodeRequest) String ¶
func (x *CodeRequest) String() string
type CodeResponse ¶
type CodeResponse struct { Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` Output string `protobuf:"bytes,2,opt,name=output,proto3" json:"output,omitempty"` Error string `protobuf:"bytes,3,opt,name=error,proto3" json:"error,omitempty"` // contains filtered or unexported fields }
func (*CodeResponse) Descriptor
deprecated
func (*CodeResponse) Descriptor() ([]byte, []int)
Deprecated: Use CodeResponse.ProtoReflect.Descriptor instead.
func (*CodeResponse) GetCode ¶
func (x *CodeResponse) GetCode() string
func (*CodeResponse) GetError ¶
func (x *CodeResponse) GetError() string
func (*CodeResponse) GetOutput ¶
func (x *CodeResponse) GetOutput() string
func (*CodeResponse) ProtoMessage ¶
func (*CodeResponse) ProtoMessage()
func (*CodeResponse) ProtoReflect ¶
func (x *CodeResponse) ProtoReflect() protoreflect.Message
func (*CodeResponse) Reset ¶
func (x *CodeResponse) Reset()
func (*CodeResponse) String ¶
func (x *CodeResponse) String() string
type DeleteCodeRequest ¶ added in v0.0.9
type DeleteCodeRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // contains filtered or unexported fields }
func (*DeleteCodeRequest) Descriptor
deprecated
added in
v0.0.9
func (*DeleteCodeRequest) Descriptor() ([]byte, []int)
Deprecated: Use DeleteCodeRequest.ProtoReflect.Descriptor instead.
func (*DeleteCodeRequest) GetId ¶ added in v0.0.9
func (x *DeleteCodeRequest) GetId() int64
func (*DeleteCodeRequest) GetUserId ¶ added in v0.0.9
func (x *DeleteCodeRequest) GetUserId() int64
func (*DeleteCodeRequest) ProtoMessage ¶ added in v0.0.9
func (*DeleteCodeRequest) ProtoMessage()
func (*DeleteCodeRequest) ProtoReflect ¶ added in v0.0.9
func (x *DeleteCodeRequest) ProtoReflect() protoreflect.Message
func (*DeleteCodeRequest) Reset ¶ added in v0.0.9
func (x *DeleteCodeRequest) Reset()
func (*DeleteCodeRequest) String ¶ added in v0.0.9
func (x *DeleteCodeRequest) String() string
type DeleteCodeResponse ¶ added in v0.0.9
type DeleteCodeResponse struct { Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"` // contains filtered or unexported fields }
func (*DeleteCodeResponse) Descriptor
deprecated
added in
v0.0.9
func (*DeleteCodeResponse) Descriptor() ([]byte, []int)
Deprecated: Use DeleteCodeResponse.ProtoReflect.Descriptor instead.
func (*DeleteCodeResponse) GetSuccess ¶ added in v0.0.9
func (x *DeleteCodeResponse) GetSuccess() bool
func (*DeleteCodeResponse) ProtoMessage ¶ added in v0.0.9
func (*DeleteCodeResponse) ProtoMessage()
func (*DeleteCodeResponse) ProtoReflect ¶ added in v0.0.9
func (x *DeleteCodeResponse) ProtoReflect() protoreflect.Message
func (*DeleteCodeResponse) Reset ¶ added in v0.0.9
func (x *DeleteCodeResponse) Reset()
func (*DeleteCodeResponse) String ¶ added in v0.0.9
func (x *DeleteCodeResponse) String() string
type IdRequest ¶
type IdRequest struct { Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*IdRequest) Descriptor
deprecated
func (*IdRequest) ProtoMessage ¶
func (*IdRequest) ProtoMessage()
func (*IdRequest) ProtoReflect ¶
func (x *IdRequest) ProtoReflect() protoreflect.Message
type RunnerClient ¶
type RunnerClient interface { RunCode(ctx context.Context, in *CodeRequest, opts ...grpc.CallOption) (*CodeResponse, error) GetCodeByID(ctx context.Context, in *IdRequest, opts ...grpc.CallOption) (*CodeResponse, error) DeleteCode(ctx context.Context, in *DeleteCodeRequest, opts ...grpc.CallOption) (*DeleteCodeResponse, error) }
RunnerClient is the client API for Runner 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 NewRunnerClient ¶
func NewRunnerClient(cc grpc.ClientConnInterface) RunnerClient
type RunnerServer ¶
type RunnerServer interface { RunCode(context.Context, *CodeRequest) (*CodeResponse, error) GetCodeByID(context.Context, *IdRequest) (*CodeResponse, error) DeleteCode(context.Context, *DeleteCodeRequest) (*DeleteCodeResponse, error) // contains filtered or unexported methods }
RunnerServer is the server API for Runner service. All implementations must embed UnimplementedRunnerServer for forward compatibility
type ShareResponse ¶
type ShareResponse struct { // contains filtered or unexported fields }
func (*ShareResponse) Descriptor
deprecated
func (*ShareResponse) Descriptor() ([]byte, []int)
Deprecated: Use ShareResponse.ProtoReflect.Descriptor instead.
func (*ShareResponse) GetId ¶ added in v0.0.5
func (x *ShareResponse) GetId() int64
func (*ShareResponse) ProtoMessage ¶
func (*ShareResponse) ProtoMessage()
func (*ShareResponse) ProtoReflect ¶
func (x *ShareResponse) ProtoReflect() protoreflect.Message
func (*ShareResponse) Reset ¶
func (x *ShareResponse) Reset()
func (*ShareResponse) String ¶
func (x *ShareResponse) String() string
type UnimplementedRunnerServer ¶
type UnimplementedRunnerServer struct { }
UnimplementedRunnerServer must be embedded to have forward compatible implementations.
func (UnimplementedRunnerServer) DeleteCode ¶ added in v0.0.9
func (UnimplementedRunnerServer) DeleteCode(context.Context, *DeleteCodeRequest) (*DeleteCodeResponse, error)
func (UnimplementedRunnerServer) GetCodeByID ¶
func (UnimplementedRunnerServer) GetCodeByID(context.Context, *IdRequest) (*CodeResponse, error)
func (UnimplementedRunnerServer) RunCode ¶
func (UnimplementedRunnerServer) RunCode(context.Context, *CodeRequest) (*CodeResponse, error)
func (UnimplementedRunnerServer) ShareCode ¶
func (UnimplementedRunnerServer) ShareCode(context.Context, *CodeRequest) (*ShareResponse, error)
type UnsafeRunnerServer ¶
type UnsafeRunnerServer interface {
// contains filtered or unexported methods
}
UnsafeRunnerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to RunnerServer will result in compilation errors.