api_pastebin

package
v0.0.0-...-a33e2ab Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package api_pastebin is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_pastebin_proto protoreflect.FileDescriptor

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.Server, 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://godoc.org/google.golang.org/grpc#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.

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 can be embedded to have forward compatible implementations.

func (*UnimplementedPastebinServer) PastebinSubmit

Jump to

Keyboard shortcuts

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