subscriber

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package subscriber is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_subscriber_proto protoreflect.FileDescriptor

Functions

func RegisterSubscriberAPIHandler

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

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

func RegisterSubscriberAPIHandlerClient

func RegisterSubscriberAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SubscriberAPIClient) error

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

func RegisterSubscriberAPIHandlerFromEndpoint

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

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

func RegisterSubscriberAPIHandlerServer

func RegisterSubscriberAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SubscriberAPIServer) error

RegisterSubscriberAPIHandlerServer registers the http handlers for service SubscriberAPI to "mux". UnaryRPC :call SubscriberAPIServer 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 RegisterSubscriberAPIHandlerFromEndpoint instead.

func RegisterSubscriberAPIServer

func RegisterSubscriberAPIServer(s grpc.ServiceRegistrar, srv SubscriberAPIServer)

Types

type GetSubscriberRequest

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

func (*GetSubscriberRequest) Descriptor deprecated

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

Deprecated: Use GetSubscriberRequest.ProtoReflect.Descriptor instead.

func (*GetSubscriberRequest) GetSubscriberId

func (x *GetSubscriberRequest) GetSubscriberId() string

func (*GetSubscriberRequest) ProtoMessage

func (*GetSubscriberRequest) ProtoMessage()

func (*GetSubscriberRequest) ProtoReflect

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

func (*GetSubscriberRequest) Reset

func (x *GetSubscriberRequest) Reset()

func (*GetSubscriberRequest) String

func (x *GetSubscriberRequest) String() string

type ListSubscribersFilter

type ListSubscribersFilter struct {
	Channels []string `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"`
	// contains filtered or unexported fields
}

func (*ListSubscribersFilter) Descriptor deprecated

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

Deprecated: Use ListSubscribersFilter.ProtoReflect.Descriptor instead.

func (*ListSubscribersFilter) GetChannels

func (x *ListSubscribersFilter) GetChannels() []string

func (*ListSubscribersFilter) ProtoMessage

func (*ListSubscribersFilter) ProtoMessage()

func (*ListSubscribersFilter) ProtoReflect

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

func (*ListSubscribersFilter) Reset

func (x *ListSubscribersFilter) Reset()

func (*ListSubscribersFilter) String

func (x *ListSubscribersFilter) String() string

type ListSubscribersRequest

type ListSubscribersRequest struct {
	PageToken string                 `protobuf:"bytes,1,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
	PageSize  int32                  `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
	Filter    *ListSubscribersFilter `protobuf:"bytes,3,opt,name=filter,proto3" json:"filter,omitempty"`
	// contains filtered or unexported fields
}

func (*ListSubscribersRequest) Descriptor deprecated

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

Deprecated: Use ListSubscribersRequest.ProtoReflect.Descriptor instead.

func (*ListSubscribersRequest) GetFilter

func (*ListSubscribersRequest) GetPageSize

func (x *ListSubscribersRequest) GetPageSize() int32

func (*ListSubscribersRequest) GetPageToken

func (x *ListSubscribersRequest) GetPageToken() string

func (*ListSubscribersRequest) ProtoMessage

func (*ListSubscribersRequest) ProtoMessage()

func (*ListSubscribersRequest) ProtoReflect

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

func (*ListSubscribersRequest) Reset

func (x *ListSubscribersRequest) Reset()

func (*ListSubscribersRequest) String

func (x *ListSubscribersRequest) String() string

type ListSubscribersResponse

type ListSubscribersResponse struct {
	Subscribers     []*Subscriber `protobuf:"bytes,1,rep,name=subscribers,proto3" json:"subscribers,omitempty"`
	NextPageToken   string        `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
	CollectionCount int64         `protobuf:"varint,3,opt,name=collection_count,json=collectionCount,proto3" json:"collection_count,omitempty"`
	// contains filtered or unexported fields
}

func (*ListSubscribersResponse) Descriptor deprecated

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

Deprecated: Use ListSubscribersResponse.ProtoReflect.Descriptor instead.

func (*ListSubscribersResponse) GetCollectionCount

func (x *ListSubscribersResponse) GetCollectionCount() int64

func (*ListSubscribersResponse) GetNextPageToken

func (x *ListSubscribersResponse) GetNextPageToken() string

func (*ListSubscribersResponse) GetSubscribers

func (x *ListSubscribersResponse) GetSubscribers() []*Subscriber

func (*ListSubscribersResponse) ProtoMessage

func (*ListSubscribersResponse) ProtoMessage()

func (*ListSubscribersResponse) ProtoReflect

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

func (*ListSubscribersResponse) Reset

func (x *ListSubscribersResponse) Reset()

func (*ListSubscribersResponse) String

func (x *ListSubscribersResponse) String() string

type Subscriber

type Subscriber struct {
	SubscriberId string   `protobuf:"bytes,1,opt,name=subscriber_id,json=subscriberId,proto3" json:"subscriber_id,omitempty"`
	Email        string   `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	Phone        string   `protobuf:"bytes,3,opt,name=phone,proto3" json:"phone,omitempty"`
	ExternalId   string   `protobuf:"bytes,4,opt,name=external_id,json=externalId,proto3" json:"external_id,omitempty"`
	DeviceToken  string   `protobuf:"bytes,5,opt,name=device_token,json=deviceToken,proto3" json:"device_token,omitempty"`
	Channels     []string `protobuf:"bytes,6,rep,name=channels,proto3" json:"channels,omitempty"`
	// contains filtered or unexported fields
}

