messages

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 5 Imported by: 0

README

messages

send text(template) message to different location(email, lark, phone)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(msg Message, locations ...Location) error

Add bind message with specific pattern and specific sending locations

func Send

func Send(msg Message) error

Send msg

Types

type Location

type Location interface {
	Send(msg Message, data string) error
}

Location is a end point which used to receive message

type Message

type Message interface {
	Name() string
	//Template return tmpl string which used to build template
	//instance. due to go do not support struct statis property
	//is not easy to impl a method which return template instance
	Template() string
}

Message a text temlpate message instance which send to location

Jump to

Keyboard shortcuts

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