Documentation ¶
Index ¶
- Constants
- type Feed
- type FeedItem
- type Provider
- type ProviderData
- type Role
- type Room
- type RoomPermission
- type RoomType
- type User
- func (u *User) CheckPassword(password string) error
- func (u *User) CheckTOTP(password string) error
- func (u *User) GenerateOTPSecret(size uint) (err error)
- func (u *User) GeneratePasswordHash() error
- func (u *User) HasPassword() bool
- func (u *User) HasProvider(provider Provider) bool
- func (u *User) IsGranted(roles ...Role) bool
- func (u *User) Secret() string
Constants ¶
View Source
const ( Private RoomType = "private" Group RoomType = "group" SuperGroup RoomType = "supergroup" Channel RoomType = "channel" BeEdited RoomPermission = "be_edited" ManageChat RoomPermission = "manage_chat" PostMessages RoomPermission = "post_messages" EditMessages RoomPermission = "edit_messages" DeleteMessages RoomPermission = "delete_messages" ManageVoiceChats RoomPermission = "manage_voice_chats" RestrictMembers RoomPermission = "restrict_members" PromoteMembers RoomPermission = "promote_members" ChangeInfo RoomPermission = "change_info" InviteUsers RoomPermission = "invite_users" PinMessages RoomPermission = "pin_messages" SendMessages RoomPermission = "send_messages" SendMediaMessages RoomPermission = "send_media_messages" SendPolls RoomPermission = "send_polls" SendOtherMessages RoomPermission = "send_other_messages" AddWebPagePreviews RoomPermission = "add_web_page_previews" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Feed ¶
type Feed struct { Id string `json:"id,omitempty" bson:"_id,omitempty"` By int64 `json:"by,omitempty" bson:"by,omitempty"` Languages []string `json:"languages,omitempty" bson:"languages,omitempty"` Host string `json:"host,omitempty" bson:"host,omitempty"` Title string `json:"title,omitempty" bson:"title,omitempty"` Link string `json:"link,omitempty" bson:"link,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 (*Feed) SetEnabled ¶
type FeedItem ¶
type FeedItem struct { Id string `json:"id,omitempty" bson:"_id,omitempty"` FeedId string `json:"feed_id,omitempty" bson:"feed_id,omitempty"` Title string `json:"title,omitempty" bson:"title,omitempty"` Desc *string `json:"desc,omitempty" bson:"desc,omitempty"` Link string `json:"link,omitempty" bson:"link,omitempty"` Guid string `json:"guid,omitempty" bson:"guid,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"` Authors []string `json:"authors,omitempty" bson:"authors,omitempty"` Categories []string `json:"categories,omitempty" bson:"categories,omitempty"` }
type ProviderData ¶
type ProviderData struct { Name Provider `json:"name,omitempty" bson:"name,omitempty"` Value string `json:"value,omitempty" bson:"value,omitempty"` Delete bool `json:"-" bson:"-"` }
func (*ProviderData) Is ¶
func (p *ProviderData) Is(provider Provider) bool
type Room ¶
type Room struct { Id int64 `json:"id,omitempty" bson:"_id,omitempty"` Type RoomType `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 *[]string `json:"broadcast,omitempty" bson:"broadcast,omitempty"` Permissions *[]RoomPermission `json:"permissions,omitempty" bson:"permissions,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 (*Room) SetBroadcast ¶
func (*Room) SetDeleted ¶
func (*Room) SetPermissions ¶
func (r *Room) SetPermissions(permissions []RoomPermission) *Room
type RoomPermission ¶
type RoomPermission string
type User ¶
type User struct { Id string `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"` Roles []Role `json:"roles,omitempty" bson:"roles,omitempty"` DeleteRoles []Role `json:"-" bson:"-"` Providers []ProviderData `json:"providers,omitempty" bson:"providers,omitempty"` CreatedAt time.Time `json:"created_at,omitempty" bson:"created_at,omitempty"` UpdatedAt time.Time `json:"updated_at,omitempty" bson:"updated_at,omitempty"` }
func (*User) CheckPassword ¶
func (*User) GenerateOTPSecret ¶
func (*User) GeneratePasswordHash ¶
func (*User) HasPassword ¶
func (*User) HasProvider ¶
Click to show internal directories.
Click to hide internal directories.