models

package
v0.11.4 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package models contains shared data resource Project Gonder. Author Supme Copyright Supme 2016 License http://opensource.org/licenses/MIT MIT License

THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
PURPOSE.

Please see the License.txt file for more information.

Index

Constants

View Source
const (
	OpenTrace   = "open_trace"
	WebVersion  = "web_version"
	Unsubscribe = "unsubscribe"

	StatusUnavaibleRecentTime = "Unavaible recent time"
	StatusUnsubscribe         = "Unsubscribe"
	StatusSending             = "Sending"
)

Variables

View Source
var (
	Db     *sql.DB
	Config config
)
View Source
var EmailPool emailPool

Functions

func BytesToString

func BytesToString(b []byte) string

Null memory allocate convert

func Conv1st2nd

func Conv1st2nd(num int) string

func EncodeUTM

func EncodeUTM(cmd, data string, params map[string]interface{}) string

func GetIP

func GetIP(r *http.Request) string

func Init

func Init()

func InitEmailPool

func InitEmailPool() error

func StringToBytes

func StringToBytes(s string) []byte

func WorkDir added in v0.11.3

func WorkDir(path string) string

Types

type Message

type Message struct {
	RecipientID    string // ToDo int?
	RecipientEmail string
	RecipientName  string
	RecipientParam map[string]string
	CampaignID     string // ToDo int?
}

func DecodeUTM

func DecodeUTM(base64data string) (message Message, data string, err error)

Decode utm data string and return Message whis prefilled id and email

func (*Message) New

func (m *Message) New(recipientID string) error

func (*Message) Unsubscribe

func (m *Message) Unsubscribe(extra map[string]string) error

Unsubscribe recipient from group ToDo move to campaign/Recipient

func (*Message) UnsubscribeTemplateDir

func (m *Message) UnsubscribeTemplateDir() (name string)

ToDo move to campaign/Recipient

Jump to

Keyboard shortcuts

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