svc

package
v0.0.0-...-7d51d8f Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package svc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	FontStyles_name = map[int32]string{
		0: "NORMAL",
		1: "ITALIC",
	}
	FontStyles_value = map[string]int32{
		"NORMAL": 0,
		"ITALIC": 1,
	}
)

Enum value maps for FontStyles.

View Source
var ConvGetImage_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "conv_get_img.ConvGetImage",
	HandlerType: (*ConvGetImageServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Convert",
			Handler:    _ConvGetImage_Convert_Handler,
		},
		{
			MethodName: "Image",
			Handler:    _ConvGetImage_Image_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "svc.proto",
}

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

Functions

func RegisterConvGetImageHandler

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

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

func RegisterConvGetImageHandlerClient

func RegisterConvGetImageHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ConvGetImageClient) error

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

func RegisterConvGetImageHandlerFromEndpoint

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

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

func RegisterConvGetImageHandlerServer

func RegisterConvGetImageHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ConvGetImageServer) error

RegisterConvGetImageHandlerServer registers the http handlers for service ConvGetImage to "mux". UnaryRPC :call ConvGetImageServer 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 RegisterConvGetImageHandlerFromEndpoint instead.

func RegisterConvGetImageServer

func RegisterConvGetImageServer(s grpc.ServiceRegistrar, srv ConvGetImageServer)

Types

type ConvGetImageClient

type ConvGetImageClient interface {
	Convert(ctx context.Context, in *ConvertRequest, opts ...grpc.CallOption) (*ConvertResponse, error)
	Image(ctx context.Context, in *ImageRequest, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
}

ConvGetImageClient is the client API for ConvGetImage 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 ConvGetImageServer

type ConvGetImageServer interface {
	Convert(context.Context, *ConvertRequest) (*ConvertResponse, error)
	Image(context.Context, *ImageRequest) (*httpbody.HttpBody, error)
	// contains filtered or unexported methods
}

ConvGetImageServer is the server API for ConvGetImage service. All implementations must embed UnimplementedConvGetImageServer for forward compatibility

type ConvertRequest

type ConvertRequest struct {
	InputText string     `protobuf:"bytes,1,opt,name=input_text,proto3" json:"input_text,omitempty"`
	FontSize  int32      `protobuf:"varint,2,opt,name=font_size,proto3" json:"font_size,omitempty"`
	FontFile  string     `protobuf:"bytes,3,opt,name=font_file,proto3" json:"font_file,omitempty"`
	FontStyle FontStyles `protobuf:"varint,4,opt,name=font_style,proto3,enum=conv_get_img.FontStyles" json:"font_style,omitempty"`
	// contains filtered or unexported fields
}

func (*ConvertRequest) Descriptor deprecated

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

Deprecated: Use ConvertRequest.ProtoReflect.Descriptor instead.

func (*ConvertRequest) GetFontFile

func (x *ConvertRequest) GetFontFile() string

func (*ConvertRequest) GetFontSize

func (x *ConvertRequest) GetFontSize() int32

func (*ConvertRequest) GetFontStyle

func (x *ConvertRequest) GetFontStyle() FontStyles

func (*ConvertRequest) GetInputText

func (x *ConvertRequest) GetInputText() string

func (*ConvertRequest) ProtoMessage

func (*ConvertRequest) ProtoMessage()

func (*ConvertRequest) ProtoReflect

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

func (*ConvertRequest) Reset

func (x *ConvertRequest) Reset()

func (*ConvertRequest) String

func (x *ConvertRequest) String() string

type ConvertResponse

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

func (*ConvertResponse) Descriptor deprecated

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

Deprecated: Use ConvertResponse.ProtoReflect.Descriptor instead.

func (*ConvertResponse) GetConvId

func (x *ConvertResponse) GetConvId() string

func (*ConvertResponse) ProtoMessage

func (*ConvertResponse) ProtoMessage()

func (*ConvertResponse) ProtoReflect

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

func (*ConvertResponse) Reset

func (x *ConvertResponse) Reset()

func (*ConvertResponse) String

func (x *ConvertResponse) String() string

type FontStyles

type FontStyles int32
const (
	FontStyles_NORMAL FontStyles = 0
	FontStyles_ITALIC FontStyles = 1
)

func (FontStyles) Descriptor

func (FontStyles) Descriptor() protoreflect.EnumDescriptor

func (FontStyles) Enum

func (x FontStyles) Enum() *FontStyles

func (FontStyles) EnumDescriptor deprecated

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

Deprecated: Use FontStyles.Descriptor instead.

func (FontStyles) Number

func (x FontStyles) Number() protoreflect.EnumNumber

func (FontStyles) String

func (x FontStyles) String() string

func (FontStyles) Type

type ImageRequest

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

func (*ImageRequest) Descriptor deprecated

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

Deprecated: Use ImageRequest.ProtoReflect.Descriptor instead.

func (*ImageRequest) GetConvId

func (x *ImageRequest) GetConvId() string

func (*ImageRequest) ProtoMessage

func (*ImageRequest) ProtoMessage()

func (*ImageRequest) ProtoReflect

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

func (*ImageRequest) Reset

func (x *ImageRequest) Reset()

func (*ImageRequest) String

func (x *ImageRequest) String() string

type UnimplementedConvGetImageServer

type UnimplementedConvGetImageServer struct {
}

UnimplementedConvGetImageServer must be embedded to have forward compatible implementations.

func (UnimplementedConvGetImageServer) Convert

func (UnimplementedConvGetImageServer) Image

type UnsafeConvGetImageServer

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

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

Jump to

Keyboard shortcuts

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