notif

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: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EMAIL for get Email object
	EMAIL notification = "EMAIL"

	// SMS for get sms object
	SMS notification = "SMS"
)

Variables

This section is empty.

Functions

func GetType

func GetType(t string) notification

GetType for types we use when need to send a notif

Types

type Notification

type Notification struct {
	Data    interface{} `json:"data"`
	Message string      `json:"message"`
	KEY     string      `json:"key"`
	Type    string      `json:"type"`
	// contains filtered or unexported fields
}

Notification struct

type Notifier

type Notifier interface {
	SendWithTemplate(ctx context.Context, notif Notification, params []Params, template string) error
	SendWithBody(ctx context.Context, notif Notification, options ...Option) error
}

Notifier interface

func GetNotifier

func GetNotifier(t notification) (Notifier, error)

GetNotifier func

type Option

type Option func(*Notification)

Option func for SMS

func Line

func Line(line string) Option

Line Option func you can specifically send a notif from a line examples: PHONE_NUMBER, EMAIL_ADDRESS,....

func SendDateTime

func SendDateTime(time string) Option

SendDateTime Option func you can specifically send a notif in specific time

type Params

type Params struct {
	Parameter      string
	ParameterValue interface{}
}

Params struct

Jump to

Keyboard shortcuts

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