Subscription

package
v0.0.0-...-ceaf5e3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: MIT Imports: 15 Imported by: 3

Documentation

Overview

Package Subscription is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_subscription_subscription_proto protoreflect.FileDescriptor
View Source
var SubscriptionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "subscription_service.SubscriptionService",
	HandlerType: (*SubscriptionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetSubscriptionsByUserID",
			Handler:    _SubscriptionService_GetSubscriptionsByUserID_Handler,
		},
		{
			MethodName: "AddSubscription",
			Handler:    _SubscriptionService_AddSubscription_Handler,
		},
		{
			MethodName: "RemoveSubscription",
			Handler:    _SubscriptionService_RemoveSubscription_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "subscription/subscription.proto",
}

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

Functions

func RegisterSubscriptionServiceHandler

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

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

func RegisterSubscriptionServiceHandlerClient

func RegisterSubscriptionServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SubscriptionServiceClient) error

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

func RegisterSubscriptionServiceHandlerFromEndpoint

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

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

func RegisterSubscriptionServiceHandlerServer

func RegisterSubscriptionServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SubscriptionServiceServer) error

RegisterSubscriptionServiceHandlerServer registers the http handlers for service SubscriptionService to "mux". UnaryRPC :call SubscriptionServiceServer 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 RegisterSubscriptionServiceHandlerFromEndpoint instead.

func RegisterSubscriptionServiceServer

func RegisterSubscriptionServiceServer(s grpc.ServiceRegistrar, srv SubscriptionServiceServer)

Types

type AddSubscriptionRequest

type AddSubscriptionRequest struct {
	UserID string `protobuf:"bytes,2,opt,name=UserID,proto3" json:"UserID,omitempty"`
	ModID  string `protobuf:"bytes,3,opt,name=ModID,proto3" json:"ModID,omitempty"`
	// contains filtered or unexported fields
}

AddSubscription

func (*AddSubscriptionRequest) Descriptor deprecated

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

Deprecated: Use AddSubscriptionRequest.ProtoReflect.Descriptor instead.

func (*AddSubscriptionRequest) GetModID

func (x *AddSubscriptionRequest) GetModID() string

func (*AddSubscriptionRequest) GetUserID

func (x *AddSubscriptionRequest) GetUserID() string

func (*AddSubscriptionRequest) ProtoMessage

func (*AddSubscriptionRequest) ProtoMessage()

func (*AddSubscriptionRequest) ProtoReflect

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

func (*AddSubscriptionRequest) Reset

func (x *AddSubscriptionRequest) Reset()

func (*AddSubscriptionRequest) String

func (x *AddSubscriptionRequest) String() string

type AddSubscriptionResponse

type AddSubscriptionResponse struct {
	// contains filtered or unexported fields
}

func (*AddSubscriptionResponse) Descriptor deprecated

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

Deprecated: Use AddSubscriptionResponse.ProtoReflect.Descriptor instead.

func (*AddSubscriptionResponse) ProtoMessage

func (*AddSubscriptionResponse) ProtoMessage()

func (*AddSubscriptionResponse) ProtoReflect

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

func (*AddSubscriptionResponse) Reset

func (x *AddSubscriptionResponse) Reset()

func (*AddSubscriptionResponse) String

func (x *AddSubscriptionResponse) String() string

type GetSubscriptionsByIDRequest

type GetSubscriptionsByIDRequest struct {
	UserID string `protobuf:"bytes,1,opt,name=UserID,proto3" json:"UserID,omitempty"`
	// contains filtered or unexported fields
}

GetSubscriptionByID

func (*GetSubscriptionsByIDRequest) Descriptor deprecated

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

Deprecated: Use GetSubscriptionsByIDRequest.ProtoReflect.Descriptor instead.

func (*GetSubscriptionsByIDRequest) GetUserID

func (x *GetSubscriptionsByIDRequest) GetUserID() string

func (*GetSubscriptionsByIDRequest) ProtoMessage

func (*GetSubscriptionsByIDRequest) ProtoMessage()

func (*GetSubscriptionsByIDRequest) ProtoReflect

func (*GetSubscriptionsByIDRequest) Reset

func (x *GetSubscriptionsByIDRequest) Reset()

func (*GetSubscriptionsByIDRequest) String

func (x *GetSubscriptionsByIDRequest) String() string

type GetSubscriptionsByIDResponse

