v2

package
v0.0.0-...-f28e239 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Overview

Package v2 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ListerService_ListLists_FullMethodName  = "/lister.v2.ListerService/ListLists"
	ListerService_GetList_FullMethodName    = "/lister.v2.ListerService/GetList"
	ListerService_CreateList_FullMethodName = "/lister.v2.ListerService/CreateList"
	ListerService_UpdateList_FullMethodName = "/lister.v2.ListerService/UpdateList"
	ListerService_DeleteList_FullMethodName = "/lister.v2.ListerService/DeleteList"
)

Variables

View Source
var File_lister_v2_lister_proto protoreflect.FileDescriptor
View Source
var ListerService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "lister.v2.ListerService",
	HandlerType: (*ListerServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ListLists",
			Handler:    _ListerService_ListLists_Handler,
		},
		{
			MethodName: "GetList",
			Handler:    _ListerService_GetList_Handler,
		},
		{
			MethodName: "CreateList",
			Handler:    _ListerService_CreateList_Handler,
		},
		{
			MethodName: "UpdateList",
			Handler:    _ListerService_UpdateList_Handler,
		},
		{
			MethodName: "DeleteList",
			Handler:    _ListerService_DeleteList_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "lister/v2/lister.proto",
}

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

Functions

func RegisterListerServiceHandler

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

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

func RegisterListerServiceHandlerClient

func RegisterListerServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ListerServiceClient) error

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

func RegisterListerServiceHandlerFromEndpoint

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

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

func RegisterListerServiceHandlerServer

func RegisterListerServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ListerServiceServer) error

RegisterListerServiceHandlerServer registers the http handlers for service ListerService to "mux". UnaryRPC :call ListerServiceServer 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 RegisterListerServiceHandlerFromEndpoint instead.

func RegisterListerServiceServer

func RegisterListerServiceServer(s grpc.ServiceRegistrar, srv ListerServiceServer)

Types

type CreateListRequest

