to_jpg_worker

package
v0.0.0-...-08d9cd0 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2023 License: Apache-2.0 Imports: 16 Imported by: 3

Documentation

Overview

Package to_jpg_worker is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "NOT_DEFINED",
		1: "SUCCESS",
		2: "FAILURE",
	}
	Status_value = map[string]int32{
		"NOT_DEFINED": 0,
		"SUCCESS":     1,
		"FAILURE":     2,
	}
)

Enum value maps for Status.

View Source
var File_to_jpg_service_tojpg_proto protoreflect.FileDescriptor
View Source
var ToJpgService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.ToJpgService",
	HandlerType: (*ToJpgServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PngToJpg",
			Handler:    _ToJpgService_PngToJpg_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "to-jpg-service/tojpg.proto",
}

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

Functions

func RegisterToJpgServiceHandler

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

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

func RegisterToJpgServiceHandlerClient

func RegisterToJpgServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ToJpgServiceClient) error

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

func RegisterToJpgServiceHandlerFromEndpoint

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

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

func RegisterToJpgServiceHandlerServer

func RegisterToJpgServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ToJpgServiceServer) error

RegisterToJpgServiceHandlerServer registers the http handlers for service ToJpgService to "mux". UnaryRPC :call ToJpgServiceServer 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 RegisterToJpgServiceHandlerFromEndpoint instead.

func RegisterToJpgServiceServer

func RegisterToJpgServiceServer(s grpc.ServiceRegistrar, srv ToJpgServiceServer)

Types

type Image

type Image struct {
	Metadata *ImageMetadata `protobuf:"bytes,1,opt,name=metadata,proto3" json:"metadata,omitempty"`
	Data     []byte         `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*Image) Descriptor deprecated

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

Deprecated: Use Image.ProtoReflect.Descriptor instead.

func (*Image) GetData

func (x *Image) GetData() []byte

func (*Image) GetMetadata

func (x *Image) GetMetadata() *ImageMetadata

func (*Image) ProtoMessage

func (*Image) ProtoMessage()

func (*Image) ProtoReflect

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

func (*Image) Reset

func (x *Image) Reset()

func (*Image) String

func (x *Image) String() string

type ImageMetadata

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

func (*ImageMetadata) Descriptor deprecated

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

Deprecated: Use ImageMetadata.ProtoReflect.Descriptor instead.

func (*ImageMetadata) GetName

func (x *ImageMetadata) GetName() string

func (*ImageMetadata) ProtoMessage

func (*ImageMetadata) ProtoMessage()

func (*ImageMetadata) ProtoReflect

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

func (*ImageMetadata) Reset

func (x *ImageMetadata) Reset()

func (*ImageMetadata) String

func (x *ImageMetadata) String() string

type PngToJpgReq

type PngToJpgReq struct {
	ImageUrl string `protobuf:"bytes,1,opt,name=image_url,json=imageUrl,proto3" json:"image_url,omitempty"`
	Image    *Image `protobuf:"bytes,2,opt,name=image,proto3" json:"image,omitempty"`
	// contains filtered or unexported fields
}

func (*PngToJpgReq) Descriptor deprecated

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

Deprecated: Use PngToJpgReq.ProtoReflect.Descriptor instead.

func (*PngToJpgReq) GetImage

func (x *PngToJpgReq) GetImage() *Image

func (*PngToJpgReq) GetImageUrl

func (x *PngToJpgReq) GetImageUrl() string

func (*PngToJpgReq) ProtoMessage

func (*PngToJpgReq) ProtoMessage()

func (*PngToJpgReq) ProtoReflect

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

func (*PngToJpgReq) Reset

func (x *PngToJpgReq) Reset()

func (*PngToJpgReq) String

func (x *PngToJpgReq) String() string

type PngToJpgResp

type PngToJpgResp struct {
	Status            *ResponseStatus `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"`
	ConvertedImageUrl string          `protobuf:"bytes,2,opt,name=ConvertedImageUrl,proto3" json:"ConvertedImageUrl,omitempty"`
	ConvertedImage    *Image          `protobuf:"bytes,3,opt,name=converted_image,json=convertedImage,proto3" json:"converted_image,omitempty"`
	// contains filtered or unexported fields
}

func (*PngToJpgResp) Descriptor deprecated

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

Deprecated: Use PngToJpgResp.ProtoReflect.Descriptor instead.

func (*PngToJpgResp) GetConvertedImage

func (x *PngToJpgResp) GetConvertedImage() *Image

func (*PngToJpgResp) GetConvertedImageUrl

func (x *PngToJpgResp) GetConvertedImageUrl() string

func (*PngToJpgResp) GetStatus

func (x *PngToJpgResp) GetStatus() *ResponseStatus

func (*PngToJpgResp) ProtoMessage

func (*PngToJpgResp) ProtoMessage()

func (*PngToJpgResp) ProtoReflect

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

func (*PngToJpgResp) Reset

func (x *PngToJpgResp) Reset()

func (*PngToJpgResp) String

func (x *PngToJpgResp) String() string

type ResponseStatus

type ResponseStatus struct {
	Status      Status `protobuf:"varint,1,opt,name=status,proto3,enum=proto.Status" json:"status,omitempty"`
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// contains filtered or unexported fields
}

func (*ResponseStatus) Descriptor deprecated

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

Deprecated: Use ResponseStatus.ProtoReflect.Descriptor instead.

func (*ResponseStatus) GetDescription

func (x *ResponseStatus) GetDescription() string

func (*ResponseStatus) GetStatus

func (x *ResponseStatus) GetStatus() Status

func (*ResponseStatus) ProtoMessage

func (*ResponseStatus) ProtoMessage()

func (*ResponseStatus) ProtoReflect

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

func (*ResponseStatus) Reset

func (x *ResponseStatus) Reset()

func (*ResponseStatus) String

func (x *ResponseStatus) String() string

type Status

type Status int32
const (
	Status_NOT_DEFINED Status = 0
	Status_SUCCESS     Status = 1
	Status_FAILURE     Status = 2
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

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

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type ToJpgServiceClient

type ToJpgServiceClient interface {
	PngToJpg(ctx context.Context, in *PngToJpgReq, opts ...grpc.CallOption) (*PngToJpgResp, error)
}

ToJpgServiceClient is the client API for ToJpgService 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 ToJpgServiceServer

type ToJpgServiceServer interface {
	PngToJpg(context.Context, *PngToJpgReq) (*PngToJpgResp, error)
	// contains filtered or unexported methods
}

ToJpgServiceServer is the server API for ToJpgService service. All implementations must embed UnimplementedToJpgServiceServer for forward compatibility

type UnimplementedToJpgServiceServer

type UnimplementedToJpgServiceServer struct {
}

UnimplementedToJpgServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedToJpgServiceServer) PngToJpg

type UnsafeToJpgServiceServer

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

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

Jump to

Keyboard shortcuts

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