pusher

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2021 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package pusher is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_pusher_proto protoreflect.FileDescriptor

Functions

func RegisterPushMessagingHandler

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

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

func RegisterPushMessagingHandlerClient

func RegisterPushMessagingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PushMessagingClient) error

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

func RegisterPushMessagingHandlerFromEndpoint

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

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

func RegisterPushMessagingHandlerServer

func RegisterPushMessagingHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PushMessagingServer) error

RegisterPushMessagingHandlerServer registers the http handlers for service PushMessaging to "mux". UnaryRPC :call PushMessagingServer 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 RegisterPushMessagingHandlerFromEndpoint instead.

func RegisterPushMessagingServer

func RegisterPushMessagingServer(s grpc.ServiceRegistrar, srv PushMessagingServer)

Types

type PushMessage

type PushMessage struct {
	DeviceTokens []string          `protobuf:"bytes,2,rep,name=device_tokens,json=deviceTokens,proto3" json:"device_tokens,omitempty"`
	Title        string            `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"`
	Message      string            `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Details      map[string]string `` /* 155-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*PushMessage) Descriptor deprecated

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

Deprecated: Use PushMessage.ProtoReflect.Descriptor instead.

func (*PushMessage) GetDetails

func (x *PushMessage) GetDetails() map[string]string

func (*PushMessage) GetDeviceTokens

func (x *PushMessage) GetDeviceTokens() []string

func (*PushMessage) GetMessage

func (x *PushMessage) GetMessage() string

func (*PushMessage) GetTitle

func (x *PushMessage) GetTitle() string

func (*PushMessage) ProtoMessage

func (*PushMessage) ProtoMessage()

func (*PushMessage) ProtoReflect

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

func (*PushMessage) Reset

func (x *PushMessage) Reset()

func (*PushMessage) String

func (x *PushMessage) String() string

type PushMessagingClient

type PushMessagingClient interface {
	// Sends push message
	SendPushMessage(ctx context.Context, in *PushMessage, opts ...grpc.CallOption) (*empty.Empty, error)
}

PushMessagingClient is the client API for PushMessaging 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 PushMessagingServer

type PushMessagingServer interface {
	// Sends push message
	SendPushMessage(context.Context, *PushMessage) (*empty.Empty, error)
	// contains filtered or unexported methods
}

PushMessagingServer is the server API for PushMessaging service. All implementations must embed UnimplementedPushMessagingServer for forward compatibility

type UnimplementedPushMessagingServer

type UnimplementedPushMessagingServer struct {
}

UnimplementedPushMessagingServer must be embedded to have forward compatible implementations.

func (UnimplementedPushMessagingServer) SendPushMessage

type UnsafePushMessagingServer

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

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

Jump to

Keyboard shortcuts

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