grpc

package
v0.0.0-...-e72c3ba Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceUnavailable = "The push service is currently unable to handle any requests"

Variables

This section is empty.

Functions

func AuthInterceptor

func AuthInterceptor(acl []string, tlsEnabled bool) grpc.UnaryServerInterceptor

AuthInterceptor provides ACL based access to the service using certificate DNs

func NewGRPCServer

func NewGRPCServer(cfg *config.Config) *grpc.Server

NewGRPCServer configures and returns a new *grpc.Server

func StatusInterceptor

func StatusInterceptor(srv *PushService) grpc.UnaryServerInterceptor

StatusInterceptor is used in order to check, depending on the service's status if the call should be continued or not

Types

type PushService

type PushService struct {
	Cfg         *config.Config
	Client      *http.Client
	AmsClient   *ams.Client
	PushWorkers map[string]push.Worker
	// contains filtered or unexported fields
}

PushService holds all the the information and functionality regarding the push implementation

func NewPushService

func NewPushService(cfg *config.Config) *PushService

NewPushService returns a pointer to a PushService and initialises its fields

func (*PushService) ActivateSubscription

ActivateSubscription activates a subscription so the service can start handling the push functionality

func (*PushService) DeactivateSubscription

DeactivateSubscription deactivates a subscription so the service can stop handling the push functionality for it

func (*PushService) IsSubActive

func (ps *PushService) IsSubActive(name string) bool

IsSubActive checks by subscription name, whether or not a subscription is already active

func (*PushService) Status

Status returns the stat of the service, whether or not it is functioning properly

func (*PushService) SubscriptionStatus

SubscriptionStatus returns the status of the worker that handles the respective subscription

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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