api

package
v0.3.5-alpha Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Overview

Package api is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	JobStatusEnum_name = map[int32]string{
		0: "INIT",
		1: "RUNNING",
		2: "SUCCESFULL",
		3: "ERROR",
	}
	JobStatusEnum_value = map[string]int32{
		"INIT":       0,
		"RUNNING":    1,
		"SUCCESFULL": 2,
		"ERROR":      3,
	}
)

Enum value maps for JobStatusEnum.

View Source
var BaktaJobs_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "BaktaJobs",
	HandlerType: (*BaktaJobsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "InitJob",
			Handler:    _BaktaJobs_InitJob_Handler,
		},
		{
			MethodName: "StartJob",
			Handler:    _BaktaJobs_StartJob_Handler,
		},
		{
			MethodName: "GetJobsStatus",
			Handler:    _BaktaJobs_GetJobsStatus_Handler,
		},
		{
			MethodName: "GetJobResult",
			Handler:    _BaktaJobs_GetJobResult_Handler,
		},
		{
			MethodName: "Version",
			Handler:    _BaktaJobs_Version_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/api/Jobs.proto",
}

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

View Source
var BaktaStatusUpdate_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "BaktaStatusUpdate",
	HandlerType: (*BaktaStatusUpdateServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "UpdateStatus",
			Handler:    _BaktaStatusUpdate_UpdateStatus_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/api/StatusUpdate.proto",
}

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

View Source
var File_proto_api_Jobs_proto protoreflect.FileDescriptor
View Source
var File_proto_api_StatusUpdate_proto protoreflect.FileDescriptor
View Source
var File_proto_api_Swagger_proto protoreflect.FileDescriptor

Functions

func RegisterBaktaJobsHandler

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

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

func RegisterBaktaJobsHandlerClient

func RegisterBaktaJobsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client BaktaJobsClient) error

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

func RegisterBaktaJobsHandlerFromEndpoint

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

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

func RegisterBaktaJobsHandlerServer

func RegisterBaktaJobsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server BaktaJobsServer) error

RegisterBaktaJobsHandlerServer registers the http handlers for service BaktaJobs to "mux". UnaryRPC :call BaktaJobsServer 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 RegisterBaktaJobsHandlerFromEndpoint instead.

func RegisterBaktaJobsServer

func RegisterBaktaJobsServer(s grpc.ServiceRegistrar, srv BaktaJobsServer)

func RegisterBaktaStatusUpdateServer

func RegisterBaktaStatusUpdateServer(s grpc.ServiceRegistrar, srv BaktaStatusUpdateServer)

Types

type BaktaJobsClient

type BaktaJobsClient interface {
	InitJob(ctx context.Context, in *InitJobRequest, opts ...grpc.CallOption) (*InitJobResponse, error)
	StartJob(ctx context.Context, in *StartJobRequest, opts ...grpc.CallOption) (*Empty, error)
	GetJobsStatus(ctx context.Context, in *JobStatusRequestList, opts ...grpc.CallOption) (*JobStatusReponseList, error)
	GetJobResult(ctx context.Context, in *JobAuth, opts ...grpc.CallOption) (*JobResultResponse, error)
	Version(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*VersionResponse, error)
}

BaktaJobsClient is the client API for BaktaJobs 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 NewBaktaJobsClient

func NewBaktaJobsClient(cc grpc.ClientConnInterface) BaktaJobsClient

type BaktaJobsServer

type BaktaJobsServer interface {
	InitJob(context.Context, *InitJobRequest) (*InitJobResponse, error)
	StartJob(context.Context, *StartJobRequest) (*Empty, error)
	GetJobsStatus(context.Context, *JobStatusRequestList) (*JobStatusReponseList, error)
	GetJobResult(context.Context, *JobAuth) (*JobResultResponse, error)
	Version(context.Context, *Empty) (*VersionResponse, error)
	// contains filtered or unexported methods
}

BaktaJobsServer is the server API for BaktaJobs service. All implementations must embed UnimplementedBaktaJobsServer for forward compatibility

type BaktaStatusUpdateClient

type BaktaStatusUpdateClient interface {
	UpdateStatus(ctx context.Context, in *UpdateStatusRequest, opts ...grpc.CallOption) (*Empty, error)
}

BaktaStatusUpdateClient is the client API for BaktaStatusUpdate 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 BaktaStatusUpdateServer

