Documentation ¶
Overview ¶
Package v2 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterListerHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterListerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ListerClient) error
- func RegisterListerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterListerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ListerServer) error
- func RegisterListerServer(s grpc.ServiceRegistrar, srv ListerServer)
- type Empty
- type List
- func (*List) Descriptor() ([]byte, []int)deprecated
- func (x *List) GetId() uint32
- func (x *List) GetItems() []string
- func (x *List) GetStatus() string
- func (x *List) GetTags() []string
- func (x *List) GetTitle() string
- func (*List) ProtoMessage()
- func (x *List) ProtoReflect() protoreflect.Message
- func (x *List) Reset()
- func (x *List) String() string
- type ListerClient
- type ListerServer
- type Lists
- type UnimplementedListerServer
- func (UnimplementedListerServer) AddList(context.Context, *List) (*Empty, error)
- func (UnimplementedListerServer) AppendItem(context.Context, *List) (*Empty, error)
- func (UnimplementedListerServer) ChangeList(context.Context, *List) (*Empty, error)
- func (UnimplementedListerServer) DeleteList(context.Context, *List) (*Empty, error)
- func (UnimplementedListerServer) GetAllLists(context.Context, *Empty) (*Lists, error)
- func (UnimplementedListerServer) GetList(context.Context, *List) (*List, error)
- type UnsafeListerServer
Constants ¶
This section is empty.
Variables ¶
var File_v2_lister_proto protoreflect.FileDescriptor
var Lister_ServiceDesc = grpc.ServiceDesc{ ServiceName: "lister.v2.Lister", HandlerType: (*ListerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "GetAllLists", Handler: _Lister_GetAllLists_Handler, }, { MethodName: "GetList", Handler: _Lister_GetList_Handler, }, { MethodName: "AddList", Handler: _Lister_AddList_Handler, }, { MethodName: "ChangeList", Handler: _Lister_ChangeList_Handler, }, { MethodName: "DeleteList", Handler: _Lister_DeleteList_Handler, }, { MethodName: "AppendItem", Handler: _Lister_AppendItem_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "v2/lister.proto", }
Lister_ServiceDesc is the grpc.ServiceDesc for Lister service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterListerHandler ¶
RegisterListerHandler registers the http handlers for service Lister to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterListerHandlerClient ¶
func RegisterListerHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ListerClient) error
RegisterListerHandlerClient registers the http handlers for service Lister to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ListerClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ListerClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "ListerClient" to call the correct interceptors.
func RegisterListerHandlerFromEndpoint ¶
func RegisterListerHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterListerHandlerFromEndpoint is same as RegisterListerHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterListerHandlerServer ¶
func RegisterListerHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ListerServer) error
RegisterListerHandlerServer registers the http handlers for service Lister to "mux". UnaryRPC :call ListerServer 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 RegisterListerHandlerFromEndpoint instead.
func RegisterListerServer ¶
func RegisterListerServer(s grpc.ServiceRegistrar, srv ListerServer)
Types ¶
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type List ¶
type List struct { Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"` Status string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"` Tags []string `protobuf:"bytes,4,rep,name=tags,proto3" json:"tags,omitempty"` Items []string `protobuf:"bytes,5,rep,name=items,proto3" json:"items,omitempty"` // contains filtered or unexported fields }
func (*List) Descriptor
deprecated
func (*List) ProtoMessage ¶
func (*List) ProtoMessage()
func (*List) ProtoReflect ¶
func (x *List) ProtoReflect() protoreflect.Message
type ListerClient ¶
type ListerClient interface { //list actions GetAllLists(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Lists, error) GetList(ctx context.Context, in *List, opts ...grpc.CallOption) (*List, error) AddList(ctx context.Context, in *List, opts ...grpc.CallOption) (*Empty, error) ChangeList(ctx context.Context, in *List, opts ...grpc.CallOption) (*Empty, error) DeleteList(ctx context.Context, in *List, opts ...grpc.CallOption) (*Empty, error) //item actions //TODO: maybe add some more AppendItem(ctx context.Context, in *List, opts ...grpc.CallOption) (*Empty, error) }
ListerClient is the client API for Lister 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 NewListerClient ¶
func NewListerClient(cc grpc.ClientConnInterface) ListerClient
type ListerServer ¶
type ListerServer interface { //list actions GetAllLists(context.Context, *Empty) (*Lists, error) GetList(context.Context, *List) (*List, error) AddList(context.Context, *List) (*Empty, error) ChangeList(context.Context, *List) (*Empty, error) DeleteList(context.Context, *List) (*Empty, error) //item actions //TODO: maybe add some more AppendItem(context.Context, *List) (*Empty, error) // contains filtered or unexported methods }
ListerServer is the server API for Lister service. All implementations must embed UnimplementedListerServer for forward compatibility
type Lists ¶
type Lists struct { Lists []*List `protobuf:"bytes,1,rep,name=lists,proto3" json:"lists,omitempty"` // contains filtered or unexported fields }
func (*Lists) Descriptor
deprecated
func (*Lists) ProtoMessage ¶
func (*Lists) ProtoMessage()
func (*Lists) ProtoReflect ¶
func (x *Lists) ProtoReflect() protoreflect.Message
type UnimplementedListerServer ¶
type UnimplementedListerServer struct { }
UnimplementedListerServer must be embedded to have forward compatible implementations.
func (UnimplementedListerServer) AppendItem ¶
func (UnimplementedListerServer) ChangeList ¶
func (UnimplementedListerServer) DeleteList ¶
func (UnimplementedListerServer) GetAllLists ¶
type UnsafeListerServer ¶
type UnsafeListerServer interface {
// contains filtered or unexported methods
}
UnsafeListerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ListerServer will result in compilation errors.