watch

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2014 License: MIT Imports: 5 Imported by: 9

Documentation

Index

Constants

View Source
const (
	DELIVERY_MODE_POSTBACK = "postback"
	DELIVERY_MODE_LOGGER   = "logger"
)

Variables

View Source
var (
	DefaultLogger  = log.New(os.Stdout, "[watch] ", log.LstdFlags)
	DELIVERY_MODES = map[string]bool{
		DELIVERY_MODE_POSTBACK: true,
		DELIVERY_MODE_LOGGER:   true}
)

Functions

func DeliveryModeValid

func DeliveryModeValid(mode string) bool

func ValidDeliveryModes

func ValidDeliveryModes() []string

Types

type Flags

type Flags struct {
	Host          string
	Port          uint
	Ssl           bool
	Username      string
	Password      string
	Mailbox       string
	Mode          string
	PostbackUrl   string
	PostEncoded   bool
	PostParamName string
}

func NewFlags

func NewFlags() *Flags

type Watch

type Watch struct {
	// contains filtered or unexported fields
}

func New

func New(flags *Flags, handlers ...handler.MessageHandler) *Watch

func (*Watch) AddHandler

func (w *Watch) AddHandler(handler handler.MessageHandler)

func (*Watch) Handlers

func (w *Watch) Handlers() []handler.MessageHandler

func (*Watch) Logger

func (w *Watch) Logger() *log.Logger

func (*Watch) Mailbox

func (w *Watch) Mailbox() string

func (*Watch) SetLogger

func (w *Watch) SetLogger(logger *log.Logger)

func (*Watch) SetMailbox

func (w *Watch) SetMailbox(value string)

func (*Watch) Start

func (w *Watch) Start()

func (*Watch) Stop

func (w *Watch) Stop()

type Watcher

type Watcher interface {
	Start()
	Stop()
}

Jump to

Keyboard shortcuts

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