documentsv1

package
v0.0.0-...-925875b Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package documentsv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	DocumentsService_AddDocument_FullMethodName   = "/documents.v1.DocumentsService/AddDocument"
	DocumentsService_GetDocument_FullMethodName   = "/documents.v1.DocumentsService/GetDocument"
	DocumentsService_ListDocuments_FullMethodName = "/documents.v1.DocumentsService/ListDocuments"
	DocumentsService_GetFile_FullMethodName       = "/documents.v1.DocumentsService/GetFile"
)

Variables

View Source
var DocumentsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "documents.v1.DocumentsService",
	HandlerType: (*DocumentsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "AddDocument",
			Handler:    _DocumentsService_AddDocument_Handler,
		},
		{
			MethodName: "GetDocument",
			Handler:    _DocumentsService_GetDocument_Handler,
		},
		{
			MethodName: "GetFile",
			Handler:    _DocumentsService_GetFile_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ListDocuments",
			Handler:       _DocumentsService_ListDocuments_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "documents/v1/documents.proto",
}

DocumentsService_ServiceDesc is the grpc.ServiceDesc for DocumentsService 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_documents_v1_documents_proto protoreflect.FileDescriptor

Functions

func RegisterDocumentsServiceHandler

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

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

func RegisterDocumentsServiceHandlerClient

func RegisterDocumentsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client DocumentsServiceClient) error

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

func RegisterDocumentsServiceHandlerFromEndpoint

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

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

func RegisterDocumentsServiceHandlerServer

func RegisterDocumentsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server DocumentsServiceServer) error

RegisterDocumentsServiceHandlerServer registers the http handlers for service DocumentsService to "mux". UnaryRPC :call DocumentsServiceServer 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 RegisterDocumentsServiceHandlerFromEndpoint instead.

func RegisterDocumentsServiceServer

func RegisterDocumentsServiceServer(s grpc.ServiceRegistrar, srv DocumentsServiceServer)

Types

type AddDocumentRequest

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

func (*AddDocumentRequest) Descriptor deprecated

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

Deprecated: Use AddDocumentRequest.ProtoReflect.Descriptor instead.

func (*AddDocumentRequest) GetContent

func (x *AddDocumentRequest) GetContent() string

func (*AddDocumentRequest) ProtoMessage

func (*AddDocumentRequest) ProtoMessage()

func (*AddDocumentRequest) ProtoReflect

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

func (*AddDocumentRequest) Reset

func (x *AddDocumentRequest) Reset()

func (*AddDocumentRequest) String

func (x *AddDocumentRequest) String() string

type Document

type Document struct {
	Id      string  `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Content string  `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	Files   []*File `protobuf:"bytes,3,rep,name=files,proto3" json:"files,omitempty"`
	// contains filtered or unexported fields
}

func (*Document) Descriptor deprecated

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

Deprecated: Use Document.ProtoReflect.Descriptor instead.

func (*Document) GetContent

func (x *Document) GetContent() string

func (*Document) GetFiles

func (x *Document) GetFiles() []*File

func (*Document) GetId

func (x *Document) GetId() 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 DocumentsServiceClient

type DocumentsServiceClient interface {
	AddDocument(ctx context.Context, in *AddDocumentRequest, opts ...grpc.CallOption) (*Document, error)
	GetDocument(ctx context.Context, in *GetDocumentRequest, opts ...grpc.CallOption) (*Document, error)
	ListDocuments(ctx context.Context, in *ListDocumentsRequest, opts ...grpc.CallOption) (DocumentsService_ListDocumentsClient, error)
	GetFile(ctx context.Context, in *GetFileRequest, opts ...grpc.CallOption) (*File, error)
}

DocumentsServiceClient is the client API for DocumentsService 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 DocumentsServiceServer

type DocumentsServiceServer interface {
	AddDocument(context.Context, *AddDocumentRequest) (*Document, error)
	GetDocument(context.Context, *GetDocumentRequest) (*Document, error)
	ListDocuments(*ListDocumentsRequest, DocumentsService_ListDocumentsServer) error
	GetFile(context.Context, *GetFileRequest) (*File, error)
}

DocumentsServiceServer is the server API for DocumentsService service. All implementations should embed UnimplementedDocumentsServiceServer for forward compatibility

type DocumentsService_ListDocumentsClient

type DocumentsService_ListDocumentsClient interface {
	Recv() (*Document, error)
	grpc.ClientStream
}

type DocumentsService_ListDocumentsServer

type DocumentsService_ListDocumentsServer interface {
	Send(*Document) error
	grpc.ServerStream
}

type File

type File struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*File) Descriptor deprecated

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

Deprecated: Use File.ProtoReflect.Descriptor instead.

func (*File) GetContent

func (x *File) GetContent() string

func (*File) GetId

func (x *File) GetId() string

func (*File) ProtoMessage

func (*File) ProtoMessage()

func (*File) ProtoReflect

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

func (*File) Reset

func (x *File) Reset()

func (*File) String

func (x *File) String() string

type GetDocumentRequest

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

func (*GetDocumentRequest) Descriptor deprecated

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

Deprecated: Use GetDocumentRequest.ProtoReflect.Descriptor instead.

func (*GetDocumentRequest) GetDocumentId

func (x *GetDocumentRequest) GetDocumentId() string

func (*GetDocumentRequest) ProtoMessage

func (*GetDocumentRequest) ProtoMessage()

func (*GetDocumentRequest) ProtoReflect

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

func (*GetDocumentRequest) Reset

func (x *GetDocumentRequest) Reset()

func (*GetDocumentRequest) String

func (x *GetDocumentRequest) String() string

type GetFileRequest

type GetFileRequest struct {
	DocumentId string `protobuf:"bytes,1,opt,name=document_id,json=documentId,proto3" json:"document_id,omitempty"`
	FileId     string `protobuf:"bytes,2,opt,name=file_id,json=fileId,proto3" json:"file_id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetFileRequest) Descriptor deprecated

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

Deprecated: Use GetFileRequest.ProtoReflect.Descriptor instead.

func (*GetFileRequest) GetDocumentId

func (x *GetFileRequest) GetDocumentId() string

func (*GetFileRequest) GetFileId

func (x *GetFileRequest) GetFileId() string

func (*GetFileRequest) ProtoMessage

func (*GetFileRequest) ProtoMessage()

func (*GetFileRequest) ProtoReflect

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

func (*GetFileRequest) Reset

func (x *GetFileRequest) Reset()

func (*GetFileRequest) String

func (x *GetFileRequest) String() string

type ListDocumentsRequest

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

func (*ListDocumentsRequest) Descriptor deprecated

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

Deprecated: Use ListDocumentsRequest.ProtoReflect.Descriptor instead.

func (*ListDocumentsRequest) ProtoMessage

func (*ListDocumentsRequest) ProtoMessage()

func (*ListDocumentsRequest) ProtoReflect

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

func (*ListDocumentsRequest) Reset

func (x *ListDocumentsRequest) Reset()

func (*ListDocumentsRequest) String

func (x *ListDocumentsRequest) String() string

type UnimplementedDocumentsServiceServer

type UnimplementedDocumentsServiceServer struct {
}

UnimplementedDocumentsServiceServer should be embedded to have forward compatible implementations.

func (UnimplementedDocumentsServiceServer) AddDocument

func (UnimplementedDocumentsServiceServer) GetDocument

func (UnimplementedDocumentsServiceServer) GetFile

func (UnimplementedDocumentsServiceServer) ListDocuments

type UnsafeDocumentsServiceServer

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

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

Jump to

Keyboard shortcuts

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