type BaktaStatusUpdateServer interface {
	UpdateStatus(context.Context, *UpdateStatusRequest) (*Empty, error)
	// contains filtered or unexported methods
}

BaktaStatusUpdateServer is the server API for BaktaStatusUpdate service. All implementations must embed UnimplementedBaktaStatusUpdateServer for forward compatibility

type Empty

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

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type InitJobRequest

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

func (*InitJobRequest) Descriptor deprecated

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

Deprecated: Use InitJobRequest.ProtoReflect.Descriptor instead.

func (*InitJobRequest) ProtoMessage

func (*InitJobRequest) ProtoMessage()

func (*InitJobRequest) ProtoReflect

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

func (*InitJobRequest) Reset

func (x *InitJobRequest) Reset()

func (*InitJobRequest) String

func (x *InitJobRequest) String() string

type InitJobResponse

type InitJobResponse struct {
	UploadLinkFasta     string   `protobuf:"bytes,1,opt,name=uploadLinkFasta,proto3" json:"uploadLinkFasta,omitempty"`
	UploadLinkProdigal  string   `protobuf:"bytes,2,opt,name=uploadLinkProdigal,proto3" json:"uploadLinkProdigal,omitempty"`
	UploadLinkReplicons string   `protobuf:"bytes,3,opt,name=uploadLinkReplicons,proto3" json:"uploadLinkReplicons,omitempty"`
	Job                 *JobAuth `protobuf:"bytes,4,opt,name=job,proto3" json:"job,omitempty"`
	// contains filtered or unexported fields
}

func (*InitJobResponse) Descriptor deprecated

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

Deprecated: Use InitJobResponse.ProtoReflect.Descriptor instead.

func (*InitJobResponse) GetJob

func (x *InitJobResponse) GetJob() *JobAuth

func (*InitJobResponse) GetUploadLinkFasta

func (x *InitJobResponse) GetUploadLinkFasta() string

func (*InitJobResponse) GetUploadLinkProdigal

func (x *InitJobResponse) GetUploadLinkProdigal() string

func (*InitJobResponse) GetUploadLinkReplicons

func (x *InitJobResponse) GetUploadLinkReplicons() string

func (*InitJobResponse) ProtoMessage

func (*InitJobResponse) ProtoMessage()

func (*InitJobResponse) ProtoReflect

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

func (*InitJobResponse) Reset

func (x *InitJobResponse) Reset()

func (*InitJobResponse) String

func (x *InitJobResponse) String() string

type JobAuth

type JobAuth struct {
	Secret string `protobuf:"bytes,1,opt,name=secret,proto3" json:"secret,omitempty"`
	JobID  string `protobuf:"bytes,2,opt,name=jobID,proto3" json:"jobID,omitempty"`
	// contains filtered or unexported fields
}

func (*JobAuth) Descriptor deprecated

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

Deprecated: Use JobAuth.ProtoReflect.Descriptor instead.

func (*JobAuth) GetJobID

func (x *JobAuth) GetJobID() string

func (*JobAuth) GetSecret

func (x *JobAuth) GetSecret() string

func (*JobAuth) ProtoMessage

func (*JobAuth) ProtoMessage()

func (*JobAuth) ProtoReflect

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

func (*JobAuth) Reset

func (x *JobAuth) Reset()

func (*JobAuth) String

func (x *JobAuth) String() string

type JobConfig

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

func (*JobConfig) Descriptor deprecated

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

Deprecated: Use JobConfig.ProtoReflect.Descriptor instead.

func (*JobConfig) ProtoMessage

func (*JobConfig) ProtoMessage()

func (*JobConfig) ProtoReflect

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

func (*JobConfig) Reset

func (x *JobConfig) Reset()

func (*JobConfig) String

func (x *JobConfig) String() string

type JobResultResponse

type JobResultResponse struct {
	JobID       string                 `protobuf:"bytes,1,opt,name=jobID,proto3" json:"jobID,omitempty"`
	ResultFiles *_struct.Struct        `protobuf:"bytes,2,opt,name=ResultFiles,proto3" json:"ResultFiles,omitempty"`
	Started     *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=started,proto3" json:"started,omitempty"`
	Updated     *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated,proto3" json:"updated,omitempty"`
	// contains filtered or unexported fields
}

func (*JobResultResponse) Descriptor deprecated

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

Deprecated: Use JobResultResponse.ProtoReflect.Descriptor instead.

func (*JobResultResponse) GetJobID

