Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUserNotFound = errors.New("user is not found") ErrSuchUserAlreadyExists = errors.New("user with such username or email already exists") ErrWrongCurrentPassword = errors.New("wrong current password") ErrGroupNotFound = errors.New("group is not found") ErrGroupParticipantNotFound = errors.New("group participant is not found") ErrDialogNotFound = errors.New("dialog is not found") ErrSuchDialogAlreadyExists = errors.New("such a dialog already exists") ErrCreateDialogWithYourself = errors.New("creating a dialog with yourself") ErrCreateDialogWithNonExistentUser = errors.New("creating a dialog with a non-existent user") ErrIncorrectGroupParticipantStatusTransit = errors.New("incorrect group participant status transit") ErrSuchGroupParticipantAlreadyExists = errors.New("such a group participant already exists") ErrAddNonExistentUserToGroup = errors.New("addition non-existent user to group") ErrForbiddenPerformAction = errors.New("it's forbidden to perform this action") )
View Source
var ( MxActionOnSomeone = StatusMatrix{ JoinedStatus: newStatusSet(KickedStatus), KickedStatus: newStatusSet(JoinedStatus), } MxActionOnOneself = StatusMatrix{ JoinedStatus: newStatusSet(LeftStatus), LeftStatus: newStatusSet(JoinedStatus), } )
Functions ¶
This section is empty.
Types ¶
type ContentType ¶
type ContentType string
const ( TextContentType ContentType = "text" ImageContentType ContentType = "image" )
func (ContentType) String ¶
func (ct ContentType) String() string
type Dialog ¶
type Dialog struct { ID int IsBlocked bool Partner DialogPartner CreatedAt time.Time }
type DialogPartner ¶
type GroupParticipant ¶
type GroupParticipant struct { GroupID int UserID int IsAdmin bool Status GroupParticipantStatus }
func (GroupParticipant) IsInGroup ¶
func (p GroupParticipant) IsInGroup() bool
type GroupParticipantStatus ¶
type GroupParticipantStatus string
const ( JoinedStatus GroupParticipantStatus = "joined" KickedStatus GroupParticipantStatus = "kicked" LeftStatus GroupParticipantStatus = "left" )
func (GroupParticipantStatus) String ¶
func (gps GroupParticipantStatus) String() string
type ParticipantEvent ¶
type ParticipantEvent struct { Type ParticipantEventType ChatID ChatID UserID int }
type ParticipantEventType ¶
type ParticipantEventType string
const ( AddedParticipant ParticipantEventType = "added" RemovedParticipant ParticipantEventType = "removed" )
func (ParticipantEventType) String ¶
func (et ParticipantEventType) String() string
type StatusMatrix ¶
type StatusMatrix map[GroupParticipantStatus]StatusSet
func (StatusMatrix) IsCorrectTransit ¶
func (mx StatusMatrix) IsCorrectTransit(from, to GroupParticipantStatus) bool
type StatusSet ¶
type StatusSet map[GroupParticipantStatus]bool
Click to show internal directories.
Click to hide internal directories.