service

package
v0.0.0-...-618fe63 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Middleware

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{}
)

Jump to

Keyboard shortcuts

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