func (x *JobResultResponse) GetJobID() string

func (*JobResultResponse) GetResultFiles

func (x *JobResultResponse) GetResultFiles() *_struct.Struct

func (*JobResultResponse) GetStarted

func (x *JobResultResponse) GetStarted() *timestamppb.Timestamp

func (*JobResultResponse) GetUpdated

func (x *JobResultResponse) GetUpdated() *timestamppb.Timestamp

func (*JobResultResponse) ProtoMessage

func (*JobResultResponse) ProtoMessage()

func (*JobResultResponse) ProtoReflect

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

func (*JobResultResponse) Reset

func (x *JobResultResponse) Reset()

func (*JobResultResponse) String

func (x *JobResultResponse) String() string

type JobStatusEnum

type JobStatusEnum int32
const (
	JobStatusEnum_INIT       JobStatusEnum = 0
	JobStatusEnum_RUNNING    JobStatusEnum = 1
	JobStatusEnum_SUCCESFULL JobStatusEnum = 2
	JobStatusEnum_ERROR      JobStatusEnum = 3
)

func (JobStatusEnum) Descriptor

func (JobStatusEnum) Enum

func (x JobStatusEnum) Enum() *JobStatusEnum

func (JobStatusEnum) EnumDescriptor deprecated

func (JobStatusEnum) EnumDescriptor() ([]byte, []int)

Deprecated: Use JobStatusEnum.Descriptor instead.

func (JobStatusEnum) Number

func (JobStatusEnum) String

func (x JobStatusEnum) String() string

func (JobStatusEnum) Type

type JobStatusReponseList

type JobStatusReponseList struct {
	Jobs []*JobStatusResponse `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"`
	// contains filtered or unexported fields
}

func (*JobStatusReponseList) Descriptor deprecated

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

Deprecated: Use JobStatusReponseList.ProtoReflect.Descriptor instead.

func (*JobStatusReponseList) GetJobs

func (x *JobStatusReponseList) GetJobs() []*JobStatusResponse

func (*JobStatusReponseList) ProtoMessage

func (*JobStatusReponseList) ProtoMessage()

func (*JobStatusReponseList) ProtoReflect

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

func (*JobStatusReponseList) Reset

func (x *JobStatusReponseList) Reset()

func (*JobStatusReponseList) String

func (x *JobStatusReponseList) String() string

type JobStatusRequestList

type JobStatusRequestList struct {
	Jobs []*JobAuth `protobuf:"bytes,1,rep,name=jobs,proto3" json:"jobs,omitempty"`
	// contains filtered or unexported fields
}

func (*JobStatusRequestList) Descriptor deprecated

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

Deprecated: Use JobStatusRequestList.ProtoReflect.Descriptor instead.

func (*JobStatusRequestList) GetJobs

func (x *JobStatusRequestList) GetJobs() []*JobAuth

func (*JobStatusRequestList) ProtoMessage

func (*JobStatusRequestList) ProtoMessage()

func (*JobStatusRequestList) ProtoReflect

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

func (*JobStatusRequestList) Reset

func (x *JobStatusRequestList) Reset()

func (*JobStatusRequestList) String

func (x *JobStatusRequestList) String() string

type JobStatusResponse

type JobStatusResponse struct {
	JobID     string                 `protobuf:"bytes,1,opt,name=jobID,proto3" json:"jobID,omitempty"`
	JobStatus JobStatusEnum          `protobuf:"varint,2,opt,name=jobStatus,proto3,enum=JobStatusEnum" json:"jobStatus,omitempty"`
	Started   *timestamppb.Timestamp `protobuf:"bytes,3,opt,name=started,proto3" json:"started,omitempty"`
	Updated   *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=updated,proto3" json:"updated,omitempty"`
	// contains filtered or unexported fields
}

func (*JobStatusResponse) Descriptor deprecated

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

Deprecated: Use JobStatusResponse.ProtoReflect.Descriptor instead.

func (*JobStatusResponse) GetJobID

func (x *JobStatusResponse) GetJobID() string

func (*JobStatusResponse) GetJobStatus

func (x *JobStatusResponse) GetJobStatus() JobStatusEnum

func (*JobStatusResponse) GetStarted

func (x *JobStatusResponse) GetStarted() *timestamppb.Timestamp

func (*JobStatusResponse) GetUpdated

func (x *JobStatusResponse) GetUpdated() *timestamppb.Timestamp

func (*JobStatusResponse) ProtoMessage

