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 ¶
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 ¶
type MongoConfig ¶
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.