func (*Subscriber) Descriptor deprecated

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

Deprecated: Use Subscriber.ProtoReflect.Descriptor instead.

func (*Subscriber) GetChannels

func (x *Subscriber) GetChannels() []string

func (*Subscriber) GetDeviceToken

func (x *Subscriber) GetDeviceToken() string

func (*Subscriber) GetEmail

func (x *Subscriber) GetEmail() string

func (*Subscriber) GetExternalId

func (x *Subscriber) GetExternalId() string

func (*Subscriber) GetPhone

func (x *Subscriber) GetPhone() string

func (*Subscriber) GetSubscriberId

func (x *Subscriber) GetSubscriberId() string

func (*Subscriber) ProtoMessage

func (*Subscriber) ProtoMessage()

func (*Subscriber) ProtoReflect

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

func (*Subscriber) Reset

func (x *Subscriber) Reset()

func (*Subscriber) String

func (x *Subscriber) String() string

type SubscriberAPIClient

type SubscriberAPIClient interface {
	// Subscribes a user to a channel
	Subscribe(ctx context.Context, in *SubscriberRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Unsubscribes a user from a channel
	Unsubscribe(ctx context.Context, in *SubscriberRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Lists subscribers for a channel
	ListSubscribers(ctx context.Context, in *ListSubscribersRequest, opts ...grpc.CallOption) (*ListSubscribersResponse, error)
	// GetSubscriber retrieves information about a single subscriber
	GetSubscriber(ctx context.Context, in *GetSubscriberRequest, opts ...grpc.CallOption) (*Subscriber, error)
}

SubscriberAPIClient is the client API for SubscriberAPI 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 SubscriberAPIServer

type SubscriberAPIServer interface {
	// Subscribes a user to a channel
	Subscribe(context.Context, *SubscriberRequest) (*empty.Empty, error)
	// Unsubscribes a user from a channel
	Unsubscribe(context.Context, *SubscriberRequest) (*empty.Empty, error)
	// Lists subscribers for a channel
	ListSubscribers(context.Context, *ListSubscribersRequest) (*ListSubscribersResponse, error)
	// GetSubscriber retrieves information about a single subscriber
	GetSubscriber(context.Context, *GetSubscriberRequest) (*Subscriber, error)
	// contains filtered or unexported methods
}

SubscriberAPIServer is the server API for SubscriberAPI service. All implementations must embed UnimplementedSubscriberAPIServer for forward compatibility

type SubscriberRequest

type SubscriberRequest struct {
	SubscriberId string   `protobuf:"bytes,1,opt,name=subscriber_id,json=subscriberId,proto3" json:"subscriber_id,omitempty"`
	Channels     []string `protobuf:"bytes,2,rep,name=channels,proto3" json:"channels,omitempty"`
	// contains filtered or unexported fields
}

func (*SubscriberRequest) Descriptor deprecated

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

Deprecated: Use SubscriberRequest.ProtoReflect.Descriptor instead.

func (*SubscriberRequest) GetChannels

func (x *SubscriberRequest) GetChannels() []string

func (*SubscriberRequest) GetSubscriberId

func (x *SubscriberRequest) GetSubscriberId() string

func (*SubscriberRequest) ProtoMessage

func (*SubscriberRequest) ProtoMessage()

func (*SubscriberRequest) ProtoReflect

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

func (*SubscriberRequest) Reset

func (x *SubscriberRequest) Reset()

func (*SubscriberRequest) String

func (x *SubscriberRequest) String() string

type UnimplementedSubscriberAPIServer

type UnimplementedSubscriberAPIServer struct {
}

UnimplementedSubscriberAPIServer must be embedded to have forward compatible implementations.

func (UnimplementedSubscriberAPIServer) GetSubscriber

func (UnimplementedSubscriberAPIServer) ListSubscribers

func (UnimplementedSubscriberAPIServer) Subscribe

func (UnimplementedSubscriberAPIServer) Unsubscribe

type UnsafeSubscriberAPIServer

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

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

Jump to

Keyboard shortcuts

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