api_pastebin

package
v0.0.0-...-3bc93d9 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 17 Imported by: 3

Documentation

Overview

Package api_pastebin is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Pastebin_PastebinSubmit_FullMethodName = "/Pastebin/PastebinSubmit"
)

Variables

View Source
var File_pastebin_proto protoreflect.FileDescriptor
View Source
var Pastebin_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "Pastebin",
	HandlerType: (*PastebinServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PastebinSubmit",
			Handler:    _Pastebin_PastebinSubmit_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pastebin.proto",
}

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

Functions

func RegisterPastebinHandler

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

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

func RegisterPastebinHandlerClient

func RegisterPastebinHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PastebinClient) error

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

func RegisterPastebinHandlerFromEndpoint

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

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

func RegisterPastebinHandlerServer

func RegisterPastebinHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PastebinServer) error

RegisterPastebinHandlerServer registers the http handlers for service Pastebin to "mux". UnaryRPC :call PastebinServer 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 RegisterPastebinHandlerFromEndpoint instead.

func RegisterPastebinServer

func RegisterPastebinServer(s grpc.ServiceRegistrar, srv PastebinServer)

Types

type PastebinClient

type PastebinClient interface {
	PastebinSubmit(ctx context.Context, in *PastebinSubmitReq, opts ...grpc.CallOption) (*PastebinSubmitResp, error)
}

PastebinClient is the client API for Pastebin 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 NewPastebinClient

func NewPastebinClient(cc grpc.ClientConnInterface) PastebinClient

type PastebinServer

type PastebinServer interface {
	PastebinSubmit(context.Context, *PastebinSubmitReq) (*PastebinSubmitResp, error)
}

PastebinServer is the server API for Pastebin service. All implementations should embed UnimplementedPastebinServer for forward compatibility

type PastebinSubmitReq

type PastebinSubmitReq struct {
	Author string `protobuf:"bytes,1,opt,name=author,proto3" json:"author,omitempty"`
	Syntax string `protobuf:"bytes,2,opt,name=syntax,proto3" json:"syntax,omitempty"`
	Text   string `protobuf:"bytes,3,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*PastebinSubmitReq) Descriptor deprecated

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

Deprecated: Use PastebinSubmitReq.ProtoReflect.Descriptor instead.

func (*PastebinSubmitReq) GetAuthor

func (x *PastebinSubmitReq) GetAuthor() string

func (*PastebinSubmitReq) GetSyntax

func (x *PastebinSubmitReq) GetSyntax() string

func (*PastebinSubmitReq) GetText

func (x *PastebinSubmitReq) GetText() string

func (*PastebinSubmitReq) ProtoMessage

func (*PastebinSubmitReq) ProtoMessage()

func (*PastebinSubmitReq) ProtoReflect

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

func (*PastebinSubmitReq) Reset

func (x *PastebinSubmitReq) Reset()

func (*PastebinSubmitReq) String

func (x *PastebinSubmitReq) String() string

type PastebinSubmitResObj

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

PastebinSubmit

func (*PastebinSubmitResObj) Descriptor deprecated

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

Deprecated: Use PastebinSubmitResObj.ProtoReflect.Descriptor instead.

func (*PastebinSubmitResObj) GetPurl

func (x *PastebinSubmitResObj) GetPurl() string

func (*PastebinSubmitResObj) ProtoMessage

func (*PastebinSubmitResObj) ProtoMessage()

func (*PastebinSubmitResObj) ProtoReflect

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

func (*PastebinSubmitResObj) Reset

func (x *PastebinSubmitResObj) Reset()

func (*PastebinSubmitResObj) String

func (x *PastebinSubmitResObj) String() string

type PastebinSubmitResp

type PastebinSubmitResp struct {
	Code int64                 `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Msg  string                `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Data *PastebinSubmitResObj `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*PastebinSubmitResp) Descriptor deprecated

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

Deprecated: Use PastebinSubmitResp.ProtoReflect.Descriptor instead.

func (*PastebinSubmitResp) GetCode

func (x *PastebinSubmitResp) GetCode() int64

func (*PastebinSubmitResp) GetData

func (*PastebinSubmitResp) GetMsg

func (x *PastebinSubmitResp) GetMsg() string

func (*PastebinSubmitResp) ProtoMessage

func (*PastebinSubmitResp) ProtoMessage()

func (*PastebinSubmitResp) ProtoReflect

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

func (*PastebinSubmitResp) Reset

func (x *PastebinSubmitResp) Reset()

func (*PastebinSubmitResp) String

func (x *PastebinSubmitResp) String() string

type UnimplementedPastebinServer

type UnimplementedPastebinServer struct {
}

UnimplementedPastebinServer should be embedded to have forward compatible implementations.

func (UnimplementedPastebinServer) PastebinSubmit

type UnsafePastebinServer

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

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

Jump to

Keyboard shortcuts

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