v1

package
v0.0.0-...-36d8597 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 32 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_grpc_web_v1_grpc_api_proto protoreflect.FileDescriptor
View Source
var LinkService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc_web.v1.LinkService",
	HandlerType: (*LinkServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetLinks",
			Handler:    _LinkService_GetLinks_Handler,
		},
		{
			MethodName: "GetLink",
			Handler:    _LinkService_GetLink_Handler,
		},
		{
			MethodName: "CreateLink",
			Handler:    _LinkService_CreateLink_Handler,
		},
		{
			MethodName: "DeleteLink",
			Handler:    _LinkService_DeleteLink_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "grpc_web/v1/grpc_api.proto",
}

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

Functions

func RegisterLinkServiceHandler

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

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

func RegisterLinkServiceHandlerClient

func RegisterLinkServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LinkServiceClient) error

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

func RegisterLinkServiceHandlerFromEndpoint

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

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

func RegisterLinkServiceHandlerServer

func RegisterLinkServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LinkServiceServer) error

RegisterLinkServiceHandlerServer registers the http handlers for service LinkService to "mux". UnaryRPC :call LinkServiceServer 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 RegisterLinkServiceHandlerFromEndpoint instead.

func RegisterLinkServiceServer

func RegisterLinkServiceServer(s grpc.ServiceRegistrar, srv LinkServiceServer)

Types

type API

type API struct {
	LinkServiceServer

	RPC *rpc.RPCServer
	// contains filtered or unexported fields
}

API ...

func (*API) Close

func (api *API) Close() error

Close ...

func (api *API) CreateLink(ctx context.Context, req *CreateLinkRequest) (*CreateLinkResponse, error)

CreateLink ...

func (*API) CustomHTTPError

func (api *API) CustomHTTPError(_ context.Context, _ *runtime.ServeMux, marshaler runtime.Marshaler, w http.ResponseWriter, _ *http.Request, err error)
func (api *API) DeleteLink(ctx context.Context, req *DeleteLinkRequest) (*empty.Empty, error)

DeleteLink ...

func (api *API) GetLink(ctx context.Context, req *GetLinkRequest) (*GetLinkResponse, error)

GetLink ...

func (api *API) GetLinks(ctx context.Context, req *GetLinksRequest) (*GetLinksResponse, error)

GetLinks ...

func (*API) Run

func (api *API) Run(
	ctx context.Context,
	i18n *message.Printer,
	config http_server.Config,
	log logger.Logger,
	tracer *trace.TracerProvider,

	link_rpc link_rpc.LinkServiceClient,
	link_command link_cqrs.LinkCommandServiceClient,
	link_query link_cqrs.LinkQueryServiceClient,
	sitemap_rpc sitemap_rpc.SitemapServiceClient,
) error

Run HTTP-server

type CreateLinkRequest

type CreateLinkRequest struct {
	Link *v1.Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateLinkRequest) Descriptor deprecated

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

Deprecated: Use CreateLinkRequest.ProtoReflect.Descriptor instead.

func (x *CreateLinkRequest) GetLink() *v1.Link

func (*CreateLinkRequest) ProtoMessage

func (*CreateLinkRequest) ProtoMessage()

func (*CreateLinkRequest) ProtoReflect

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

func (*CreateLinkRequest) Reset

func (x *CreateLinkRequest) Reset()

func (*CreateLinkRequest) String

func (x *CreateLinkRequest) String() string

type CreateLinkResponse

type CreateLinkResponse struct {
	Link *v1.Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateLinkResponse) Descriptor deprecated

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

Deprecated: Use CreateLinkResponse.ProtoReflect.Descriptor instead.

func (x *CreateLinkResponse) GetLink() *v1.Link

func (*CreateLinkResponse) ProtoMessage

func (*CreateLinkResponse) ProtoMessage()

func (*CreateLinkResponse) ProtoReflect

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

func (*CreateLinkResponse) Reset

func (x *CreateLinkResponse) Reset()

func (*CreateLinkResponse) String

func (x *CreateLinkResponse) String() string

type DeleteLinkRequest

type DeleteLinkRequest struct {
	Link *v1.Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteLinkRequest) Descriptor deprecated

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

Deprecated: Use DeleteLinkRequest.ProtoReflect.Descriptor instead.

