proto

package
v0.0.0-...-eda0c62 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 17 Imported by: 0

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_proto_common_proto protoreflect.FileDescriptor
View Source
var File_proto_tag_proto protoreflect.FileDescriptor
View Source
var TagService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.TagService",
	HandlerType: (*TagServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetTagList",
			Handler:    _TagService_GetTagList_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "proto/tag.proto",
}

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

Functions

func RegisterTagServiceHandler

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

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

func RegisterTagServiceHandlerClient

func RegisterTagServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TagServiceClient) error

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

func RegisterTagServiceHandlerFromEndpoint

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

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

func RegisterTagServiceHandlerServer

func RegisterTagServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TagServiceServer) error

RegisterTagServiceHandlerServer registers the http handlers for service TagService to "mux". UnaryRPC :call TagServiceServer 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 RegisterTagServiceHandlerFromEndpoint instead.

func RegisterTagServiceServer

func RegisterTagServiceServer(s grpc.ServiceRegistrar, srv TagServiceServer)

Types

type Error

type Error struct {
	Code    int32      `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`
	Message string     `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	Detail  *anypb.Any `protobuf:"bytes,3,opt,name=detail,proto3" json:"detail,omitempty"`
	// contains filtered or unexported fields
}

func (*Error) Descriptor deprecated

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

Deprecated: Use Error.ProtoReflect.Descriptor instead.

func (*Error) GetCode

func (x *Error) GetCode() int32

func (*Error) GetDetail

func (x *Error) GetDetail() *anypb.Any

func (*Error) GetMessage

func (x *Error) GetMessage() string

func (*Error) ProtoMessage

func (*Error) ProtoMessage()

func (*Error) ProtoReflect

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

func (*Error) Reset

func (x *Error) Reset()

func (*Error) String

func (x *Error) String() string

type GetTagListReply

type GetTagListReply struct {
	List  []*Tag `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"`
	Pager *Pager `protobuf:"bytes,2,opt,name=pager,proto3" json:"pager,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTagListReply) Descriptor deprecated

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

Deprecated: Use GetTagListReply.ProtoReflect.Descriptor instead.

func (*GetTagListReply) GetList

func (x *GetTagListReply) GetList() []*Tag

func (*GetTagListReply) GetPager

func (x *GetTagListReply) GetPager() *Pager

func (*GetTagListReply) ProtoMessage

func (*GetTagListReply) ProtoMessage()

func (*GetTagListReply) ProtoReflect

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

func (*GetTagListReply) Reset

func (x *GetTagListReply) Reset()

func (*GetTagListReply) String

func (x *GetTagListReply) String() string

type GetTagListRequest

type GetTagListRequest struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	State uint32 `protobuf:"varint,2,opt,name=state,proto3" json:"state,omitempty"`
	// contains filtered or unexported fields
}

func (*GetTagListRequest) Descriptor deprecated

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

Deprecated: Use GetTagListRequest.ProtoReflect.Descriptor instead.

func (*GetTagListRequest) GetName

func (x *GetTagListRequest) GetName() string

func (*GetTagListRequest) GetState

func (x *GetTagListRequest) GetState() uint32

func (*GetTagListRequest) ProtoMessage

func (*GetTagListRequest) ProtoMessage()

func (*GetTagListRequest) ProtoReflect

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

func (*GetTagListRequest) Reset

func (x *GetTagListRequest) Reset()

func (*GetTagListRequest) String

func (x *GetTagListRequest) String() string

type Pager

type Pager struct {
	Page      int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
	PageSize  int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	TotalRows int64 `protobuf:"varint,3,opt,name=total_rows,json=totalRows,proto3" json:"total_rows,omitempty"`
	// contains filtered or unexported fields
}

func (*Pager) Descriptor deprecated

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

Deprecated: Use Pager.ProtoReflect.Descriptor instead.

func (*Pager) GetPage

func (x *Pager) GetPage() int64

func (*Pager) GetPageSize

func (x *Pager) GetPageSize() int64

func (*Pager) GetTotalRows

func (x *Pager) GetTotalRows() int64

func (*Pager) ProtoMessage

func (*Pager) ProtoMessage()

func (*Pager) ProtoReflect

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

func (*Pager) Reset

func (x *Pager) Reset()

func (*Pager) String

func (x *Pager) String() string

type Tag

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

func (*Tag) Descriptor deprecated

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

Deprecated: Use Tag.ProtoReflect.Descriptor instead.

func (*Tag) GetId

func (x *Tag) GetId() int64

func (*Tag) GetName

func (x *Tag) GetName() string

func (*Tag) GetState

func (x *Tag) GetState() uint32

func (*Tag) ProtoMessage

func (*Tag) ProtoMessage()

func (*Tag) ProtoReflect

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

func (*Tag) Reset

func (x *Tag) Reset()

func (*Tag) String

func (x *Tag) String() string

type TagServiceClient

type TagServiceClient interface {
	//rpc GetTagList (GetTagListRequest) returns (GetTagListReply) {}
	GetTagList(ctx context.Context, in *GetTagListRequest, opts ...grpc.CallOption) (*GetTagListReply, error)
}

TagServiceClient is the client API for TagService 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 NewTagServiceClient

func NewTagServiceClient(cc grpc.ClientConnInterface) TagServiceClient

type TagServiceServer

type TagServiceServer interface {
	//rpc GetTagList (GetTagListRequest) returns (GetTagListReply) {}
	GetTagList(context.Context, *GetTagListRequest) (*GetTagListReply, error)
	// contains filtered or unexported methods
}

TagServiceServer is the server API for TagService service. All implementations must embed UnimplementedTagServiceServer for forward compatibility

type UnimplementedTagServiceServer

type UnimplementedTagServiceServer struct {
}

UnimplementedTagServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTagServiceServer) GetTagList

type UnsafeTagServiceServer

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

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

Jump to

Keyboard shortcuts

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