companion

package
v0.0.0-...-586ce9b Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	v1.UnimplementedNotificationServiceServer
	*zap.Logger

	FirestoreClient *firestore.Client
	MessagingClient *messaging.Client

	// CollectionPrefix is used to define Firestore collection prefixes.
	// This is useful when there would be conflict with already existing collections
	CollectionPrefix string
	// contains filtered or unexported fields
}

Service is the implementation of the Notification API

func New

func New(ctx context.Context, projectID string, logger *zap.Logger, collectionPrefix string) (*Service, error)

New returns a new Service with configured firebase services

func (*Service) ListNotifications

func (s *Service) ListNotifications(ctx context.Context, r *v1.ListNotificationsRequest) (*v1.NotificationList, error)

func (*Service) PutInstance

func (s *Service) PutInstance(ctx context.Context, i *v1.AppInstance) (*empty.Empty, error)

func (*Service) Register

func (s *Service) Register(server *grpc.Server)

Register registers this service to the provided grpc server

func (*Service) RegisterGateway

func (s *Service) RegisterGateway(ctx context.Context, mux *runtime.ServeMux, bind string, opts []grpc.DialOption) error

RegisterGateway registers this service to the provided http mux

func (*Service) RemoveInstance

func (s *Service) RemoveInstance(ctx context.Context, r *v1.RemoveInstanceRequest) (*empty.Empty, error)

func (*Service) RemoveToken

func (s *Service) RemoveToken(ctx context.Context, r *v1.RemoveTokenRequest) (*empty.Empty, error)

func (*Service) Send

func (s *Service) Send(ctx context.Context, r *v1.SendRequest) (*empty.Empty, error)

func (*Service) SendAll

func (s *Service) SendAll(ctx context.Context, r *v1.SendAllRequest) (*empty.Empty, error)

func (*Service) SendMulticast

func (s *Service) SendMulticast(ctx context.Context, r *v1.SendMulticastRequest) (*empty.Empty, error)

Jump to

Keyboard shortcuts

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