func (*JobStatusResponse) ProtoMessage()

func (*JobStatusResponse) ProtoReflect

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

func (*JobStatusResponse) Reset

func (x *JobStatusResponse) Reset()

func (*JobStatusResponse) String

func (x *JobStatusResponse) String() string

type StartJobRequest

type StartJobRequest struct {
	Job             *JobAuth   `protobuf:"bytes,1,opt,name=job,proto3" json:"job,omitempty"`
	Config          *JobConfig `protobuf:"bytes,2,opt,name=config,proto3" json:"config,omitempty"`
	JobConfigString string     `protobuf:"bytes,3,opt,name=jobConfigString,proto3" json:"jobConfigString,omitempty"`
	// contains filtered or unexported fields
}

func (*StartJobRequest) Descriptor deprecated

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

Deprecated: Use StartJobRequest.ProtoReflect.Descriptor instead.

func (*StartJobRequest) GetConfig

func (x *StartJobRequest) GetConfig() *JobConfig

func (*StartJobRequest) GetJob

func (x *StartJobRequest) GetJob() *JobAuth

func (*StartJobRequest) GetJobConfigString

func (x *StartJobRequest) GetJobConfigString() string

func (*StartJobRequest) ProtoMessage

func (*StartJobRequest) ProtoMessage()

func (*StartJobRequest) ProtoReflect

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

func (*StartJobRequest) Reset

func (x *StartJobRequest) Reset()

func (*StartJobRequest) String

func (x *StartJobRequest) String() string

type UnimplementedBaktaJobsServer

type UnimplementedBaktaJobsServer struct {
}

UnimplementedBaktaJobsServer must be embedded to have forward compatible implementations.

func (UnimplementedBaktaJobsServer) GetJobResult

func (UnimplementedBaktaJobsServer) GetJobsStatus

func (UnimplementedBaktaJobsServer) InitJob

func (UnimplementedBaktaJobsServer) StartJob

func (UnimplementedBaktaJobsServer) Version

type UnimplementedBaktaStatusUpdateServer

type UnimplementedBaktaStatusUpdateServer struct {
}

UnimplementedBaktaStatusUpdateServer must be embedded to have forward compatible implementations.

func (UnimplementedBaktaStatusUpdateServer) UpdateStatus

type UnsafeBaktaJobsServer

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

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

type UnsafeBaktaStatusUpdateServer

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

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

type UpdateStatusRequest

type UpdateStatusRequest struct {
	JobID string `protobuf:"bytes,1,opt,name=jobID,proto3" json:"jobID,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateStatusRequest) Descriptor deprecated

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

Deprecated: Use UpdateStatusRequest.ProtoReflect.Descriptor instead.

func (*UpdateStatusRequest) GetJobID

func (x *UpdateStatusRequest) GetJobID() string

func (*UpdateStatusRequest) ProtoMessage

func (*UpdateStatusRequest) ProtoMessage()

func (*UpdateStatusRequest) ProtoReflect

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

func (*UpdateStatusRequest) Reset

func (x *UpdateStatusRequest) Reset()

func (*UpdateStatusRequest) String

func (x *UpdateStatusRequest) String() string

type VersionResponse

type VersionResponse struct {
	ToolVersion    string `protobuf:"bytes,1,opt,name=toolVersion,proto3" json:"toolVersion,omitempty"`
	DbVersion      string `protobuf:"bytes,2,opt,name=dbVersion,proto3" json:"dbVersion,omitempty"`
	BackendVersion string `protobuf:"bytes,3,opt,name=backendVersion,proto3" json:"backendVersion,omitempty"`
	// contains filtered or unexported fields
}

func (*VersionResponse) Descriptor deprecated

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

Deprecated: Use VersionResponse.ProtoReflect.Descriptor instead.

func (*VersionResponse) GetBackendVersion

func (x *VersionResponse) GetBackendVersion() string

func (*VersionResponse) GetDbVersion

func (x *VersionResponse) GetDbVersion() string

func (*VersionResponse) GetToolVersion

func (x *VersionResponse) GetToolVersion() string

func (*VersionResponse) ProtoMessage

func (*VersionResponse) ProtoMessage()

func (*VersionResponse) ProtoReflect

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

func (*VersionResponse) Reset

func (x *VersionResponse) Reset()

func (*VersionResponse) String

func (x *VersionResponse) String() string

Jump to

Keyboard shortcuts

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