func (x *DeleteLinkRequest) GetLink() *v1.Link

func (*DeleteLinkRequest) ProtoMessage

func (*DeleteLinkRequest) ProtoMessage()

func (*DeleteLinkRequest) ProtoReflect

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

func (*DeleteLinkRequest) Reset

func (x *DeleteLinkRequest) Reset()

func (*DeleteLinkRequest) String

func (x *DeleteLinkRequest) String() string

type GetLinkRequest

type GetLinkRequest struct {
	Link *v1.Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLinkRequest) Descriptor deprecated

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

Deprecated: Use GetLinkRequest.ProtoReflect.Descriptor instead.

func (x *GetLinkRequest) GetLink() *v1.Link

func (*GetLinkRequest) ProtoMessage

func (*GetLinkRequest) ProtoMessage()

func (*GetLinkRequest) ProtoReflect

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

func (*GetLinkRequest) Reset

func (x *GetLinkRequest) Reset()

func (*GetLinkRequest) String

func (x *GetLinkRequest) String() string

type GetLinkResponse

type GetLinkResponse struct {
	Link *v1.Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLinkResponse) Descriptor deprecated

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

Deprecated: Use GetLinkResponse.ProtoReflect.Descriptor instead.

func (x *GetLinkResponse) GetLink() *v1.Link

func (*GetLinkResponse) ProtoMessage

func (*GetLinkResponse) ProtoMessage()

func (*GetLinkResponse) ProtoReflect

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

func (*GetLinkResponse) Reset

func (x *GetLinkResponse) Reset()

func (*GetLinkResponse) String

func (x *GetLinkResponse) String() string

type GetLinksRequest

type GetLinksRequest struct {
	Link   *v1.Link `protobuf:"bytes,1,opt,name=link,proto3" json:"link,omitempty"`
	Filter string   `protobuf:"bytes,2,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLinksRequest) Descriptor deprecated

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

Deprecated: Use GetLinksRequest.ProtoReflect.Descriptor instead.

func (*GetLinksRequest) GetFilter

func (x *GetLinksRequest) GetFilter() string
func (x *GetLinksRequest) GetLink() *v1.Link

func (*GetLinksRequest) ProtoMessage

func (*GetLinksRequest) ProtoMessage()

func (*GetLinksRequest) ProtoReflect

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

func (*GetLinksRequest) Reset

func (x *GetLinksRequest) Reset()

func (*GetLinksRequest) String

func (x *GetLinksRequest) String() string

type GetLinksResponse

type GetLinksResponse struct {
	Links []*v1.Link `protobuf:"bytes,1,rep,name=links,proto3" json:"links,omitempty"`
	// contains filtered or unexported fields
}

func (*GetLinksResponse) Descriptor deprecated

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

Deprecated: Use GetLinksResponse.ProtoReflect.Descriptor instead.

func (x *GetLinksResponse) GetLinks() []*v1.Link

func (*GetLinksResponse) ProtoMessage

func (*GetLinksResponse) ProtoMessage()

func (*GetLinksResponse) ProtoReflect

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

func (*GetLinksResponse) Reset

func (x *GetLinksResponse) Reset()

func (*GetLinksResponse) String

func (x *GetLinksResponse) String() string

type LinkServiceClient

type LinkServiceClient interface {
	GetLinks(ctx context.Context, in *GetLinksRequest, opts ...grpc.CallOption) (*GetLinksResponse, error)
	GetLink(ctx context.Context, in *GetLinkRequest, opts ...grpc.CallOption) (*GetLinkResponse, error)
	CreateLink(ctx context.Context, in *CreateLinkRequest, opts ...grpc.CallOption) (*CreateLinkResponse, error)
	DeleteLink(ctx context.Context, in *DeleteLinkRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

LinkServiceClient is the client API for LinkService 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 LinkServiceServer

LinkServiceServer is the server API for LinkService service. All implementations should embed UnimplementedLinkServiceServer for forward compatibility

type UnimplementedLinkServiceServer

type UnimplementedLinkServiceServer struct {
}

UnimplementedLinkServiceServer should be embedded to have forward compatible implementations.

type UnsafeLinkServiceServer

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

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

Jump to

Keyboard shortcuts

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