type GetSubscriptionsByIDResponse struct {
	Subscriptions []*Subscription `protobuf:"bytes,1,rep,name=Subscriptions,proto3" json:"Subscriptions,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSubscriptionsByIDResponse) Descriptor deprecated

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

Deprecated: Use GetSubscriptionsByIDResponse.ProtoReflect.Descriptor instead.

func (*GetSubscriptionsByIDResponse) GetSubscriptions

func (x *GetSubscriptionsByIDResponse) GetSubscriptions() []*Subscription

func (*GetSubscriptionsByIDResponse) ProtoMessage

func (*GetSubscriptionsByIDResponse) ProtoMessage()

func (*GetSubscriptionsByIDResponse) ProtoReflect

func (*GetSubscriptionsByIDResponse) Reset

func (x *GetSubscriptionsByIDResponse) Reset()

func (*GetSubscriptionsByIDResponse) String

type RemoveSubscriptionRequest

type RemoveSubscriptionRequest struct {
	UserID string `protobuf:"bytes,2,opt,name=UserID,proto3" json:"UserID,omitempty"`
	ModID  string `protobuf:"bytes,3,opt,name=ModID,proto3" json:"ModID,omitempty"`
	// contains filtered or unexported fields
}

RemoveSubscription

func (*RemoveSubscriptionRequest) Descriptor deprecated

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

Deprecated: Use RemoveSubscriptionRequest.ProtoReflect.Descriptor instead.

func (*RemoveSubscriptionRequest) GetModID

func (x *RemoveSubscriptionRequest) GetModID() string

func (*RemoveSubscriptionRequest) GetUserID

func (x *RemoveSubscriptionRequest) GetUserID() string

func (*RemoveSubscriptionRequest) ProtoMessage

func (*RemoveSubscriptionRequest) ProtoMessage()

func (*RemoveSubscriptionRequest) ProtoReflect

func (*RemoveSubscriptionRequest) Reset

func (x *RemoveSubscriptionRequest) Reset()

func (*RemoveSubscriptionRequest) String

func (x *RemoveSubscriptionRequest) String() string

type RemoveSubscriptionResponse

type RemoveSubscriptionResponse struct {
	// contains filtered or unexported fields
}

func (*RemoveSubscriptionResponse) Descriptor deprecated

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

Deprecated: Use RemoveSubscriptionResponse.ProtoReflect.Descriptor instead.

func (*RemoveSubscriptionResponse) ProtoMessage

func (*RemoveSubscriptionResponse) ProtoMessage()

func (*RemoveSubscriptionResponse) ProtoReflect

func (*RemoveSubscriptionResponse) Reset

func (x *RemoveSubscriptionResponse) Reset()

func (*RemoveSubscriptionResponse) String

func (x *RemoveSubscriptionResponse) String() string

type Subscription

type Subscription struct {
	UserID string `protobuf:"bytes,2,opt,name=UserID,proto3" json:"UserID,omitempty"`
	ModID  string `protobuf:"bytes,3,opt,name=ModID,proto3" json:"ModID,omitempty"`
	// contains filtered or unexported fields
}

func (*Subscription) Descriptor deprecated

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

Deprecated: Use Subscription.ProtoReflect.Descriptor instead.

func (*Subscription) GetModID

func (x *Subscription) GetModID() string

func (*Subscription) GetUserID

func (x *Subscription) GetUserID() string

func (*Subscription) ProtoMessage

func (*Subscription) ProtoMessage()

func (*Subscription) ProtoReflect

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

func (*Subscription) Reset

func (x *Subscription) Reset()

func (*Subscription) String

func (x *Subscription) String() string

type SubscriptionServiceClient

type SubscriptionServiceClient interface {
	GetSubscriptionsByUserID(ctx context.Context, in *GetSubscriptionsByIDRequest, opts ...grpc.CallOption) (*GetSubscriptionsByIDResponse, error)
	AddSubscription(ctx context.Context, in *AddSubscriptionRequest, opts ...grpc.CallOption) (*AddSubscriptionResponse, error)
	RemoveSubscription(ctx context.Context, in *RemoveSubscriptionRequest, opts ...grpc.CallOption) (*RemoveSubscriptionResponse, error)
}

SubscriptionServiceClient is the client API for SubscriptionService 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 SubscriptionServiceServer

type SubscriptionServiceServer interface {
	GetSubscriptionsByUserID(context.Context, *GetSubscriptionsByIDRequest) (*GetSubscriptionsByIDResponse, error)
	AddSubscription(context.Context, *AddSubscriptionRequest) (*AddSubscriptionResponse, error)
	RemoveSubscription(context.Context, *RemoveSubscriptionRequest) (*RemoveSubscriptionResponse, error)
	// contains filtered or unexported methods
}

SubscriptionServiceServer is the server API for SubscriptionService service. All implementations must embed UnimplementedSubscriptionServiceServer for forward compatibility

type UnimplementedSubscriptionServiceServer

type UnimplementedSubscriptionServiceServer struct {
}

UnimplementedSubscriptionServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedSubscriptionServiceServer) AddSubscription

func (UnimplementedSubscriptionServiceServer) GetSubscriptionsByUserID

func (UnimplementedSubscriptionServiceServer) RemoveSubscription

type UnsafeSubscriptionServiceServer

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

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

Jump to

Keyboard shortcuts

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