notification

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package notification provides functions to manage notification after running service application

Index

Constants

View Source
const (
	// ConstKeyNotiChan is key of notification channel
	ConstKeyNotiChan = "NotiChan"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ConcurrentMap

type ConcurrentMap struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ConcurrentMap type

func (*ConcurrentMap) Get

func (cm *ConcurrentMap) Get(key uint64) (interface{}, bool)

Get is for getting map item

func (*ConcurrentMap) Remove

func (cm *ConcurrentMap) Remove(key uint64)

Remove is for removing map item

func (*ConcurrentMap) Set

func (cm *ConcurrentMap) Set(key uint64, value interface{})

Set is for setting map item

type ConcurrentMapItem

type ConcurrentMapItem struct {
	Key   uint64
	Value interface{}
}

ConcurrentMapItem type

type HasNotification

type HasNotification struct {
	NotiImplIns Notification
}

HasNotification struct

func (*HasNotification) SetNotiImpl

func (n *HasNotification) SetNotiImpl(noti Notification)

SetNotiImpl for setting notification implementation

type NotiImpl

type NotiImpl struct {
	client.HasClient
}

NotiImpl Structure

func GetInstance

func GetInstance() *NotiImpl

GetInstance returns the singleton NotiImpl instance

func (NotiImpl) AddNotificationChan

func (NotiImpl) AddNotificationChan(serviceID uint64, notiChan chan string)

AddNotificationChan is adding notification channel value with service ID key

func (NotiImpl) HandleNotificationOnLocal

func (NotiImpl) HandleNotificationOnLocal(serviceID float64, status string) (err error)

HandleNotificationOnLocal is invoking notification on local

func (NotiImpl) InvokeNotification

func (n NotiImpl) InvokeNotification(target string, serviceID float64, status string) (err error)

InvokeNotification is processing notification

type Notification

type Notification interface {
	InvokeNotification(target string, serviceID float64, status string) error
	AddNotificationChan(serviceID uint64, notiChan chan string)
	HandleNotificationOnLocal(serviceID float64, status string) (err error)

	// for client
	client.Setter
}

Notification is the interface for notification

Directories

Path Synopsis
Package mock_notification is a generated GoMock package.
Package mock_notification is a generated GoMock package.

Jump to

Keyboard shortcuts

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