papi

package
v0.0.0-...-f3e7bff Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package papi is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_project_proto protoreflect.FileDescriptor
View Source
var Project_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "papi.Project",
	HandlerType: (*ProjectServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateProject",
			Handler:    _Project_CreateProject_Handler,
		},
		{
			MethodName: "GetProject",
			Handler:    _Project_GetProject_Handler,
		},
		{
			MethodName: "ListProject",
			Handler:    _Project_ListProject_Handler,
		},
		{
			MethodName: "RemoveProject",
			Handler:    _Project_RemoveProject_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "project.proto",
}

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

Functions

func RegisterProjectHandler

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

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

func RegisterProjectHandlerClient

func RegisterProjectHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProjectClient) error

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

func RegisterProjectHandlerFromEndpoint

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

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

func RegisterProjectHandlerServer

func RegisterProjectHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProjectServer) error

RegisterProjectHandlerServer registers the http handlers for service Project to "mux". UnaryRPC :call ProjectServer 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 RegisterProjectHandlerFromEndpoint instead.

func RegisterProjectServer

func RegisterProjectServer(s grpc.ServiceRegistrar, srv ProjectServer)

Types

type CreateProjectReply

type CreateProjectReply struct {
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateProjectReply) Descriptor deprecated

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

Deprecated: Use CreateProjectReply.ProtoReflect.Descriptor instead.

func (*CreateProjectReply) GetId

func (x *CreateProjectReply) GetId() uint32

func (*CreateProjectReply) ProtoMessage

func (*CreateProjectReply) ProtoMessage()

func (*CreateProjectReply) ProtoReflect

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

func (*CreateProjectReply) Reset

func (x *CreateProjectReply) Reset()

func (*CreateProjectReply) String

func (x *CreateProjectReply) String() string

type CreateProjectRequest

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

func (*CreateProjectRequest) Descriptor deprecated

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

Deprecated: Use CreateProjectRequest.ProtoReflect.Descriptor instead.

func (*CreateProjectRequest) GetName

func (x *CreateProjectRequest) GetName() string

func (*CreateProjectRequest) GetTitle

func (x *CreateProjectRequest) GetTitle() string

func (*CreateProjectRequest) ProtoMessage

func (*CreateProjectRequest) ProtoMessage()

func (*CreateProjectRequest) ProtoReflect

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

func (*CreateProjectRequest) Reset

func (x *CreateProjectRequest) Reset()

func (*CreateProjectRequest) String

func (x *CreateProjectRequest) String() string

type GetProjectReply

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

func (*GetProjectReply) Descriptor deprecated

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

Deprecated: Use GetProjectReply.ProtoReflect.Descriptor instead.

func (*GetProjectReply) GetMessage

func (x *GetProjectReply) GetMessage() string

func (*GetProjectReply) ProtoMessage

func (*GetProjectReply) ProtoMessage()

func (*GetProjectReply) ProtoReflect

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

func (*GetProjectReply) Reset

func (x *GetProjectReply) Reset()

func (*GetProjectReply) String

func (x *GetProjectReply) String() string

type GetProjectRequest

type GetProjectRequest struct {
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetProjectRequest) Descriptor deprecated

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

Deprecated: Use GetProjectRequest.ProtoReflect.Descriptor instead.

func (*GetProjectRequest) GetId

func (x *GetProjectRequest) GetId() uint32

func (*GetProjectRequest) ProtoMessage

func (*GetProjectRequest) ProtoMessage()

func (*GetProjectRequest) ProtoReflect

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

func (*GetProjectRequest) Reset

func (x *GetProjectRequest) Reset()

func (*GetProjectRequest) String

func (x *GetProjectRequest) String() string

type ListProjectReply

type ListProjectReply struct {
	Projects []*ProjectItem `protobuf:"bytes,1,rep,name=projects,proto3" json:"projects,omitempty"`
	// contains filtered or unexported fields
}

func (*ListProjectReply) Descriptor deprecated

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

Deprecated: Use ListProjectReply.ProtoReflect.Descriptor instead.

func (*ListProjectReply) GetProjects

func (x *ListProjectReply) GetProjects() []*ProjectItem

func (*ListProjectReply) ProtoMessage

func (*ListProjectReply) ProtoMessage()

func (*ListProjectReply) ProtoReflect

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

func (*ListProjectReply) Reset

func (x *ListProjectReply) Reset()

func (*ListProjectReply) String

