Documentation ¶
Overview ¶
Package subscriber is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Variables
- func RegisterSubscriberAPIHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterSubscriberAPIHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SubscriberAPIClient) error
- func RegisterSubscriberAPIHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterSubscriberAPIHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SubscriberAPIServer) error
- func RegisterSubscriberAPIServer(s *grpc.Server, srv SubscriberAPIServer)
- type Channel
- type GetSubscriberRequest
- func (*GetSubscriberRequest) Descriptor() ([]byte, []int)deprecated
- func (x *GetSubscriberRequest) GetSubscriberId() string
- func (*GetSubscriberRequest) ProtoMessage()
- func (x *GetSubscriberRequest) ProtoReflect() protoreflect.Message
- func (x *GetSubscriberRequest) Reset()
- func (x *GetSubscriberRequest) String() string
- type ListSubscribersFilter
- func (*ListSubscribersFilter) Descriptor() ([]byte, []int)deprecated
- func (x *ListSubscribersFilter) GetChannels() []string
- func (*ListSubscribersFilter) ProtoMessage()
- func (x *ListSubscribersFilter) ProtoReflect() protoreflect.Message
- func (x *ListSubscribersFilter) Reset()
- func (x *ListSubscribersFilter) String() string
- type ListSubscribersRequest
- func (*ListSubscribersRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ListSubscribersRequest) GetFilter() *ListSubscribersFilter
- func (x *ListSubscribersRequest) GetPageSize() int32
- func (x *ListSubscribersRequest) GetPageToken() string
- func (*ListSubscribersRequest) ProtoMessage()
- func (x *ListSubscribersRequest) ProtoReflect() protoreflect.Message
- func (x *ListSubscribersRequest) Reset()
- func (x *ListSubscribersRequest) String() string
- type ListSubscribersResponse
- func (*ListSubscribersResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ListSubscribersResponse) GetNextPageToken() string
- func (x *ListSubscribersResponse) GetSubscribers() []*Subscriber
- func (*ListSubscribersResponse) ProtoMessage()
- func (x *ListSubscribersResponse) ProtoReflect() protoreflect.Message
- func (x *ListSubscribersResponse) Reset()
- func (x *ListSubscribersResponse) String() string
- type Subscriber
- func (*Subscriber) Descriptor() ([]byte, []int)deprecated
- func (x *Subscriber) GetChannels() []*Channel
- func (x *Subscriber) GetDeviceToken() string
- func (x *Subscriber) GetEmail() string
- func (x *Subscriber) GetExternalId() string
- func (x *Subscriber) GetPhone() string
- func (x *Subscriber) GetSubscriberId() string
- func (*Subscriber) ProtoMessage()
- func (x *Subscriber) ProtoReflect() protoreflect.Message
- func (x *Subscriber) Reset()
- func (x *Subscriber) String() string
- type SubscriberAPIClient
- type SubscriberAPIServer
- type SubscriberRequest
- func (*SubscriberRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SubscriberRequest) GetChannelId() string
- func (x *SubscriberRequest) GetChannelName() string
- func (x *SubscriberRequest) GetSubscriberId() string
- func (*SubscriberRequest) ProtoMessage()
- func (x *SubscriberRequest) ProtoReflect() protoreflect.Message
- func (x *SubscriberRequest) Reset()
- func (x *SubscriberRequest) String() string
- type UnimplementedSubscriberAPIServer
- func (*UnimplementedSubscriberAPIServer) GetSubscriber(context.Context, *GetSubscriberRequest) (*Subscriber, error)
- func (*UnimplementedSubscriberAPIServer) ListSubscribers(context.Context, *ListSubscribersRequest) (*ListSubscribersResponse, error)
- func (*UnimplementedSubscriberAPIServer) Subscribe(context.Context, *SubscriberRequest) (*empty.Empty, error)
- func (*UnimplementedSubscriberAPIServer) Unsubscribe(context.Context, *SubscriberRequest) (*empty.Empty, error)
Constants ¶
This section is empty.
Variables ¶
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.
func RegisterSubscriberAPIServer ¶
func RegisterSubscriberAPIServer(s *grpc.Server, srv SubscriberAPIServer)
Types ¶
type Channel ¶ added in v0.6.0
type Channel struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` // contains filtered or unexported fields }
func (*Channel) Descriptor
deprecated
added in
v0.6.0
func (*Channel) GetChannelId ¶ added in v0.6.0
func (*Channel) ProtoMessage ¶ added in v0.6.0
func (*Channel) ProtoMessage()
func (*Channel) ProtoReflect ¶ added in v0.6.0
func (x *Channel) ProtoReflect() protoreflect.Message
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 (x *ListSubscribersRequest) GetFilter() *ListSubscribersFilter
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"` // contains filtered or unexported fields }
func (*ListSubscribersResponse) Descriptor
deprecated
func (*ListSubscribersResponse) Descriptor() ([]byte, []int)
Deprecated: Use ListSubscribersResponse.ProtoReflect.Descriptor instead.
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 []*Channel `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() []*Channel
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://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewSubscriberAPIClient ¶
func NewSubscriberAPIClient(cc grpc.ClientConnInterface) SubscriberAPIClient
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) }
SubscriberAPIServer is the server API for SubscriberAPI service.
type SubscriberRequest ¶
type SubscriberRequest struct { SubscriberId string `protobuf:"bytes,1,opt,name=subscriber_id,json=subscriberId,proto3" json:"subscriber_id,omitempty"` ChannelId string `protobuf:"bytes,2,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` ChannelName string `protobuf:"bytes,3,opt,name=channel_name,json=channelName,proto3" json:"channel_name,omitempty"` // contains filtered or unexported fields }
func (*SubscriberRequest) Descriptor
deprecated
func (*SubscriberRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubscriberRequest.ProtoReflect.Descriptor instead.
func (*SubscriberRequest) GetChannelId ¶ added in v0.6.0
func (x *SubscriberRequest) GetChannelId() string
func (*SubscriberRequest) GetChannelName ¶ added in v0.6.0
func (x *SubscriberRequest) GetChannelName() 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 can be embedded to have forward compatible implementations.
func (*UnimplementedSubscriberAPIServer) GetSubscriber ¶
func (*UnimplementedSubscriberAPIServer) GetSubscriber(context.Context, *GetSubscriberRequest) (*Subscriber, error)
func (*UnimplementedSubscriberAPIServer) ListSubscribers ¶
func (*UnimplementedSubscriberAPIServer) ListSubscribers(context.Context, *ListSubscribersRequest) (*ListSubscribersResponse, error)
func (*UnimplementedSubscriberAPIServer) Subscribe ¶
func (*UnimplementedSubscriberAPIServer) Subscribe(context.Context, *SubscriberRequest) (*empty.Empty, error)
func (*UnimplementedSubscriberAPIServer) Unsubscribe ¶
func (*UnimplementedSubscriberAPIServer) Unsubscribe(context.Context, *SubscriberRequest) (*empty.Empty, error)