tools

package
v0.0.0-...-301f747 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package tools provides various helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APNSSender

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

func NewAPNSSender

func NewAPNSSender(cert string, key string, sandbox bool) *APNSSender

func (*APNSSender) Send

func (s *APNSSender) Send(to, subject, message string) error

type ConnCloser

type ConnCloser interface {
	Close()
}

The ConnCloser interface provides an abstraction to close a db connection.

type EmailConfig

type EmailConfig struct {
	URL      string
	User     string
	Password string
}

EmailConfig contains email server configuration.

type EmailSender

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

EmailSender is a helper for sending mails using smtp

func NewEmailSender

func NewEmailSender(config *EmailConfig) *EmailSender

NewEmailSender creates a new email sender object.

func (*EmailSender) Send

func (sender *EmailSender) Send(to, subject, message string) error

Send sends a message to the specified email.

type GCMSender

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

func NewGCMSender

func NewGCMSender(apiKey string) *GCMSender

func (*GCMSender) Send

func (s *GCMSender) Send(to, subject, message string) error

type MongoConfig

type MongoConfig struct {
	URL      string
	Name     string
	User     string
	Password string
}

MongoConfig contains the configuration of the database server.

type MongoHelper

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

MongoHelper handles connection to a mongodb database.

func NewMongoHelper

func NewMongoHelper(dbConfig *MongoConfig) *MongoHelper

NewMongoHelper creates a new MongoStore object.

func (*MongoHelper) Client

func (hndl *MongoHelper) Client() (*mgo.Database, ConnCloser)

Client returns a connection from the connection pool using the database in the configuration. It is the caller's responsability to close the connection using the ConnCloser.

type Sender

type Sender interface {
	Send(to, subject, message string) error
}

Sender provides an interface for sending messages.

Jump to

Keyboard shortcuts

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