func (x *ListProjectReply) String() string

type ListProjectRequest

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

func (*ListProjectRequest) Descriptor deprecated

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

Deprecated: Use ListProjectRequest.ProtoReflect.Descriptor instead.

func (*ListProjectRequest) ProtoMessage

func (*ListProjectRequest) ProtoMessage()

func (*ListProjectRequest) ProtoReflect

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

func (*ListProjectRequest) Reset

func (x *ListProjectRequest) Reset()

func (*ListProjectRequest) String

func (x *ListProjectRequest) String() string

type ProjectClient

type ProjectClient interface {
	CreateProject(ctx context.Context, in *CreateProjectRequest, opts ...grpc.CallOption) (*CreateProjectReply, error)
	GetProject(ctx context.Context, in *GetProjectRequest, opts ...grpc.CallOption) (*GetProjectReply, error)
	ListProject(ctx context.Context, in *ListProjectRequest, opts ...grpc.CallOption) (*ListProjectReply, error)
	RemoveProject(ctx context.Context, in *RemoveProjectRequest, opts ...grpc.CallOption) (*RemoveProjectReply, error)
}

ProjectClient is the client API for Project 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 NewProjectClient

func NewProjectClient(cc grpc.ClientConnInterface) ProjectClient

type ProjectItem

type ProjectItem struct {
	Id    uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name  string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Title string `protobuf:"bytes,3,opt,name=title,proto3" json:"title,omitempty"`
	// contains filtered or unexported fields
}

func (*ProjectItem) Descriptor deprecated

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

Deprecated: Use ProjectItem.ProtoReflect.Descriptor instead.

func (*ProjectItem) GetId

func (x *ProjectItem) GetId() uint32

func (*ProjectItem) GetName

func (x *ProjectItem) GetName() string

func (*ProjectItem) GetTitle

func (x *ProjectItem) GetTitle() string

func (*ProjectItem) ProtoMessage

func (*ProjectItem) ProtoMessage()

func (*ProjectItem) ProtoReflect

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

func (*ProjectItem) Reset

func (x *ProjectItem) Reset()

func (*ProjectItem) String

func (x *ProjectItem) String() string

type ProjectServer

type ProjectServer interface {
	CreateProject(context.Context, *CreateProjectRequest) (*CreateProjectReply, error)
	GetProject(context.Context, *GetProjectRequest) (*GetProjectReply, error)
	ListProject(context.Context, *ListProjectRequest) (*ListProjectReply, error)
	RemoveProject(context.Context, *RemoveProjectRequest) (*RemoveProjectReply, error)
	// contains filtered or unexported methods
}

ProjectServer is the server API for Project service. All implementations must embed UnimplementedProjectServer for forward compatibility

type RemoveProjectReply

type RemoveProjectReply struct {
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveProjectReply) Descriptor deprecated

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

Deprecated: Use RemoveProjectReply.ProtoReflect.Descriptor instead.

func (*RemoveProjectReply) GetId

func (x *RemoveProjectReply) GetId() uint32

func (*RemoveProjectReply) ProtoMessage

func (*RemoveProjectReply) ProtoMessage()

func (*RemoveProjectReply) ProtoReflect

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

func (*RemoveProjectReply) Reset

func (x *RemoveProjectReply) Reset()

func (*RemoveProjectReply) String

func (x *RemoveProjectReply) String() string

type RemoveProjectRequest

type RemoveProjectRequest struct {
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*RemoveProjectRequest) Descriptor deprecated

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

Deprecated: Use RemoveProjectRequest.ProtoReflect.Descriptor instead.

func (*RemoveProjectRequest) GetId

func (x *RemoveProjectRequest) GetId() uint32

func (*RemoveProjectRequest) ProtoMessage

func (*RemoveProjectRequest) ProtoMessage()

func (*RemoveProjectRequest) ProtoReflect

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

func (*RemoveProjectRequest) Reset

func (x *RemoveProjectRequest) Reset()

func (*RemoveProjectRequest) String

func (x *RemoveProjectRequest) String() string

type UnimplementedProjectServer

type UnimplementedProjectServer struct{}

UnimplementedProjectServer must be embedded to have forward compatible implementations.

func (UnimplementedProjectServer) CreateProject

func (UnimplementedProjectServer) GetProject

func (UnimplementedProjectServer) ListProject

func (UnimplementedProjectServer) RemoveProject

type UnsafeProjectServer

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

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

Jump to

Keyboard shortcuts

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