v2

package
v0.0.0-...-b10f34b Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2022 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

This section is empty.

Variables

View Source
var File_v2_lister_proto protoreflect.FileDescriptor
View Source
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

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

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) Descriptor() ([]byte, []int)

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) 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"`
	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) Descriptor() ([]byte, []int)

Deprecated: Use List.ProtoReflect.Descriptor instead.

func (*List) GetId

func (x *List) GetId() uint32

func (*List) GetItems

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

func (*List) GetStatus

func (x *List) GetStatus() string

func (*List) GetTags

func (x *List) GetTags() []string

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 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) Descriptor() ([]byte, []int)

Deprecated: Use Lists.ProtoReflect.Descriptor instead.

func (*Lists) GetLists

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

func (*Lists) ProtoMessage

func (*Lists) ProtoMessage()

func (*Lists) ProtoReflect

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

func (*Lists) Reset

func (x *Lists) Reset()

func (*Lists) String

func (x *Lists) String() string

type UnimplementedListerServer

type UnimplementedListerServer struct {
}

UnimplementedListerServer must be embedded to have forward compatible implementations.

func (UnimplementedListerServer) AddList

func (UnimplementedListerServer) AppendItem

func (UnimplementedListerServer) ChangeList

func (UnimplementedListerServer) DeleteList

func (UnimplementedListerServer) GetAllLists

func (UnimplementedListerServer) GetList

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.

Jump to

Keyboard shortcuts

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