processor

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2023 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Pdf_Method_name = map[int32]string{
		0: "AUTO",
		1: "EXTRACT",
		2: "RASTERIZE",
		4: "EXPLICIT",
	}
	Pdf_Method_value = map[string]int32{
		"AUTO":      0,
		"EXTRACT":   1,
		"RASTERIZE": 2,
		"EXPLICIT":  4,
	}
)

Enum value maps for Pdf_Method.

View Source
var File_processor_proto protoreflect.FileDescriptor
View Source
var PdfProcessor_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "processor.PdfProcessor",
	HandlerType: (*PdfProcessorServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "RotateImage",
			Handler:    _PdfProcessor_RotateImage_Handler,
		},
		{
			MethodName: "CreatePdf",
			Handler:    _PdfProcessor_CreatePdf_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ConvertPdfToImage",
			Handler:       _PdfProcessor_ConvertPdfToImage_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "processor.proto",
}

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

Functions

func RegisterPdfProcessorServer

func RegisterPdfProcessorServer(s grpc.ServiceRegistrar, srv PdfProcessorServer)

Types

type Document

type Document struct {
	Title     string      `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Documents []*Document `protobuf:"bytes,2,rep,name=documents,proto3" json:"documents,omitempty"`
	Pages     []*Image    `protobuf:"bytes,3,rep,name=pages,proto3" json:"pages,omitempty"`
	// contains filtered or unexported fields
}

func (*Document) Descriptor deprecated

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

Deprecated: Use Document.ProtoReflect.Descriptor instead.

func (*Document) GetDocuments

func (x *Document) GetDocuments() []*Document

func (*Document) GetPages

func (x *Document) GetPages() []*Image

func (*Document) GetTitle

func (x *Document) GetTitle() string

func (*Document) ProtoMessage

func (*Document) ProtoMessage()

func (*Document) ProtoReflect

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

func (*Document) Reset

func (x *Document) Reset()

func (*Document) String

func (x *Document) String() string

type Image

type Image struct {
	Format  string `protobuf:"bytes,1,opt,name=format,proto3" json:"format,omitempty"`
	Content []byte `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*Image) Descriptor deprecated

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

Deprecated: Use Image.ProtoReflect.Descriptor instead.

func (*Image) GetContent

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

func (*Image) GetFormat

func (x *Image) GetFormat() string

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 Pdf

type Pdf struct {
	Content     []byte     `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
	Method      Pdf_Method `protobuf:"varint,2,opt,name=method,proto3,enum=processor.Pdf_Method" json:"method,omitempty"`
	MethodName  string     `protobuf:"bytes,3,opt,name=method_name,json=methodName,proto3" json:"method_name,omitempty"`            // Method name when EXPLICIT is selected.
	PageNumbers []uint32   `protobuf:"varint,4,rep,packed,name=page_numbers,json=pageNumbers,proto3" json:"page_numbers,omitempty"` // Page numbers which should be processed
	// contains filtered or unexported fields
}

func (*Pdf) Descriptor deprecated

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

Deprecated: Use Pdf.ProtoReflect.Descriptor instead.

func (*Pdf) GetContent

func (x *Pdf) GetContent() []byte

func (*Pdf) GetMethod

func (x *Pdf) GetMethod() Pdf_Method

func (*Pdf) GetMethodName

func (x *Pdf) GetMethodName() string

func (*Pdf) GetPageNumbers

func (x *Pdf) GetPageNumbers() []uint32

func (*Pdf) ProtoMessage

func (*Pdf) ProtoMessage()

func (*Pdf) ProtoReflect

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

func (*Pdf) Reset

func (x *Pdf) Reset()

func (*Pdf) String

func (x *Pdf) String() string

type PdfProcessorClient

type PdfProcessorClient interface {
	// Convert the pages of a PDF file to images.
	//
	// Convert the pages of a PDF file to images.
	ConvertPdfToImage(ctx context.Context, in *Pdf, opts ...grpc.CallOption) (PdfProcessor_ConvertPdfToImageClient, error)
	RotateImage(ctx context.Context, in *Rotate, opts ...grpc.CallOption) (*Image, error)
	CreatePdf(ctx context.Context, in *Document, opts ...grpc.CallOption) (*Pdf, error)
}

PdfProcessorClient is the client API for PdfProcessor 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 PdfProcessorServer

type PdfProcessorServer interface {
	// Convert the pages of a PDF file to images.
	//
	// Convert the pages of a PDF file to images.
	ConvertPdfToImage(*Pdf, PdfProcessor_ConvertPdfToImageServer) error
	RotateImage(context.Context, *Rotate) (*Image, error)
	CreatePdf(context.Context, *Document) (*Pdf, error)
	// contains filtered or unexported methods
}

PdfProcessorServer is the server API for PdfProcessor service. All implementations must embed UnimplementedPdfProcessorServer for forward compatibility

type PdfProcessor_ConvertPdfToImageClient

type PdfProcessor_ConvertPdfToImageClient interface {
	Recv() (*Image, error)
	grpc.ClientStream
}

type PdfProcessor_ConvertPdfToImageServer

type PdfProcessor_ConvertPdfToImageServer interface {
	Send(*Image) error
	grpc.ServerStream
}

type Pdf_Method

type Pdf_Method int32
const (
	Pdf_AUTO      Pdf_Method = 0
	Pdf_EXTRACT   Pdf_Method = 1
	Pdf_RASTERIZE Pdf_Method = 2
	Pdf_EXPLICIT  Pdf_Method = 4
)

func (Pdf_Method) Descriptor

func (Pdf_Method) Descriptor() protoreflect.EnumDescriptor

func (Pdf_Method) Enum

func (x Pdf_Method) Enum() *Pdf_Method

func (Pdf_Method) EnumDescriptor deprecated

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

Deprecated: Use Pdf_Method.Descriptor instead.

func (Pdf_Method) Number

func (x Pdf_Method) Number() protoreflect.EnumNumber

func (Pdf_Method) String

func (x Pdf_Method) String() string

func (Pdf_Method) Type

type Rotate

type Rotate struct {
	Content []byte  `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
	Degree  float64 `protobuf:"fixed64,2,opt,name=degree,proto3" json:"degree,omitempty"`
	// contains filtered or unexported fields
}

func (*Rotate) Descriptor deprecated

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

Deprecated: Use Rotate.ProtoReflect.Descriptor instead.

func (*Rotate) GetContent

func (x *Rotate) GetContent() []byte

func (*Rotate) GetDegree

func (x *Rotate) GetDegree() float64

func (*Rotate) ProtoMessage

func (*Rotate) ProtoMessage()

func (*Rotate) ProtoReflect

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

func (*Rotate) Reset

func (x *Rotate) Reset()

func (*Rotate) String

func (x *Rotate) String() string

type UnimplementedPdfProcessorServer

type UnimplementedPdfProcessorServer struct {
}

UnimplementedPdfProcessorServer must be embedded to have forward compatible implementations.

func (UnimplementedPdfProcessorServer) ConvertPdfToImage

func (UnimplementedPdfProcessorServer) CreatePdf

func (UnimplementedPdfProcessorServer) RotateImage

type UnsafePdfProcessorServer

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

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

Jump to

Keyboard shortcuts

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