type CreateListRequest struct {
	List *List `protobuf:"bytes,1,opt,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateListRequest) Descriptor deprecated

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

Deprecated: Use CreateListRequest.ProtoReflect.Descriptor instead.

func (*CreateListRequest) GetList

func (x *CreateListRequest) GetList() *List

func (*CreateListRequest) ProtoMessage

func (*CreateListRequest) ProtoMessage()

func (*CreateListRequest) ProtoReflect

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

func (*CreateListRequest) Reset

func (x *CreateListRequest) Reset()

func (*CreateListRequest) String

func (x *CreateListRequest) String() string

type CreateListResponse

type CreateListResponse struct {
	List *List `protobuf:"bytes,1,opt,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateListResponse) Descriptor deprecated

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

Deprecated: Use CreateListResponse.ProtoReflect.Descriptor instead.

func (*CreateListResponse) GetList

func (x *CreateListResponse) GetList() *List

func (*CreateListResponse) ProtoMessage

func (*CreateListResponse) ProtoMessage()

func (*CreateListResponse) ProtoReflect

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

func (*CreateListResponse) Reset

func (x *CreateListResponse) Reset()

func (*CreateListResponse) String

func (x *CreateListResponse) String() string

type DeleteListRequest

type DeleteListRequest struct {
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteListRequest) Descriptor deprecated

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

Deprecated: Use DeleteListRequest.ProtoReflect.Descriptor instead.

func (*DeleteListRequest) GetId

func (x *DeleteListRequest) GetId() uint32

func (*DeleteListRequest) ProtoMessage

func (*DeleteListRequest) ProtoMessage()

func (*DeleteListRequest) ProtoReflect

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

func (*DeleteListRequest) Reset

func (x *DeleteListRequest) Reset()

func (*DeleteListRequest) String

func (x *DeleteListRequest) String() string

type GetListRequest

type GetListRequest struct {
	Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*GetListRequest) Descriptor deprecated

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

Deprecated: Use GetListRequest.ProtoReflect.Descriptor instead.

func (*GetListRequest) GetId

func (x *GetListRequest) GetId() uint32

func (*GetListRequest) ProtoMessage

func (*GetListRequest) ProtoMessage()

func (*GetListRequest) ProtoReflect

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

func (*GetListRequest) Reset

func (x *GetListRequest) Reset()

func (*GetListRequest) String

func (x *GetListRequest) String() string

type GetListResponse

type GetListResponse struct {
	List *List `protobuf:"bytes,1,opt,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*GetListResponse) Descriptor deprecated

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

Deprecated: Use GetListResponse.ProtoReflect.Descriptor instead.

func (*GetListResponse) GetList

func (x *GetListResponse) GetList() *List

func (*GetListResponse) ProtoMessage

func (*GetListResponse) ProtoMessage()

func (*GetListResponse) ProtoReflect

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

func (*GetListResponse) Reset

func (x *GetListResponse) Reset()

func (*GetListResponse) String

func (x *GetListResponse) String() string

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"`
	Items []*ListItem `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty"`
	// contains filtered or unexported fields
}

func (*List) Descriptor deprecated

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

Deprecated: Use List.ProtoReflect.Descriptor instead.

func (*List) GetId

func (x *List) GetId() uint32

func (*List) GetItems

func (x *List) GetItems() []*ListItem

func (*List) GetTitle

func (x *List) GetTitle() string

func (*List) ProtoMessage

func (*List) ProtoMessage()

func (*List) ProtoReflect

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

func (*List) Reset

func (x *List) Reset()

func (*List) String

func (x *List) String() string

type ListItem

type ListItem struct {
	Id   uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Text string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*ListItem) Descriptor deprecated

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

Deprecated: Use ListItem.ProtoReflect.Descriptor instead.

func (*ListItem) GetId

func (x *ListItem) GetId() uint32

func (*ListItem) GetText

func (x *ListItem) GetText() string

func (*ListItem) ProtoMessage

func (*ListItem) ProtoMessage()

func (*ListItem) ProtoReflect

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

func (*ListItem) Reset

func (x *ListItem) Reset()

func (*ListItem) String

func (x *ListItem) String() string

type ListListsResponse

type ListListsResponse struct {
	Lists []*List `protobuf:"bytes,1,rep,name=lists,proto3" json:"lists,omitempty"`
	// contains filtered or unexported fields
}

func (*ListListsResponse) Descriptor deprecated

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

Deprecated: Use ListListsResponse.ProtoReflect.Descriptor instead.

func (*ListListsResponse) GetLists

func (x *ListListsResponse) GetLists() []*List

func (*ListListsResponse) ProtoMessage

func (*ListListsResponse) ProtoMessage()

func (*ListListsResponse) ProtoReflect

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

func (*ListListsResponse) Reset

func (x *ListListsResponse) Reset()

func (*ListListsResponse) String

func (x *ListListsResponse) String() string

type ListerServiceClient

type ListerServiceClient interface {
	ListLists(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*ListListsResponse, error)
	GetList(ctx context.Context, in *GetListRequest, opts ...grpc.CallOption) (*GetListResponse, error)
	CreateList(ctx context.Context, in *CreateListRequest, opts ...grpc.CallOption) (*CreateListResponse, error)
	UpdateList(ctx context.Context, in *UpdateListRequest, opts ...grpc.CallOption) (*UpdateListResponse, error)
	DeleteList(ctx context.Context, in *DeleteListRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

ListerServiceClient is the client API for ListerService 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.

type ListerServiceServer

type ListerServiceServer interface {
	ListLists(context.Context, *emptypb.Empty) (*ListListsResponse, error)
	GetList(context.Context, *GetListRequest) (*GetListResponse, error)
	CreateList(context.Context, *CreateListRequest) (*CreateListResponse, error)
	UpdateList(context.Context, *UpdateListRequest) (*UpdateListResponse, error)
	DeleteList(context.Context, *DeleteListRequest) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

ListerServiceServer is the server API for ListerService service. All implementations must embed UnimplementedListerServiceServer for forward compatibility

type UnimplementedListerServiceServer

type UnimplementedListerServiceServer struct {
}

UnimplementedListerServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedListerServiceServer) CreateList

func (UnimplementedListerServiceServer) DeleteList

func (UnimplementedListerServiceServer) GetList

func (UnimplementedListerServiceServer) ListLists

func (UnimplementedListerServiceServer) UpdateList

type UnsafeListerServiceServer

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

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

type UpdateListRequest

type UpdateListRequest struct {
	Id   uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	List *List  `protobuf:"bytes,2,opt,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateListRequest) Descriptor deprecated

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

Deprecated: Use UpdateListRequest.ProtoReflect.Descriptor instead.

func (*UpdateListRequest) GetId

func (x *UpdateListRequest) GetId() uint32

func (*UpdateListRequest) GetList

func (x *UpdateListRequest) GetList() *List

func (*UpdateListRequest) ProtoMessage

func (*UpdateListRequest) ProtoMessage()

func (*UpdateListRequest) ProtoReflect

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

func (*UpdateListRequest) Reset

func (x *UpdateListRequest) Reset()

func (*UpdateListRequest) String

func (x *UpdateListRequest) String() string

type UpdateListResponse

type UpdateListResponse struct {
	List *List `protobuf:"bytes,1,opt,name=list,proto3" json:"list,omitempty"`
	// contains filtered or unexported fields
}

func (*UpdateListResponse) Descriptor deprecated

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

Deprecated: Use UpdateListResponse.ProtoReflect.Descriptor instead.

func (*UpdateListResponse) GetList

func (x *UpdateListResponse) GetList() *List

func (*UpdateListResponse) ProtoMessage

func (*UpdateListResponse) ProtoMessage()

func (*UpdateListResponse) ProtoReflect

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

func (*UpdateListResponse) Reset

func (x *UpdateListResponse) Reset()

func (*UpdateListResponse) String

func (x *UpdateListResponse) String() string

Jump to

Keyboard shortcuts

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