Documentation
¶
Index ¶
- Constants
- func BeginTx(rdb *redis.Client, cb func(tx *redis.Tx) error, keys ...string) error
- func BuildFieldQuery[T any](ydb *gorm.DB, newObj *T, queryFields []string) (*gorm.DB, error)
- func Commit(rdb *redis.Client, cb func(pipe redis.Pipeliner) error) error
- func CommitTx(tx *redis.Tx, cb func(pipe redis.Pipeliner) error) error
- func DeleteMail(ydb *gorm.DB, userID, mailID int64) (int64, error)
- func Getter[T any, PT SetGetter[T]](rdb *redis.Client, key string) (*T, bool, error)
- func InitMysql(conf *xcm.MysqlConfig) (*gorm.DB, *ssh.Client, error)
- func InitRedis(conf *xcm.RedisConfig) (*redis.Client, *ssh.Client, error)
- func Insert[T any](ydb *gorm.DB, newObj *T, queryFields []string) (*T, bool, error)
- func InsertMail(ydb *gorm.DB, mail *Mail) (int64, error)
- func MysqlOverSsh(dsn string, cli *ssh.Client) string
- func NewRedisOptions(addr, user, pass string, db int) *redis.Options
- func NewRedisOptionsWithUrl(url string) *redis.Options
- func PickMailAttachments(ydb *gorm.DB, userID, mailID int64, ...) error
- func RedisOverSsh(opt *redis.Options, cli *ssh.Client) (*redis.Client, error)
- func Setter[T any](key string, t *T) func(redis.Pipeliner) error
- type AttachmentsType
- type Mail
- type SetGetter
Constants ¶
View Source
const ( MailVisibleNormal = "normal" MailVisibleHidden = "hidden" )
View Source
const ( MailSourceTypeSystem = "system" MailSourceTypeUser = "user" )
View Source
const ( MailReceiveTypeOnce = "once" MailReceiveTypeUnlimit = "unlimit" )
View Source
const (
NotDeleted = "deleted_at IS NULL"
)
Variables ¶
This section is empty.
Functions ¶
func BuildFieldQuery ¶
func NewRedisOptionsWithUrl ¶
func PickMailAttachments ¶
Types ¶
type AttachmentsType ¶
type Mail ¶
type Mail struct {
gorm.Model `json:"model"`
UserID int64 `json:"user_id" gorm:"column:user_id;not null"`
VisibleType string `json:"visible_type" gorm:"column:visible_type;type:varchar(128);not null"`
SourceType string `json:"source_type" gorm:"type:varchar(128);not null"`
SourceUuid string `json:"source_uuid" gorm:"type:varchar(255);not null"`
ReceiveType string `json:"receive_type" gorm:"column:receive_type;type:varchar(128);index:idx_receive_type_uuid;not null"`
ReceiveUuid string `json:"receive_uuid" gorm:"column:receive_uuid;type:varchar(255);index:idx_receive_type_uuid"`
Subject string `json:"subject" gorm:"type:text;not null"`
Body string `json:"body" gorm:"type:text;"`
AttachmentsJSON string `json:"-" gorm:"type:json"`
AttachmentsPicked bool `json:"-" gorm:"column:attachments_picked"`
Attachments AttachmentsType `json:"attachments" gorm:"-"`
}
Click to show internal directories.
Click to hide internal directories.