Documentation ¶
Index ¶
- Constants
- func AddAuthorRelationsFromMeQuery(q *sqlf.Stmt, userID *models.UserID) *sqlf.Stmt
- func AddAuthorRelationsToMeQuery(q *sqlf.Stmt, userID *models.UserID) *sqlf.Stmt
- func AddCanViewAuthorQuery(q *sqlf.Stmt, userID *models.UserID) *sqlf.Stmt
- func AddCanViewEntryQuery(q *sqlf.Stmt, userID *models.UserID) *sqlf.Stmt
- func AddEntryOpenQuery(q *sqlf.Stmt, userID *models.UserID, showMe bool) *sqlf.Stmt
- func AddViewAuthorQuery(q *sqlf.Stmt, userID *models.UserID) *sqlf.Stmt
- func AddViewCommentQuery(q *sqlf.Stmt, userID *models.UserID) *sqlf.Stmt
- func AddViewEntryQuery(q *sqlf.Stmt, userID *models.UserID) *sqlf.Stmt
- func CanViewEntry(tx *AutoTx, userID *models.UserID, entryID int64) bool
- func CanViewTlogName(tx *AutoTx, userID *models.UserID, tlog string) bool
- func ClearDatabase(db *sql.DB)
- func CreateApp(tx *AutoTx, hash TokenHash, app CreateAppParameters) (int64, string, error)
- func CreateUserLog(db *sql.DB, log *zap.Logger) middleware.Builder
- func CutHtml(text string, maxLineCount, maxLineLen int) (string, bool)
- func CutText(text string, size int) (string, bool)
- func FormatFloat(val float64) string
- func FormatInt64(val int64) string
- func GenerateString(length int) string
- func HideEmail(email string) string
- func LoadConfig(fileName string) *goconf.Config
- func LoadImage(srv *MindwellServer, tx *AutoTx, imageID int64) *models.Image
- func LoadOnlineUsers(tx *AutoTx) []*models.User
- func LoadRelation(tx *AutoTx, from, to int64) string
- func LoadUser(tx *AutoTx, id int64) *models.User
- func LoadUserByName(tx *AutoTx, name string) *models.User
- func LoadUserIDByID(tx *AutoTx, id int64) (*models.UserID, error)
- func LoadUserIDByName(tx *AutoTx, name string) (*models.UserID, error)
- func LogHandler(tpe string, nextHandler http.Handler) (http.Handler, error)
- func NewOAuth2App(h TokenHash, db *sql.DB) func(string, []string) (*models.UserID, error)
- func NewOAuth2User(h TokenHash, db *sql.DB, flowReq AuthFlow) func(string, []string) (*models.UserID, error)
- func NoAuthUser() *models.UserID
- func OpenDatabase(config *goconf.Config) *sql.DB
- func ParseFloat(val string) float64
- func ParseInt64(val string) int64
- func RemoveHTML(text string) string
- func ReplaceToHtml(val string) string
- func ScopeFromString(scopes []string) (uint32, error)
- func ScopeToString(scope uint32) []string
- func Transact(db *sql.DB, txFunc func(*AutoTx) middleware.Responder) middleware.Responder
- type AuthFlow
- type AutoTx
- func (tx *AutoTx) Close()
- func (tx *AutoTx) Error() error
- func (tx *AutoTx) Exec(query string, args ...interface{})
- func (tx *AutoTx) ExecStmt(stmt *sqlf.Stmt) *AutoTx
- func (tx *AutoTx) Finish()
- func (tx *AutoTx) HasQueryError() bool
- func (tx *AutoTx) LastQuery() string
- func (tx *AutoTx) Query(query string, args ...interface{}) *AutoTx
- func (tx *AutoTx) QueryBool(query string, args ...interface{}) bool
- func (tx *AutoTx) QueryBools(query string, args ...interface{}) []bool
- func (tx *AutoTx) QueryFloat64(query string, args ...interface{}) float64
- func (tx *AutoTx) QueryInt64(query string, args ...interface{}) int64
- func (tx *AutoTx) QueryInt64s(query string, args ...interface{}) []int64
- func (tx *AutoTx) QueryStmt(stmt *sqlf.Stmt) *AutoTx
- func (tx *AutoTx) QueryString(query string, args ...interface{}) string
- func (tx *AutoTx) QueryStrings(query string, args ...interface{}) []string
- func (tx *AutoTx) RowsAffected() int64
- func (tx *AutoTx) Scan(dest ...interface{}) bool
- func (tx *AutoTx) ScanBool() bool
- func (tx *AutoTx) ScanBools() []bool
- func (tx *AutoTx) ScanFloat64() float64
- func (tx *AutoTx) ScanInt64() int64
- func (tx *AutoTx) ScanInt64s() []int64
- func (tx *AutoTx) ScanString() string
- func (tx *AutoTx) ScanStrings() []string
- type CompositeNotifier
- func (ntf *CompositeNotifier) NotifyMessage(tx *AutoTx, msg *models.Message, user string)
- func (ntf *CompositeNotifier) NotifyMessageRead(chatID, msgID int64, user string)
- func (ntf *CompositeNotifier) NotifyMessageRemove(chatID, msgID int64, user string)
- func (ntf *CompositeNotifier) NotifyMessageUpdate(msg *models.Message, user string)
- func (ntf *CompositeNotifier) SendAdmReceived(tx *AutoTx, grandfather string)
- func (ntf *CompositeNotifier) SendAdmSent(tx *AutoTx, grandson string)
- func (ntf *CompositeNotifier) SendEmailChanged(tx *AutoTx, userID *models.UserID, oldEmail, newEmail string)
- func (ntf *CompositeNotifier) SendGreeting(address, showName string)
- func (ntf *CompositeNotifier) SendInvited(tx *AutoTx, from, to string)
- func (ntf *CompositeNotifier) SendNewAccept(tx *AutoTx, from, to string)
- func (ntf *CompositeNotifier) SendNewComment(tx *AutoTx, cmt *models.Comment)
- func (ntf *CompositeNotifier) SendNewCommentComplain(tx *AutoTx, commentID, fromID int64, content string)
- func (ntf *CompositeNotifier) SendNewEntryComplain(tx *AutoTx, entryID, fromID int64, content string)
- func (ntf *CompositeNotifier) SendNewFollower(tx *AutoTx, toPrivate bool, from, to string)
- func (ntf *CompositeNotifier) SendNewInvite(tx *AutoTx, userID int)
- func (ntf *CompositeNotifier) SendNewMessageComplain(tx *AutoTx, msgID, fromID int64, content string)
- func (ntf *CompositeNotifier) SendNewThemeComplain(tx *AutoTx, against *models.User, fromID int64, content string)
- func (ntf *CompositeNotifier) SendNewUserComplain(tx *AutoTx, against *models.User, fromID int64, content string)
- func (ntf *CompositeNotifier) SendNewWishComplain(tx *AutoTx, wishID, fromID int64)
- func (ntf *CompositeNotifier) SendPasswordChanged(tx *AutoTx, userID *models.UserID)
- func (ntf *CompositeNotifier) SendRead(name string, id int64)
- func (ntf *CompositeNotifier) SendRemoveComment(tx *AutoTx, commentID int64)
- func (ntf *CompositeNotifier) SendResetPassword(email, showName, gender string)
- func (ntf *CompositeNotifier) SendUpdateComment(tx *AutoTx, cmt *models.Comment)
- func (ntf *CompositeNotifier) SendWishCreated(tx *AutoTx, wishID int64, user string)
- func (ntf *CompositeNotifier) SendWishReceived(tx *AutoTx, wishID int64, user string)
- func (ntf *CompositeNotifier) Stop()
- type CreateAppParameters
- type EmailAllowedChecker
- type EmailChecker
- type MailSender
- type MindwellServer
- func (srv *MindwellServer) ConfigBool(field string) bool
- func (srv *MindwellServer) ConfigBytes(field string) []byte
- func (srv *MindwellServer) ConfigInt(field string) int
- func (srv *MindwellServer) ConfigInt64(field string) int64
- func (srv *MindwellServer) ConfigInt64s(field string) []int64
- func (srv *MindwellServer) ConfigInts(field string) []int
- func (srv *MindwellServer) ConfigOptString(field string) string
- func (srv *MindwellServer) ConfigString(field string) string
- func (srv *MindwellServer) ConfigStrings(field string) []string
- func (srv *MindwellServer) ImagesFolder() string
- func (srv *MindwellServer) Log(tpe string) *zap.Logger
- func (srv *MindwellServer) LogApi() *zap.Logger
- func (srv *MindwellServer) LogEmail() *zap.Logger
- func (srv *MindwellServer) LogRequest() *zap.Logger
- func (srv *MindwellServer) LogSystem() *zap.Logger
- func (srv *MindwellServer) LogTelegram() *zap.Logger
- func (srv *MindwellServer) NewAvatar(avatar string) *models.Avatar
- func (srv *MindwellServer) NewCover(id int64, cover string) *models.Cover
- func (srv *MindwellServer) NewError(msg *i18n.Message) *models.Error
- func (srv *MindwellServer) StandardError(name string) *models.Error
- func (srv *MindwellServer) TokenHash() TokenHash
- func (srv *MindwellServer) Transact(txFunc func(*AutoTx) middleware.Responder) middleware.Responder
- type Notifier
- func (ntf *Notifier) Notify(tx *AutoTx, subjectID int64, tpe, user string)
- func (ntf *Notifier) NotifyMessage(chatID, msgID int64, user string)
- func (ntf *Notifier) NotifyMessageRead(chatID, msgID int64, user string)
- func (ntf *Notifier) NotifyMessageRemove(chatID, msgID int64, user string)
- func (ntf *Notifier) NotifyMessageUpdate(chatID, msgID int64, user string)
- func (ntf *Notifier) NotifyRead(user string, ntfID int64)
- func (ntf *Notifier) NotifyRemove(tx *AutoTx, subjectID int64, tpe string)
- func (ntf *Notifier) NotifyUpdate(tx *AutoTx, subjectID int64, tpe string)
- func (ntf *Notifier) Stop()
- type Postman
- func (pm *Postman) SendAdm(address, name, gender string)
- func (pm *Postman) SendAdmReceived(address, toShowName string)
- func (pm *Postman) SendAdmSent(address, toShowName string)
- func (pm *Postman) SendCommentComplain(from, against, content, comment string, commentID, entryID int64)
- func (pm *Postman) SendEmailChanged(address, name string)
- func (pm *Postman) SendEntryComplain(from, against, content, entry string, entryID int64)
- func (pm *Postman) SendGreeting(address, name, code string)
- func (pm *Postman) SendInvited(address, fromShowName, fromGender, toShowName string)
- func (pm *Postman) SendNewAccept(address, fromName, fromShowName, fromGender, toShowName string)
- func (pm *Postman) SendNewComment(address, fromGender, toShowName, entryTitle string, cmt *models.Comment)
- func (pm *Postman) SendNewFollower(address, fromName, fromShowName, fromGender string, toPrivate bool, ...)
- func (pm *Postman) SendNewInvite(address, name string)
- func (pm *Postman) SendPasswordChanged(address, name string)
- func (pm *Postman) SendReminder(address, name, gender string)
- func (pm *Postman) SendResetPassword(address, name, gender, code string, date int64)
- func (pm *Postman) SendSurvey(address, name, surveyUrl string)
- func (pm *Postman) Start(smtpHost string, smtpPort int, username, password, helo string) error
- func (pm *Postman) Stop()
- type TelegramBot
- func (bot *TelegramBot) BuildToken(userID int64) string
- func (bot *TelegramBot) SendAdmReceived(chat int64)
- func (bot *TelegramBot) SendAdmSent(chat int64)
- func (bot *TelegramBot) SendCommentComplain(from, against *models.User, content, comment string, commentID, entryID int64)
- func (bot *TelegramBot) SendEmailChanged(chat int64)
- func (bot *TelegramBot) SendEntryComplain(from, against *models.User, content, entry string, entryID int64)
- func (bot *TelegramBot) SendInvited(chat int64, fromName, fromShowName, fromGender string)
- func (bot *TelegramBot) SendMessageComplain(from, against *models.User, content, message string, messageID int64)
- func (bot *TelegramBot) SendNewAccept(chat int64, fromName, fromShowName, fromGender string)
- func (bot *TelegramBot) SendNewComment(chat int64, entryTitle string, cmt *models.Comment)
- func (bot *TelegramBot) SendNewFollower(chat int64, fromName, fromShowName, fromGender string, toPrivate bool)
- func (bot *TelegramBot) SendNewInvite(chat int64)
- func (bot *TelegramBot) SendNewMessage(chat int64, msg *models.Message)
- func (bot *TelegramBot) SendPasswordChanged(chat int64)
- func (bot *TelegramBot) SendRemoveComment(commentID int64)
- func (bot *TelegramBot) SendRemoveMessage(messageID int64)
- func (bot *TelegramBot) SendThemeComplain(from, against *models.User, content, title string)
- func (bot *TelegramBot) SendUpdateComment(entryTitle string, cmt *models.Comment)
- func (bot *TelegramBot) SendUpdateMessage(msg *models.Message)
- func (bot *TelegramBot) SendUserComplain(from, against *models.User, content, title string)
- func (bot *TelegramBot) SendWishComplain(from, against *models.User, wish string, wishID int64)
- func (bot *TelegramBot) Stop()
- func (bot *TelegramBot) VerifyToken(token string) int64
- type TokenHash
- func (th TokenHash) AccessTokenHash(token string) []byte
- func (th TokenHash) AppSecretHash(secret string) []byte
- func (th TokenHash) AppTokenHash(token string) []byte
- func (th TokenHash) CheckResetPasswordCode(email, code string, date int64) bool
- func (th TokenHash) PasswordHash(password string) []byte
- func (th TokenHash) RefreshTokenHash(token string) []byte
- func (th TokenHash) ResetPasswordCode(email string) (string, int64)
- func (th TokenHash) VerificationCode(email string) string
- type TokenHashConfig
Constants ¶
View Source
const AccessTokenLength = 32
View Source
const AccessTokenLifetime = 60 * 60 * 24
View Source
const AppTokenLength = 32
View Source
const AppTokenLifetime = 60 * 60 * 24
View Source
const CodeLength = 32
View Source
const RefreshTokenLength = 48
View Source
const RefreshTokenLifetime = 60 * 60 * 24 * 30
Variables ¶
This section is empty.
Functions ¶
func AddCanViewAuthorQuery ¶
func AddCanViewEntryQuery ¶
func AddEntryOpenQuery ¶
func CanViewEntry ¶
CanViewEntry returns true if the user is allowed to read the entry.
func ClearDatabase ¶
ClearDatabase drops user data tables and then creates default user
func CreateUserLog ¶
func FormatFloat ¶
func FormatInt64 ¶
func LoadConfig ¶
LoadConfig creates app config from file
func LoadOnlineUsers ¶
func LoadRelation ¶
func NewOAuth2App ¶
func NewOAuth2User ¶
func NoAuthUser ¶
func OpenDatabase ¶
OpenDatabase returns db opened from config.
func ParseFloat ¶
func ParseInt64 ¶
func RemoveHTML ¶
func ReplaceToHtml ¶
func ScopeFromString ¶
func ScopeToString ¶
func Transact ¶
func Transact(db *sql.DB, txFunc func(*AutoTx) middleware.Responder) middleware.Responder
Transact wraps func in an SQL transaction. Responder will be just passed through.
Types ¶
type AutoTx ¶
type AutoTx struct {
// contains filtered or unexported fields
}
func (*AutoTx) HasQueryError ¶
func (*AutoTx) QueryBools ¶
func (*AutoTx) QueryFloat64 ¶
func (*AutoTx) QueryInt64 ¶
func (*AutoTx) QueryInt64s ¶
func (*AutoTx) QueryString ¶
func (*AutoTx) QueryStrings ¶
func (*AutoTx) RowsAffected ¶
func (*AutoTx) ScanFloat64 ¶
func (*AutoTx) ScanInt64s ¶
func (*AutoTx) ScanString ¶
func (*AutoTx) ScanStrings ¶
type CompositeNotifier ¶
type CompositeNotifier struct { Mail MailSender Ntf *Notifier Tg *TelegramBot // contains filtered or unexported fields }
func NewCompositeNotifier ¶
func NewCompositeNotifier(srv *MindwellServer) *CompositeNotifier
func (*CompositeNotifier) NotifyMessage ¶
func (ntf *CompositeNotifier) NotifyMessage(tx *AutoTx, msg *models.Message, user string)
func (*CompositeNotifier) NotifyMessageRead ¶
func (ntf *CompositeNotifier) NotifyMessageRead(chatID, msgID int64, user string)
func (*CompositeNotifier) NotifyMessageRemove ¶
func (ntf *CompositeNotifier) NotifyMessageRemove(chatID, msgID int64, user string)
func (*CompositeNotifier) NotifyMessageUpdate ¶
func (ntf *CompositeNotifier) NotifyMessageUpdate(msg *models.Message, user string)
func (*CompositeNotifier) SendAdmReceived ¶
func (ntf *CompositeNotifier) SendAdmReceived(tx *AutoTx, grandfather string)
func (*CompositeNotifier) SendAdmSent ¶
func (ntf *CompositeNotifier) SendAdmSent(tx *AutoTx, grandson string)
func (*CompositeNotifier) SendEmailChanged ¶
func (ntf *CompositeNotifier) SendEmailChanged(tx *AutoTx, userID *models.UserID, oldEmail, newEmail string)
func (*CompositeNotifier) SendGreeting ¶
func (ntf *CompositeNotifier) SendGreeting(address, showName string)
func (*CompositeNotifier) SendInvited ¶
func (ntf *CompositeNotifier) SendInvited(tx *AutoTx, from, to string)
func (*CompositeNotifier) SendNewAccept ¶
func (ntf *CompositeNotifier) SendNewAccept(tx *AutoTx, from, to string)
func (*CompositeNotifier) SendNewComment ¶
func (ntf *CompositeNotifier) SendNewComment(tx *AutoTx, cmt *models.Comment)
func (*CompositeNotifier) SendNewCommentComplain ¶
func (ntf *CompositeNotifier) SendNewCommentComplain(tx *AutoTx, commentID, fromID int64, content string)
func (*CompositeNotifier) SendNewEntryComplain ¶
func (ntf *CompositeNotifier) SendNewEntryComplain(tx *AutoTx, entryID, fromID int64, content string)
func (*CompositeNotifier) SendNewFollower ¶
func (ntf *CompositeNotifier) SendNewFollower(tx *AutoTx, toPrivate bool, from, to string)
func (*CompositeNotifier) SendNewInvite ¶
func (ntf *CompositeNotifier) SendNewInvite(tx *AutoTx, userID int)
func (*CompositeNotifier) SendNewMessageComplain ¶
func (ntf *CompositeNotifier) SendNewMessageComplain(tx *AutoTx, msgID, fromID int64, content string)
func (*CompositeNotifier) SendNewThemeComplain ¶
func (*CompositeNotifier) SendNewUserComplain ¶
func (*CompositeNotifier) SendNewWishComplain ¶
func (ntf *CompositeNotifier) SendNewWishComplain(tx *AutoTx, wishID, fromID int64)
func (*CompositeNotifier) SendPasswordChanged ¶
func (ntf *CompositeNotifier) SendPasswordChanged(tx *AutoTx, userID *models.UserID)
func (*CompositeNotifier) SendRead ¶
func (ntf *CompositeNotifier) SendRead(name string, id int64)
func (*CompositeNotifier) SendRemoveComment ¶
func (ntf *CompositeNotifier) SendRemoveComment(tx *AutoTx, commentID int64)
func (*CompositeNotifier) SendResetPassword ¶
func (ntf *CompositeNotifier) SendResetPassword(email, showName, gender string)
func (*CompositeNotifier) SendUpdateComment ¶
func (ntf *CompositeNotifier) SendUpdateComment(tx *AutoTx, cmt *models.Comment)
func (*CompositeNotifier) SendWishCreated ¶
func (ntf *CompositeNotifier) SendWishCreated(tx *AutoTx, wishID int64, user string)
func (*CompositeNotifier) SendWishReceived ¶
func (ntf *CompositeNotifier) SendWishReceived(tx *AutoTx, wishID int64, user string)
func (*CompositeNotifier) Stop ¶
func (ntf *CompositeNotifier) Stop()
type CreateAppParameters ¶
type EmailAllowedChecker ¶
type EmailChecker ¶
type EmailChecker struct {
// contains filtered or unexported fields
}
func NewEmailChecker ¶
func NewEmailChecker(srv *MindwellServer) *EmailChecker
func (*EmailChecker) IsAllowed ¶
func (ec *EmailChecker) IsAllowed(email string) bool
type MailSender ¶
type MailSender interface { SendGreeting(address, name, code string) SendPasswordChanged(address, name string) SendEmailChanged(address, name string) SendResetPassword(address, name, gender, code string, date int64) SendNewComment(address, fromGender, toShowName, entryTitle string, cmt *models.Comment) SendNewFollower(address, fromName, fromShowName, fromGender string, toPrivate bool, toShowName string) SendNewAccept(address, fromName, fromShowName, fromGender, toShowName string) SendNewInvite(address, name string) SendInvited(address, fromShowName, fromGender, toShowName string) SendAdmSent(address, toShowName string) SendAdmReceived(address, toShowName string) SendCommentComplain(from, against, content, comment string, commentID, entryID int64) SendEntryComplain(from, against, content, entry string, entryID int64) Stop() }
type MindwellServer ¶
type MindwellServer struct { DB *sql.DB API *operations.MindwellAPI Ntf *CompositeNotifier Imgs *cache.Cache Eac EmailAllowedChecker // contains filtered or unexported fields }
func NewMindwellServer ¶
func NewMindwellServer(api *operations.MindwellAPI, configPath string) *MindwellServer
func (*MindwellServer) ConfigBool ¶
func (srv *MindwellServer) ConfigBool(field string) bool
func (*MindwellServer) ConfigBytes ¶
func (srv *MindwellServer) ConfigBytes(field string) []byte
func (*MindwellServer) ConfigInt ¶
func (srv *MindwellServer) ConfigInt(field string) int
func (*MindwellServer) ConfigInt64 ¶
func (srv *MindwellServer) ConfigInt64(field string) int64
func (*MindwellServer) ConfigInt64s ¶
func (srv *MindwellServer) ConfigInt64s(field string) []int64
func (*MindwellServer) ConfigInts ¶
func (srv *MindwellServer) ConfigInts(field string) []int
func (*MindwellServer) ConfigOptString ¶
func (srv *MindwellServer) ConfigOptString(field string) string
func (*MindwellServer) ConfigString ¶
func (srv *MindwellServer) ConfigString(field string) string
func (*MindwellServer) ConfigStrings ¶
func (srv *MindwellServer) ConfigStrings(field string) []string
func (*MindwellServer) ImagesFolder ¶
func (srv *MindwellServer) ImagesFolder() string
func (*MindwellServer) LogApi ¶
func (srv *MindwellServer) LogApi() *zap.Logger
func (*MindwellServer) LogEmail ¶
func (srv *MindwellServer) LogEmail() *zap.Logger
func (*MindwellServer) LogRequest ¶
func (srv *MindwellServer) LogRequest() *zap.Logger
func (*MindwellServer) LogSystem ¶
func (srv *MindwellServer) LogSystem() *zap.Logger
func (*MindwellServer) LogTelegram ¶
func (srv *MindwellServer) LogTelegram() *zap.Logger
func (*MindwellServer) NewAvatar ¶
func (srv *MindwellServer) NewAvatar(avatar string) *models.Avatar
func (*MindwellServer) NewCover ¶
func (srv *MindwellServer) NewCover(id int64, cover string) *models.Cover
func (*MindwellServer) NewError ¶
func (srv *MindwellServer) NewError(msg *i18n.Message) *models.Error
NewError returns error object with some message
func (*MindwellServer) StandardError ¶
func (srv *MindwellServer) StandardError(name string) *models.Error
func (*MindwellServer) TokenHash ¶
func (srv *MindwellServer) TokenHash() TokenHash
func (*MindwellServer) Transact ¶
func (srv *MindwellServer) Transact(txFunc func(*AutoTx) middleware.Responder) middleware.Responder
type Notifier ¶
type Notifier struct {
// contains filtered or unexported fields
}
func NewNotifier ¶
func (*Notifier) NotifyMessage ¶
func (*Notifier) NotifyMessageRead ¶
func (*Notifier) NotifyMessageRemove ¶
func (*Notifier) NotifyMessageUpdate ¶
func (*Notifier) NotifyRead ¶
func (*Notifier) NotifyRemove ¶
func (*Notifier) NotifyUpdate ¶
type Postman ¶
type Postman struct { BaseUrl string Support string Moderator string Logger *zap.Logger // contains filtered or unexported fields }
func (*Postman) SendAdmReceived ¶
func (*Postman) SendAdmSent ¶
func (*Postman) SendCommentComplain ¶
func (*Postman) SendEmailChanged ¶
func (*Postman) SendEntryComplain ¶
func (*Postman) SendGreeting ¶
func (*Postman) SendInvited ¶
func (*Postman) SendNewAccept ¶
func (*Postman) SendNewComment ¶
func (*Postman) SendNewFollower ¶
func (*Postman) SendNewInvite ¶
func (*Postman) SendPasswordChanged ¶
func (*Postman) SendReminder ¶
func (*Postman) SendResetPassword ¶
func (*Postman) SendSurvey ¶
type TelegramBot ¶
type TelegramBot struct {
// contains filtered or unexported fields
}
func NewTelegramBot ¶
func NewTelegramBot(srv *MindwellServer) *TelegramBot
func (*TelegramBot) BuildToken ¶
func (bot *TelegramBot) BuildToken(userID int64) string
func (*TelegramBot) SendAdmReceived ¶
func (bot *TelegramBot) SendAdmReceived(chat int64)
func (*TelegramBot) SendAdmSent ¶
func (bot *TelegramBot) SendAdmSent(chat int64)
func (*TelegramBot) SendCommentComplain ¶
func (bot *TelegramBot) SendCommentComplain(from, against *models.User, content, comment string, commentID, entryID int64)
func (*TelegramBot) SendEmailChanged ¶
func (bot *TelegramBot) SendEmailChanged(chat int64)
func (*TelegramBot) SendEntryComplain ¶
func (bot *TelegramBot) SendEntryComplain(from, against *models.User, content, entry string, entryID int64)
func (*TelegramBot) SendInvited ¶
func (bot *TelegramBot) SendInvited(chat int64, fromName, fromShowName, fromGender string)
func (*TelegramBot) SendMessageComplain ¶
func (bot *TelegramBot) SendMessageComplain(from, against *models.User, content, message string, messageID int64)
func (*TelegramBot) SendNewAccept ¶
func (bot *TelegramBot) SendNewAccept(chat int64, fromName, fromShowName, fromGender string)
func (*TelegramBot) SendNewComment ¶
func (bot *TelegramBot) SendNewComment(chat int64, entryTitle string, cmt *models.Comment)
func (*TelegramBot) SendNewFollower ¶
func (bot *TelegramBot) SendNewFollower(chat int64, fromName, fromShowName, fromGender string, toPrivate bool)
func (*TelegramBot) SendNewInvite ¶
func (bot *TelegramBot) SendNewInvite(chat int64)
func (*TelegramBot) SendNewMessage ¶
func (bot *TelegramBot) SendNewMessage(chat int64, msg *models.Message)
func (*TelegramBot) SendPasswordChanged ¶
func (bot *TelegramBot) SendPasswordChanged(chat int64)
func (*TelegramBot) SendRemoveComment ¶
func (bot *TelegramBot) SendRemoveComment(commentID int64)
func (*TelegramBot) SendRemoveMessage ¶
func (bot *TelegramBot) SendRemoveMessage(messageID int64)
func (*TelegramBot) SendThemeComplain ¶
func (bot *TelegramBot) SendThemeComplain(from, against *models.User, content, title string)
func (*TelegramBot) SendUpdateComment ¶
func (bot *TelegramBot) SendUpdateComment(entryTitle string, cmt *models.Comment)
func (*TelegramBot) SendUpdateMessage ¶
func (bot *TelegramBot) SendUpdateMessage(msg *models.Message)
func (*TelegramBot) SendUserComplain ¶
func (bot *TelegramBot) SendUserComplain(from, against *models.User, content, title string)
func (*TelegramBot) SendWishComplain ¶
func (bot *TelegramBot) SendWishComplain(from, against *models.User, wish string, wishID int64)
func (*TelegramBot) Stop ¶
func (bot *TelegramBot) Stop()
func (*TelegramBot) VerifyToken ¶
func (bot *TelegramBot) VerifyToken(token string) int64
type TokenHash ¶
type TokenHash struct {
// contains filtered or unexported fields
}
func NewTokenHash ¶
func NewTokenHash(cfg TokenHashConfig) TokenHash
func (TokenHash) AccessTokenHash ¶
func (TokenHash) AppSecretHash ¶
func (TokenHash) AppTokenHash ¶
func (TokenHash) CheckResetPasswordCode ¶
func (TokenHash) PasswordHash ¶
func (TokenHash) RefreshTokenHash ¶
func (TokenHash) ResetPasswordCode ¶
func (TokenHash) VerificationCode ¶
type TokenHashConfig ¶
Click to show internal directories.
Click to hide internal directories.