Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Middleware ¶
type Middleware func(NotificationService) NotificationService
Middleware describes a service middleware.
func LoggingMiddleware ¶
func LoggingMiddleware(logger log.Logger) Middleware
LoggingMiddleware takes a logger as a dependency and returns a NotificationService Middleware.
type NotificationService ¶
type NotificationService interface { // Add your methods here SMS(ctx context.Context, to, body string) (message, status string, err error) SMST(ctx context.Context, to string, params map[string]string, template string) (message, status string, err error) Email(ctx context.Context, to, body string, data interface{}) (message, status string, err error) Verify(ctx context.Context, phone, code string) (message, status string, data interface{}, err error) }
NotificationService describes the service.
func New ¶
func New(middleware []Middleware) NotificationService
New returns a NotificationService with all of the expected middleware wired in.
func NewBasicNotificationService ¶
func NewBasicNotificationService() NotificationService
NewBasicNotificationService returns a naive, stateless implementation of NotificationService.
type StreamNotificationService ¶
type StreamNotificationService interface { // Store(ctx context.Context, code int, data map[string]interface{}) (err error) Store(ctx context.Context, code int, item notif.Notification) (err error) }
StreamNotificationService interface
var ( // Streamer var Streamer StreamNotificationService = &streamNotificationService{} )
Click to show internal directories.
Click to hide internal directories.