Documentation
¶
Index ¶
- Constants
- func AuthInterceptor(acl []string, tlsEnabled bool) grpc.UnaryServerInterceptor
- func NewGRPCServer(cfg *config.Config) *grpc.Server
- func StatusInterceptor(srv *PushService) grpc.UnaryServerInterceptor
- type PushService
- func (ps *PushService) ActivateSubscription(ctx context.Context, r *amsPb.ActivateSubscriptionRequest) (*amsPb.ActivateSubscriptionResponse, error)
- func (ps *PushService) DeactivateSubscription(ctx context.Context, r *amsPb.DeactivateSubscriptionRequest) (*amsPb.DeactivateSubscriptionResponse, error)
- func (ps *PushService) IsSubActive(name string) bool
- func (ps *PushService) Status(context.Context, *amsPb.StatusRequest) (*amsPb.StatusResponse, error)
- func (ps *PushService) SubscriptionStatus(ctx context.Context, r *amsPb.SubscriptionStatusRequest) (*amsPb.SubscriptionStatusResponse, error)
Constants ¶
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 ¶
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 ¶
func (ps *PushService) ActivateSubscription(ctx context.Context, r *amsPb.ActivateSubscriptionRequest) (*amsPb.ActivateSubscriptionResponse, error)
ActivateSubscription activates a subscription so the service can start handling the push functionality
func (*PushService) DeactivateSubscription ¶
func (ps *PushService) DeactivateSubscription(ctx context.Context, r *amsPb.DeactivateSubscriptionRequest) (*amsPb.DeactivateSubscriptionResponse, error)
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 ¶
func (ps *PushService) Status(context.Context, *amsPb.StatusRequest) (*amsPb.StatusResponse, error)
Status returns the stat of the service, whether or not it is functioning properly
func (*PushService) SubscriptionStatus ¶
func (ps *PushService) SubscriptionStatus(ctx context.Context, r *amsPb.SubscriptionStatusRequest) (*amsPb.SubscriptionStatusResponse, error)
SubscriptionStatus returns the status of the worker that handles the respective subscription