notification

package
v0.0.0-...-a7d487d Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthSmtpServer

func AuthSmtpServer() smtp.Auth

func Initsocket

func Initsocket()

func SendMultipleNotifications

func SendMultipleNotifications(message *messaging.Message, rec []string) error

func SendToastNotification

func SendToastNotification(message *messaging.Message) (string, error)

send muluticast

func SendWebhook

func SendWebhook(url string, body []byte) bool

Types

type EmailMessage

type EmailMessage struct {
	Body     string
	Receiver []string
	Subject  string
	Mime     string
	Host     string
}

func (EmailMessage) SendEmail

func (e EmailMessage) SendEmail() error

type Event

type Event struct {
	Name    string
	Message interface{}
}

type SMS

type SMS struct {
	To      string
	Message string
}

func (SMS) Send

func (sms SMS) Send() error

type Socket

type Socket struct {
	Clients map[string]*websocket.Conn
	Send    func(*websocket.Conn, Event) error
}
var ClientSocket Socket = Socket{
	Send:    broadcast,
	Clients: make(map[string]*websocket.Conn),
}
var DriverSocket Socket = Socket{
	Send:    broadcast,
	Clients: make(map[string]*websocket.Conn),
}
var MerchantSocket Socket = Socket{
	Send:    broadcast,
	Clients: make(map[string]*websocket.Conn),
}

func (*Socket) Broadcast

func (s *Socket) Broadcast(message Event)

func (*Socket) CloseHandler

func (s *Socket) CloseHandler(code int, text string)

func (*Socket) Listen

func (s *Socket) Listen(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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