Documentation ¶
Index ¶
- Constants
- type Article
- type Chat
- func (e *Chat) EntityID() uuid.UUID
- func (e *Chat) IsBlocked() bool
- func (e *Chat) IsDeleted() bool
- func (e *Chat) SetBlocked(blocked bool) *Chat
- func (e *Chat) SetBroadcast(broadcast []uuid.UUID) *Chat
- func (e *Chat) SetDeleted(deleted bool) *Chat
- func (e *Chat) SetRights(rights ChatRights) *Chat
- func (e *Chat) Tags() []string
- type ChatRights
- type ChatType
- type FeedPayload
- type Job
- type JobName
- type JobOption
- type JobOptionType
- type Media
- type MediaType
- type Site
- type SitemapPayload
- func (p *SitemapPayload) IsIndex() bool
- func (p *SitemapPayload) SetIndex(index bool) *SitemapPayload
- func (p *SitemapPayload) SetLang(lang string) *SitemapPayload
- func (p *SitemapPayload) SetMatchLoc(matchLoc string) *SitemapPayload
- func (p *SitemapPayload) SetSearchLink(searchLink string) *SitemapPayload
- func (p *SitemapPayload) SetSearchLoc(searchLoc string) *SitemapPayload
- func (p *SitemapPayload) SetStopOnDup(stopOnDup bool) *SitemapPayload
- func (p *SitemapPayload) StoppingOnDup() bool
- type Source
- type SysUser
- func (e *SysUser) CheckPassword(password string) error
- func (e *SysUser) CheckTOTP(password string) error
- func (e *SysUser) EntityID() uuid.UUID
- func (e *SysUser) GenerateOTPSecret(size uint) (err error)
- func (e *SysUser) GeneratePasswordHash() error
- func (e *SysUser) Secret() string
- func (e *SysUser) Tags() []string
Constants ¶
View Source
const SiteCollection = "sites"
View Source
const SysUserCollection = "sys_users"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Article ¶
type Article struct { ID uuid.UUID `json:"id,omitempty" bson:"_id,omitempty"` Link string `json:"link,omitempty" bson:"link,omitempty"` SiteID uuid.UUID `json:"site_id,omitempty" bson:"site_id,omitempty"` Source Source `json:"source,omitempty" bson:"source,omitempty"` Lang string `json:"lang,omitempty" bson:"lang,omitempty"` Title string `json:"title,omitempty" bson:"title,omitempty"` Desc *string `json:"desc,omitempty" bson:"short_desc,omitempty"` Media *[]Media `json:"media,omitempty" bson:"media,omitempty"` PubDate time.Time `json:"pub_date,omitempty" bson:"pub_date,omitempty"` CreatedAt time.Time `json:"created_at,omitempty" bson:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty" bson:"updated_at,omitempty"` }
func (*Article) FirstMedia ¶
type Chat ¶
type Chat struct { ID uuid.UUID `json:"id,omitempty" bson:"_id,omitempty"` TelegramID int64 `json:"telegram_id,omitempty" bson:"telegram_id,omitempty"` Type ChatType `json:"type,omitempty" bson:"type,omitempty"` Title string `json:"title,omitempty" bson:"title,omitempty"` Username string `json:"username,omitempty" bson:"username,omitempty"` FirstName string `json:"first_name,omitempty" bson:"first_name,omitempty"` LastName string `json:"last_name,omitempty" bson:"last_name,omitempty"` Broadcast *[]uuid.UUID `json:"broadcast,omitempty" bson:"broadcast,omitempty"` Rights *ChatRights `json:"rights,omitempty" bson:"rights,omitempty"` Blocked *bool `json:"blocked,omitempty" bson:"blocked,omitempty"` Deleted *bool `json:"deleted,omitempty" bson:"deleted,omitempty"` CreatedAt time.Time `json:"created_at,omitempty" bson:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty" bson:"updated_at,omitempty"` }
func (*Chat) SetBlocked ¶
func (*Chat) SetDeleted ¶
func (*Chat) SetRights ¶
func (e *Chat) SetRights(rights ChatRights) *Chat
type ChatRights ¶
type ChatRights struct { Status string `json:"status,omitempty" bson:"status,omitempty"` IsAnonymous bool `json:"is_anonymous,omitempty" bson:"is_anonymous,omitempty"` UntilDate int64 `json:"until_date,omitempty" bson:"until_date,omitempty"` CanBeEdited bool `json:"can_be_edited,omitempty" bson:"can_be_edited,omitempty"` CanManageChat bool `json:"can_manage_chat,omitempty" bson:"can_manage_chat,omitempty"` CanPostMessages bool `json:"can_post_messages,omitempty" bson:"can_post_messages,omitempty"` CanEditMessages bool `json:"can_edit_messages,omitempty" bson:"can_edit_messages,omitempty"` CanDeleteMessages bool `json:"can_delete_messages,omitempty" bson:"can_delete_messages,omitempty"` CanRestrictMembers bool `json:"can_restrict_members,omitempty" bson:"can_restrict_members,omitempty"` CanPromoteMembers bool `json:"can_promote_members,omitempty" bson:"can_promote_members,omitempty"` CanChangeInfo bool `json:"can_change_info,omitempty" bson:"can_change_info,omitempty"` CanInviteUsers bool `json:"can_invite_users,omitempty" bson:"can_invite_users,omitempty"` CanPinMessages bool `json:"can_pin_messages,omitempty" bson:"can_pin_messages,omitempty"` IsMember bool `json:"is_member,omitempty" bson:"is_member,omitempty"` CanSendMessages bool `json:"can_send_messages,omitempty" bson:"can_send_messages,omitempty"` CanSendMediaMessages bool `json:"can_send_media_messages,omitempty" bson:"can_send_media_messages,omitempty"` CanSendPolls bool `json:"can_send_polls,omitempty" bson:"can_send_polls,omitempty"` CanSendOtherMessages bool `json:"can_send_other_messages,omitempty" bson:"can_send_other_messages,omitempty"` CanAddWebPagePreviews bool `json:"can_add_web_page_previews,omitempty" bson:"can_add_web_page_previews,omitempty"` }
func (ChatRights) HasLeft ¶
func (chat ChatRights) HasLeft() bool
func (ChatRights) IsAdministrator ¶
func (chat ChatRights) IsAdministrator() bool
func (ChatRights) IsCreator ¶
func (chat ChatRights) IsCreator() bool
func (ChatRights) WasKicked ¶
func (chat ChatRights) WasKicked() bool
type FeedPayload ¶
type Job ¶
type Job struct { ID uuid.UUID `json:"id,omitempty" bson:"_id"` CronExpr string `json:"cron_expr,omitempty" bson:"cron_expr,omitempty"` Name JobName `json:"name,omitempty" bson:"name,omitempty"` Payload any `json:"payload,omitempty" bson:"payload,omitempty"` Options *[]JobOption `json:"options,omitempty" bson:"options,omitempty"` Enabled *bool `json:"enabled,omitempty" bson:"enabled,omitempty"` CreatedAt time.Time `json:"created_at,omitempty" bson:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty" bson:"updated_at,omitempty"` }
func (*Job) HasOptions ¶
func (*Job) SetEnabled ¶
func (*Job) SetOptions ¶
func (*Job) UnmarshalBSON ¶
type JobOption ¶
type JobOption struct { Type JobOptionType `json:"type" bson:"type"` Value string `json:"value" bson:"value"` }
type JobOptionType ¶
type JobOptionType string
const ( MaxRetryOpt JobOptionType = "max-retry" QueueOpt JobOptionType = "queue" TimeoutOpt JobOptionType = "timeout" DeadlineOpt JobOptionType = "deadline" UniqueOpt JobOptionType = "unique" ProcessAtOpt JobOptionType = "process-at" ProcessInOpt JobOptionType = "process-in" TaskIDOpt JobOptionType = "task-id" RetentionOpt JobOptionType = "retention" GroupOpt JobOptionType = "group" )
type Site ¶
type Site struct { ID uuid.UUID `json:"id,omitempty" bson:"_id,omitempty"` Domain string `json:"domain,omitempty" bson:"domain,omitempty"` Favicon string `json:"favicon,omitempty" bson:"favicon,omitempty"` Languages []string `json:"languages,omitempty" bson:"languages,omitempty"` Title string `json:"title,omitempty" bson:"title,omitempty"` Enabled *bool `json:"enabled,omitempty" bson:"enabled,omitempty"` CreatedAt time.Time `json:"created_at,omitempty" bson:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty" bson:"updated_at,omitempty"` }
func (*Site) SetEnabled ¶
type SitemapPayload ¶
type SitemapPayload struct { JobID *uuid.UUID `json:"job_id,omitempty" bson:"-"` SiteID uuid.UUID `json:"site_id,omitempty" bson:"site_id,omitempty"` Link string `json:"link,omitempty" bson:"link,omitempty"` Lang *string `json:"lang,omitempty" bson:"lang,omitempty"` MatchLoc *string `json:"match_loc,omitempty" bson:"match_loc,omitempty"` SearchLoc *string `json:"search_loc,omitempty" bson:"search_loc,omitempty"` SearchLink *string `json:"search_link,omitempty" bson:"search_link,omitempty"` Index *bool `json:"index,omitempty" bson:"index,omitempty"` StopOnDup *bool `json:"stop_on_dup,omitempty" bson:"stop_on_dup,omitempty"` }
func (*SitemapPayload) IsIndex ¶
func (p *SitemapPayload) IsIndex() bool
func (*SitemapPayload) SetIndex ¶
func (p *SitemapPayload) SetIndex(index bool) *SitemapPayload
func (*SitemapPayload) SetLang ¶
func (p *SitemapPayload) SetLang(lang string) *SitemapPayload
func (*SitemapPayload) SetMatchLoc ¶
func (p *SitemapPayload) SetMatchLoc(matchLoc string) *SitemapPayload
func (*SitemapPayload) SetSearchLink ¶
func (p *SitemapPayload) SetSearchLink(searchLink string) *SitemapPayload
func (*SitemapPayload) SetSearchLoc ¶
func (p *SitemapPayload) SetSearchLoc(searchLoc string) *SitemapPayload
func (*SitemapPayload) SetStopOnDup ¶
func (p *SitemapPayload) SetStopOnDup(stopOnDup bool) *SitemapPayload
func (*SitemapPayload) StoppingOnDup ¶
func (p *SitemapPayload) StoppingOnDup() bool
type SysUser ¶
type SysUser struct { ID uuid.UUID `json:"id,omitempty" bson:"_id,omitempty"` Username string `json:"username,omitempty" bson:"username,omitempty"` Email string `json:"email,omitempty" bson:"email,omitempty"` Password string `json:"-" bson:"password,omitempty"` OTPSecret []byte `json:"-" bson:"otp_secret,omitempty"` CreatedAt time.Time `json:"created_at,omitempty" bson:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty" bson:"updated_at,omitempty"` }
func (*SysUser) CheckPassword ¶
func (*SysUser) GenerateOTPSecret ¶
func (*SysUser) GeneratePasswordHash ¶
Click to show internal directories.
Click to hide internal directories.