model

package
v0.0.0-...-71395a5 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2016 License: GPL-3.0 Imports: 1 Imported by: 4

Documentation

Index

Constants

View Source
const (
	CollSMSHistory   = "sms_history"
	CollSMStatus     = "sms_status"
	CollSMSReply     = "sms_reply"
	CollUnsubscriber = "sms_unsubscriber"
)
View Source
const (
	SMSStateChecked   = 1
	SMSStateUnchecked = 2
	SMSStateFailed    = 5
)

Variables

This section is empty.

Functions

func NewSmsContextID

func NewSmsContextID() int64

Types

type DeliveryStatus

type DeliveryStatus struct {
	MsgID      int64     `bson:"msg_id" json:"msg_id"`
	Timestamp  time.Time `bson:"timestamp" json:"timestamp"`
	Phone      string    `bson:"phone" json:"phone"`
	StatusCode int32     `bson:"status_code" json:"status_code"`
	ErrorMsg   string    `bson:"error_msg" json:"error_msg"`
}

type Reply

type Reply struct {
	Timestamp time.Time `bson:"timestamp" json:"timestamp"`
	Phone     string    `bson:"phone" json:"phone"`
	Msg       string    `bson:"msg" json:"msg"`
}

type SMSContext

type SMSContext struct {
	ID        int64             `json:"id"`
	Phone     string            `json:"phone"`
	Template  string            `json:"template"`
	Variables map[string]string `json:"variables"`
	History   *SMSHistory       `json:"sms_history,omitempty"`
}

func NewSMSContext

func NewSMSContext(id int64, phone string, template string, variables map[string]string) *SMSContext

type SMSHistory

type SMSHistory struct {
	MID       int64     `bson:"mid" json:"mid"`
	MsgID     int64     `bson:"msg_id" json:"msg_id"`
	Timestamp time.Time `bson:"timestamp" json:"timestamp"`
	Phone     string    `bson:"phone" json:"phone"`
	Content   string    `bson:"content" json:"content"`
	Template  string    `bson:"template" json:"template"`
	Category  string    `bson:"category" json:"category"`
	Channel   int       `bson:"channel" json:"channel"`
	Vendor    string    `bson:"vendor" json:"vendor"`
	State     SMSState  `bson:"state" json:"state"`
}

type SMSState

type SMSState int

type Unsubscriber

type Unsubscriber struct {
	Timestamp time.Time `bson:"timestamp" json:"timestamp"`
	Phone     string    `bson:"phone" json:"phone"`
}

Jump to

Keyboard shortcuts

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