proto

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 17 Imported by: 0

README

/usr/local/bin/protoc -I =./ --go_out=plugins=grpc:./ --go_opt=paths=source_relative ./*.proto --grpc-gateway_out=logtostderr=true:. --proto_path=/Users/johnsiilver/trees/webgear/wasm/examples/snippets/grpc/

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_snippets_proto protoreflect.FileDescriptor

Functions

func RegisterSnippetsHandler

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

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

func RegisterSnippetsHandlerClient

func RegisterSnippetsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SnippetsClient) error

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

func RegisterSnippetsHandlerFromEndpoint

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

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

func RegisterSnippetsHandlerServer

func RegisterSnippetsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SnippetsServer) error

RegisterSnippetsHandlerServer registers the http handlers for service Snippets to "mux". UnaryRPC :call SnippetsServer 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 RegisterSnippetsHandlerFromEndpoint instead.

func RegisterSnippetsServer

func RegisterSnippetsServer(s *grpc.Server, srv SnippetsServer)

Types

type GetReq

type GetReq struct {
	UnixNano int64 `protobuf:"varint,1,opt,name=unixNano,proto3" json:"unixNano,omitempty"`
	// contains filtered or unexported fields
}

func (*GetReq) Descriptor deprecated

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

Deprecated: Use GetReq.ProtoReflect.Descriptor instead.

func (*GetReq) GetUnixNano

func (x *GetReq) GetUnixNano() int64

func (*GetReq) ProtoMessage

func (*GetReq) ProtoMessage()

func (*GetReq) ProtoReflect

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

func (*GetReq) Reset

func (x *GetReq) Reset()

func (*GetReq) String

func (x *GetReq) String() string

type GetResp

type GetResp struct {
	UnixNano int64  `protobuf:"varint,1,opt,name=unixNano,proto3" json:"unixNano,omitempty"`
	Content  string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResp) Descriptor deprecated

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

Deprecated: Use GetResp.ProtoReflect.Descriptor instead.

func (*GetResp) GetContent

func (x *GetResp) GetContent() string

func (*GetResp) GetUnixNano

func (x *GetResp) GetUnixNano() int64

func (*GetResp) ProtoMessage

func (*GetResp) ProtoMessage()

func (*GetResp) ProtoReflect

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

func (*GetResp) Reset

func (x *GetResp) Reset()

func (*GetResp) String

func (x *GetResp) String() string

type SaveReq

type SaveReq struct {
	UnixNano int64  `protobuf:"varint,1,opt,name=unixNano,proto3" json:"unixNano,omitempty"`
	Content  string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

func (*SaveReq) Descriptor deprecated

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

Deprecated: Use SaveReq.ProtoReflect.Descriptor instead.

func (*SaveReq) GetContent

func (x *SaveReq) GetContent() string

func (*SaveReq) GetUnixNano

func (x *SaveReq) GetUnixNano() int64

func (*SaveReq) ProtoMessage

func (*SaveReq) ProtoMessage()

func (*SaveReq) ProtoReflect

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

func (*SaveReq) Reset

func (x *SaveReq) Reset()

func (*SaveReq) String

func (x *SaveReq) String() string

type SaveResp

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

func (*SaveResp) Descriptor deprecated

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

Deprecated: Use SaveResp.ProtoReflect.Descriptor instead.

func (*SaveResp) ProtoMessage

func (*SaveResp) ProtoMessage()

func (*SaveResp) ProtoReflect

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

func (*SaveResp) Reset

func (x *SaveResp) Reset()

func (*SaveResp) String

func (x *SaveResp) String() string

type SnippetsClient

type SnippetsClient interface {
	Save(ctx context.Context, in *SaveReq, opts ...grpc.CallOption) (*SaveResp, error)
	Get(ctx context.Context, in *GetReq, opts ...grpc.CallOption) (*GetResp, error)
}

SnippetsClient is the client API for Snippets service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewSnippetsClient

func NewSnippetsClient(cc grpc.ClientConnInterface) SnippetsClient

type SnippetsServer

type SnippetsServer interface {
	Save(context.Context, *SaveReq) (*SaveResp, error)
	Get(context.Context, *GetReq) (*GetResp, error)
}

SnippetsServer is the server API for Snippets service.

type UnimplementedSnippetsServer

type UnimplementedSnippetsServer struct {
}

UnimplementedSnippetsServer can be embedded to have forward compatible implementations.

func (*UnimplementedSnippetsServer) Get

func (*UnimplementedSnippetsServer) Save

Jump to

Keyboard shortcuts

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