logs

package
v0.0.0-...-3cf4c9a Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2015 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Log = logs.NewLogger(10000)

Functions

func NewCySmtpWriter

func NewCySmtpWriter() LoggerInterface

create smtp writer.

Types

type CySmtpWriter

type CySmtpWriter struct {
	Username           string   `json:"Username"`
	Password           string   `json:"password"`
	Host               string   `json:"Host"`
	Subject            string   `json:"subject"`
	FromAddress        string   `json:"fromAddress"`
	RecipientAddresses []string `json:"sendTos"`
	Level              int      `json:"level"`
	Body               string
	// contains filtered or unexported fields
}

CySmtpWriter implements LoggerInterface and is used to send emails via given SMTP-server.

func (*CySmtpWriter) Destroy

func (s *CySmtpWriter) Destroy()

implementing method. empty.

func (*CySmtpWriter) Flush

func (s *CySmtpWriter) Flush()

implementing method. empty.

func (*CySmtpWriter) GetSmtpAuth

func (s *CySmtpWriter) GetSmtpAuth(host string) smtp.Auth

func (*CySmtpWriter) Init

func (s *CySmtpWriter) Init(jsonconfig string) error

init smtp writer with json config. config like:

{
	"Username":"example@gmail.com",
	"password:"password",
	"host":"smtp.gmail.com:465",
	"subject":"email title",
	"fromAddress":"from@example.com",
	"sendTos":["email1","email2"],
	"level":LevelError
}

func (*CySmtpWriter) WriteMsg

func (s *CySmtpWriter) WriteMsg(msg string, level int) error

write message in smtp writer. it will send an email with subject and only this message.

Jump to

Keyboard shortcuts

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