Documentation ¶
Index ¶
- func Initialize(ctx context.Context)
- type Type
- func (d *Type) CreateAlertType(name string) (at *model.AlertTypes, err error)
- func (d *Type) CreateOrGetUser(user *tb.User) (u *model.Users, err error)
- func (d *Type) CreateOrGetUserAlertRelations(user *model.Users, alert *model.AlertTypes) (uar *model.UserAlertRelations, err error)
- func (d *Type) GetAlertTypesCol() *mgo.Collection
- func (d *Type) GetUserAlertRelationsCol() *mgo.Collection
- func (d *Type) GetUsersCol() *mgo.Collection
- func (d *Type) IsUserSubAlert(uid int, alertName string) (alert *model.AlertTypes, err error)
- func (d *Type) LoadAlertTypes(cfg *dto.QueryCfg) (alerts []*model.AlertTypes, err error)
- func (d *Type) LoadAlertTypesByUser(u *model.Users) (alerts []*model.AlertTypes, err error)
- func (d *Type) LoadUserByUID(telegramUID int) (u *model.Users, err error)
- func (d *Type) LoadUsers(cfg *dto.QueryCfg) (users []*model.Users, err error)
- func (d *Type) LoadUsersByAlertType(a *model.AlertTypes) (users []*model.Users, err error)
- func (d *Type) RefreshAlertTokenAndKey(alert *model.AlertTypes) (err error)
- func (d *Type) RegisterUserAlertRelation(u *model.Users, alertName string, joinKey string) (uar *model.UserAlertRelations, err error)
- func (d *Type) RemoveUAR(uid int, alertName string) (err error)
- func (d *Type) ValidateTokenForAlertType(token, alertType string) (alert *model.AlertTypes, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
Types ¶
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type db
var Instance *Type
func (*Type) CreateAlertType ¶
func (d *Type) CreateAlertType(name string) (at *model.AlertTypes, err error)
func (*Type) CreateOrGetUser ¶
func (*Type) CreateOrGetUserAlertRelations ¶
func (d *Type) CreateOrGetUserAlertRelations(user *model.Users, alert *model.AlertTypes) ( uar *model.UserAlertRelations, err error)
func (*Type) GetAlertTypesCol ¶
func (d *Type) GetAlertTypesCol() *mgo.Collection
func (*Type) GetUserAlertRelationsCol ¶
func (d *Type) GetUserAlertRelationsCol() *mgo.Collection
func (*Type) GetUsersCol ¶
func (d *Type) GetUsersCol() *mgo.Collection
func (*Type) IsUserSubAlert ¶
func (*Type) LoadAlertTypes ¶
func (*Type) LoadAlertTypesByUser ¶
func (*Type) LoadUserByUID ¶
func (*Type) LoadUsersByAlertType ¶
func (*Type) RefreshAlertTokenAndKey ¶
func (d *Type) RefreshAlertTokenAndKey(alert *model.AlertTypes) (err error)
func (*Type) RegisterUserAlertRelation ¶
func (*Type) ValidateTokenForAlertType ¶
func (d *Type) ValidateTokenForAlertType(token, alertType string) (alert *model.AlertTypes, err error)
Click to show internal directories.
Click to hide internal directories.