Documentation ¶
Overview ¶
Copyright 2019 The OpenPitrix Authors. All rights reserved. Use of this source code is governed by a Apache license that can be found in the LICENSE file.
Index ¶
- Constants
- Variables
- func AddressListSet2PbSet(inAddrLists []*AddressList) []*pb.AddressList
- func AddressListToPb(addressList *AddressList) *pb.AddressList
- func AddressWithListIdSet2PbSet(inAddrs []*AddressWithListId) []*pb.Address
- func AddressWithListIdToPb(addressWithListId *AddressWithListId) *pb.Address
- func CheckExtra(ctx context.Context, extraStr string) error
- func DecodeNotificationExtra(data string) (*map[string]string, error)
- func DecodeNotificationExtra4ws(data string) (ws_service string, ws_message_type string)
- func EmailConfigToPb(emailConfig *EmailConfig) *pb.EmailServiceConfig
- func MessageDetailToPb(userMsgDetail *MessageDetail) *pb.MessageDetail
- func NewAddressId() string
- func NewAddressListBindingId() string
- func NewAddressListId() string
- func NewNFAddressListId() string
- func NewNotificationId() string
- func NewTaskId() string
- func NewWsMessageId() string
- func NotificationSet2PbSet(inNfs []*Notification) []*pb.Notification
- func NotificationToPb(notification *Notification) *pb.Notification
- func TaskSet2PbSet(inTasks []*Task) []*pb.Task
- func TaskToPb(task *Task) *pb.Task
- func UseMsgStringToPb(dataStr string) (*pb.UserMessage, error)
- func UserMessageToPb(userMsg *UserMessage) *pb.UserMessage
- type Address
- type AddressInfo
- type AddressList
- type AddressListBinding
- type AddressListIds
- type AddressWithListId
- type Content
- type EmailConfig
- type MessageDetail
- type NFAddressList
- type Notification
- type NotificationExtra
- type Receiver
- type Task
- type TaskDirective
- type TaskWithNfInfo
- type UserMessage
Constants ¶
View Source
const ( AddrColId = "address_id" AddrColAddress = "address" AddrColRemarks = "remarks" AddrColVerificationCode = "verification_code" AddrColCreateTime = "create_time" AddrColVerifyTime = "verify_time" AddrColStatusTime = "status_time" AddrColNotifyType = "notify_type" AddrColStatus = "status" )
field name Addr is short for Address.
View Source
const ( AddrLsColId = "address_list_id" AddrLsColName = "address_list_name" AddrLsColExtra = "extra" AddrLsColStatus = "status" AddrLsColCreateTime = "create_time" AddrLsColStatusTime = "status_time" )
field name AddrLs is short for AddressList.
View Source
const ( BindColId = "binding_id" BindColAddrListId = "address_list_id" BindColAddrId = "address_id" BindColCreateTime = "create_time" )
field name Bind is short for AddressListBinding.
View Source
const ( EmailCfgColProtocol = "protocol" EmailCfgColEmailHost = "email_host" EmailCfgColPort = "port" EmailCfgColDisplaySender = "display_sender" EmailCfgColEmail = "email" EmailCfgColPassword = "password" EmailCfgColSSLEnable = "ssl_enable" EmailCfgColCreateTime = "create_time" EmailCfgColStatusTime = "status_time" )
field name
View Source
const ( NFAddrLsColId = "nf_address_list_id" NFAddrLsColLsId = "address_list_id" NFAddrLsColNfId = "notification_id" )
field name NFAddrLs is short for NFAddressList.
View Source
const ( NfColId = "notification_id" NfColContentType = "content_type" NfColTitle = "title" NfColContent = "content" NfColShortContent = "short_content" NfColExpiredDays = "expired_days" NfColAddressInfo = "address_info" NfColOwner = "owner" NfColStatus = "status" NfColCreateTime = "create_time" NfColStatusTime = "status_time" )
field name Nf is short for notification.
View Source
const ( ContentTypeInvite = "invite" ContentTypeVerify = "verify" ContentTypeFee = "fee" ContentTypeBusiness = "business" ContentTypeAlerting = "alert" ContentTypeOther = "other" ContentTypeEvent = "event" )
constants
View Source
const ( ServiceCfgProtocol = "protocol" ServiceCfgEmailHost = "email_host" ServiceCfgPort = "port" ServiceCfgDisplayEmail = "display_email" ServiceCfgEmail = "email" ServiceCfgPassword = "password" )
View Source
const ( ProtocolTypeSMTP = "SMTP" ProtocolTypePOP3 = "POP3" ProtocolTypeIMAP = "IMAP" )
View Source
const ( TaskColNfId = "notification_id" TaskColTaskId = "task_id" TaskColStatus = "status" TaskColErrorCode = "error_code" TaskColCreateTime = "create_time" )
field name Nf is short for notification.
View Source
const (
AddressIdPrefix = "addr-"
)
View Source
const (
AddressListBindingIdPrefix = "bid-"
)
View Source
const (
AddressListIdPrefix = "adl-"
)
View Source
const (
NFAddressListIdPrefix = "nfa-"
)
View Source
const (
NotificationIdPrefix = "nf-"
)
ID Prefix
View Source
const (
ServiceType = "service_type"
)
View Source
const (
TableAddress = "address"
)
table name
View Source
const (
TableAddressList = "address_list"
)
table name
View Source
const (
TableAddressListBinding = "address_list_binding"
)
table name
View Source
const (
TableEmailConfig = "email_config"
)
table name
View Source
const (
TableNFAddressList = "nf_address_list"
)
table name
View Source
const (
TableNotification = "notification"
)
table name
View Source
const (
TableTask = "task"
)
table name
View Source
const (
TaskIdPrefix = "t-"
)
View Source
const (
WsMessageIdPrefix = "msg-"
)
Variables ¶
View Source
var ContentTypes = []string{ ContentTypeInvite, ContentTypeVerify, ContentTypeFee, ContentTypeBusiness, ContentTypeAlerting, ContentTypeOther, ContentTypeEvent, }
View Source
var IndexedColumns = map[string][]string{ TableNotification: { NfColId, NfColContentType, NfColOwner, NfColStatus, }, TableTask: { TaskColTaskId, TaskColNfId, TaskColErrorCode, TaskColStatus, }, TableAddress: { AddrColId, AddrColAddress, AddrColNotifyType, AddrColStatus, }, TableAddressList: { AddrLsColId, AddrLsColName, AddrLsColExtra, AddrLsColStatus, }, }
columns that can be search through sql '=' operator
View Source
var ProtocolTypes = []string{ ProtocolTypeSMTP, ProtocolTypePOP3, ProtocolTypeIMAP, }
View Source
var SearchColumns = map[string][]string{ TableNotification: { NfColId, NfColContentType, NfColTitle, NfColShortContent, NfColAddressInfo, NfColStatus, NfColOwner, }, TableTask: { TaskColTaskId, TaskColNfId, TaskColStatus, TaskColErrorCode, }, TableAddress: { AddrColId, AddrColAddress, AddrColNotifyType, AddrColRemarks, }, TableAddressList: { AddrLsColId, AddrLsColName, AddrLsColName, AddrLsColExtra, }, }
columns that can be search through sql 'like' operator
View Source
var SearchWordColumnTable = []string{ TableNotification, TableTask, TableAddress, TableAddressList, }
Functions ¶
func AddressListSet2PbSet ¶
func AddressListSet2PbSet(inAddrLists []*AddressList) []*pb.AddressList
func AddressListToPb ¶
func AddressListToPb(addressList *AddressList) *pb.AddressList
func AddressWithListIdSet2PbSet ¶
func AddressWithListIdSet2PbSet(inAddrs []*AddressWithListId) []*pb.Address
func AddressWithListIdToPb ¶
func AddressWithListIdToPb(addressWithListId *AddressWithListId) *pb.Address
func DecodeNotificationExtra ¶
func EmailConfigToPb ¶
func EmailConfigToPb(emailConfig *EmailConfig) *pb.EmailServiceConfig
func MessageDetailToPb ¶
func MessageDetailToPb(userMsgDetail *MessageDetail) *pb.MessageDetail
func NewAddressId ¶
func NewAddressId() string
func NewAddressListBindingId ¶
func NewAddressListBindingId() string
func NewAddressListId ¶
func NewAddressListId() string
func NewNFAddressListId ¶
func NewNFAddressListId() string
func NewNotificationId ¶
func NewNotificationId() string
func NewWsMessageId ¶
func NewWsMessageId() string
func NotificationSet2PbSet ¶
func NotificationSet2PbSet(inNfs []*Notification) []*pb.Notification
func NotificationToPb ¶
func NotificationToPb(notification *Notification) *pb.Notification
func TaskSet2PbSet ¶
func UseMsgStringToPb ¶
func UseMsgStringToPb(dataStr string) (*pb.UserMessage, error)
func UserMessageToPb ¶
func UserMessageToPb(userMsg *UserMessage) *pb.UserMessage
Types ¶
type Address ¶
type Address struct { AddressId string `gorm:"column:address_id"` Address string `gorm:"column:address"` Remarks string `gorm:"column:remarks"` VerificationCode string `gorm:"column:verification_code"` CreateTime time.Time `gorm:"column:create_time"` VerifyTime time.Time `gorm:"column:verify_time"` StatusTime time.Time `gorm:"column:status_time"` NotifyType string `gorm:"column:notify_type"` Status string `gorm:"column:status"` }
func NewAddress ¶
func NewAddress(req *pb.CreateAddressRequest) *Address
type AddressInfo ¶
func DecodeAddressInfo ¶
func DecodeAddressInfo(data string) (*AddressInfo, error)
type AddressList ¶
type AddressList struct { AddressListId string `gorm:"column:address_list_id"` AddressListName string `gorm:"column:address_list_name"` Extra string `gorm:"column:extra"` Status string `gorm:"column:status"` CreateTime time.Time `gorm:"column:create_time"` StatusTime time.Time `gorm:"column:status_time"` }
func NewAddressList ¶
func NewAddressList(req *pb.CreateAddressListRequest) *AddressList
type AddressListBinding ¶
type AddressListIds ¶
type AddressListIds []string
func DecodeAddressListIds ¶
func DecodeAddressListIds(data string) (*AddressListIds, error)
type AddressWithListId ¶
type AddressWithListId struct { AddressId string `gorm:"column:address_id"` AddressListId string `gorm:"column:address_list_id"` Address string `gorm:"column:address"` Remarks string `gorm:"column:remarks"` VerificationCode string `gorm:"column:verification_code"` CreateTime time.Time `gorm:"column:create_time"` VerifyTime time.Time `gorm:"column:verify_time"` StatusTime time.Time `gorm:"column:status_time"` NotifyType string `gorm:"column:notify_type"` Status string `gorm:"column:status"` }
type Content ¶
func DecodeContent ¶
type EmailConfig ¶
type EmailConfig struct { Protocol string `gorm:"column:protocol"` EmailHost string `gorm:"column:email_host"` Port uint32 `gorm:"column:port"` DisplaySender string `gorm:"column:display_sender"` Email string `gorm:"column:email"` Password string `gorm:"column:password"` SSLEnable bool `gorm:"column:ssl_enable"` CreateTime time.Time `gorm:"column:create_time"` StatusTime time.Time `gorm:"column:status_time"` }
func NewEmailConfig ¶
func NewEmailConfig(req *pb.ServiceConfig) *EmailConfig
type MessageDetail ¶
type MessageDetail struct { MessageId string `json:"ws_message_id,omitempty"` UserId string `json:"ws_user_id,omitempty"` Service string `json:"ws_service,omitempty"` MessageType string `json:"ws_message_type,omitempty"` MessageContent string `json:"ws_message,omitempty"` }
func PbToMessageDetail ¶
func PbToMessageDetail(pbMsgDetail *pb.MessageDetail) *MessageDetail
type NFAddressList ¶
type Notification ¶
type Notification struct { NotificationId string `gorm:"column:notification_id"` ContentType string `gorm:"column:content_type"` Title string `gorm:"column:title"` Content string `gorm:"column:content"` ShortContent string `gorm:"column:short_content"` ExpiredDays uint32 `gorm:"column:expired_days"` AddressInfo string `gorm:"column:address_info"` Owner string `gorm:"column:owner"` Status string `gorm:"column:status"` CreateTime time.Time `gorm:"column:create_time"` StatusTime time.Time `gorm:"column:status_time"` AvailableStartTime string `gorm:"column:available_start_time"` AvailableEndTime string `gorm:"column:available_end_time"` Extra string `gorm:"column:extra"` }
func NewNotification ¶
func NewNotification(req *pb.CreateNotificationRequest) *Notification
type NotificationExtra ¶
type Task ¶
type Task struct { TaskId string `gorm:"column:task_id"` NotificationId string `gorm:"column:notification_id"` ErrorCode int64 `gorm:"column:error_code"` Status string `gorm:"column:status"` CreateTime time.Time `gorm:"column:create_time"` StatusTime time.Time `gorm:"column:status_time"` Directive string `gorm:"column:directive"` NotifyType string `gorm:"column:notify_type"` }
type TaskDirective ¶
type TaskDirective struct { NotificationId string Address string NotifyType string ContentType string Title string Content string ShortContent string ExpiredDays uint32 AvailableStartTime string AvailableEndTime string }
func DecodeTaskDirective ¶
func DecodeTaskDirective(data string) (*TaskDirective, error)
type TaskWithNfInfo ¶
type UserMessage ¶
type UserMessage struct { UserId string `json:"user_id,omitempty"` Service string `json:"service,omitempty"` MessageType string `json:"message_type,omitempty"` MessageDetail MessageDetail }
func PbToUserMessage ¶
func PbToUserMessage(pbUserMsg *pb.UserMessage) *UserMessage
Click to show internal directories.
Click to hide internal directories.