proto

package
v0.0.0-...-f4e75d1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2022 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_common_proto protoreflect.FileDescriptor

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.Server, 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 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 GetTagListResponse

type GetTagListResponse 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 (*GetTagListResponse) Descriptor deprecated

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

Deprecated: Use GetTagListResponse.ProtoReflect.Descriptor instead.

func (*GetTagListResponse) GetList

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

func (*GetTagListResponse) GetPager

func (x *GetTagListResponse) GetPager() *Pager

func (*GetTagListResponse) ProtoMessage

func (*GetTagListResponse) ProtoMessage()

func (*GetTagListResponse) ProtoReflect

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

func (*GetTagListResponse) Reset

func (x *GetTagListResponse) Reset()

func (*GetTagListResponse) String

func (x *GetTagListResponse) 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 {
	GetTagList(ctx context.Context, in *GetTagListRequest, opts ...grpc.CallOption) (*GetTagListResponse, error)
}

TagServiceClient is the client API for TagService service.

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

func NewTagServiceClient

func NewTagServiceClient(cc grpc.ClientConnInterface) TagServiceClient

type TagServiceServer

type TagServiceServer interface {
	GetTagList(context.Context, *GetTagListRequest) (*GetTagListResponse, error)
}

TagServiceServer is the server API for TagService service.

type UnimplementedTagServiceServer

type UnimplementedTagServiceServer struct {
}

UnimplementedTagServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedTagServiceServer) GetTagList

Jump to

Keyboard shortcuts

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