Versions in this module Expand all Collapse all v1 v1.0.10 Oct 7, 2023 v1.0.9 Oct 7, 2023 Changes in this version + var MessageForbidden = "没有权限" + var MessageRollbackChatMessageFailure = "撤回聊天消息失败" + func RateLimitMiddleware(limiter *goutils.Limiter) gin.HandlerFunc + type RollbackChatMessageRequest struct + MessageID int64 + SessionType int + TargetID int64 v1.0.8 Sep 26, 2023 v1.0.7 Sep 17, 2023 v1.0.6 Sep 13, 2023 v1.0.5 Sep 11, 2023 v1.0.4 Sep 10, 2023 Changes in this version + const MaxLoginFailTimes + const NeedCaptchaLoginFailTimes + var MessageEmptyCaptcha = "验证码未填写" + var MessageEmptyCaptchaID = "验证码ID未填写" + var MessageIncorrectUsernameOrPasswordMoreTimes = "用户或密码错误超过限制" + var MessageInvalidCaptcha = "验证码无效" + func GetCaptchaHandler(ctx *gin.Context) + func InitCaptcha() + func InitRouter() *gin.Engine + func InitSubscribe() type AuthLoginRequest + Captcha string + CaptchaID string type AuthLoginResponse + FailTimes *int64 + NeedCaptcha *bool type AuthRegisterRequest + Captcha string + CaptchaID string + type Captcha struct + DriverAudio base64Captcha.Driver + DriverChinese base64Captcha.Driver + DriverDigit base64Captcha.Driver + DriverLanguage base64Captcha.Driver + DriverMath base64Captcha.Driver + DriverString base64Captcha.Driver + Store base64Captcha.Store + type GetCaptchaRequest struct + Type string + type GetCaptchaResponse struct + Data string + ID string + Type string + type RedisCaptchaStore struct + func (s *RedisCaptchaStore) Get(id string, clear bool) string + func (s *RedisCaptchaStore) Set(id string, value string) error + func (s *RedisCaptchaStore) Verify(id string, answer string, clear bool) bool v1.0.3 Sep 8, 2023 Changes in this version + var MessageAlreadyFriends = "你们已经是好友关系" + var MessageInvalidLastMessageID = "'last_message_id'无效" + var MessageInvalidLimit = "'limit'无效" + var MessageInvalidTargetID = "'target_id'无效" + var MessageNotFound = "找不到记录" + func GetLastChatMessagesHandler(ctx *gin.Context) + type ChatMessage struct + ActionID string + Body ChatMessageBody + CreatedAt int64 + ID string + MessageID int64 + ReceiverID int64 + SenderID int64 + SessionType int + Type int + func (cm *ChatMessage) MarshalBinary() ([]byte, error) + func (cm *ChatMessage) UnmarshalBinary(data []byte) error + type GetLastChatMessagesRequest struct + SessionType int + TargetID int64 type Response + RequestID string type SendChatMessageRequest + TargetID int64 v1.0.2 Sep 7, 2023 v1.0.1 Sep 6, 2023 v1.0.0 Sep 6, 2023 Changes in this version + const LOGIN_USER_CONTEXT_KEY + const LOGIN_USER_ID_CONTEXT_KEY + const REQUEST_ID_CONTEXT_KEY + const REQUEST_LOGGER_CONTEXT_KEY + const StatusError + const StatusOK + var MessageAccountDeleted = "账户已删除" + var MessageAccountDisable = "账户已停用" + var MessageAccountExists = "账户已存在" + var MessageAccountNotExists = "账户不存在" + var MessageAlreadyfriends = "你们已经是好友关系" + var MessageBlockYou = "对方已将您拉黑" + var MessageChatYourself = "不可与自己聊天" + var MessageConfirmPasswordWrong = "确认密码错误" + var MessageIncorrectUsernameOrPassword = "用户名或密码错误" + var MessageInternalServerError = "内部服务错误" + var MessageInvalidGroupID = "'group_id'无效" + var MessageInvalidNickname = "'nickname'无效" + var MessageInvalidParams = "参数无效" + var MessageInvalidPassword = "'password'无效" + var MessageInvalidReceiverID = "'receiver_id'无效" + var MessageInvalidSessionType = "'session_type'无效" + var MessageInvalidTimeFormat = "时间格式无效" + var MessageInvalidType = "'type'无效" + var MessageInvalidUserID = "'user_id'无效" + var MessageInvalidUserIDs = "'user_ids'无效" + var MessageInvalidUsername = "'username'无效" + var MessageNotFriends = "您与对方不是好友关系" + var MessageTargetDeleted = "对方已删除" + var MessageTargetDisable = "对方已停用" + var MessageTargetNotExists = "对方不存在" + func AddFriendInviteHandler(ctx *gin.Context) + func AddGroupMemberHandler(ctx *gin.Context) + func AuthLoginHandler(ctx *gin.Context) + func AuthLogoutHandler(c *gin.Context) + func AuthRegisterHandler(ctx *gin.Context) + func CORSMiddleware() gin.HandlerFunc + func CheckAuthMiddleware() gin.HandlerFunc + func CreateGroupHandler(ctx *gin.Context) + func DeleteChatMessageHandler(ctx *gin.Context) + func FindFriendHandler(ctx *gin.Context) + func GetProfileInfoHandler(c *gin.Context) + func HTML(c *gin.Context, name string, obj ...any) + func Init() *gin.Engine + func JSON(c *gin.Context, obj ...any) + func JSONError(c *gin.Context, errorCode int, errorMsg string, obj ...any) + func JSONP(c *gin.Context, obj ...any) + func JSONPError(c *gin.Context, errorCode int, errorMsg string, obj ...any) + func JoinGroupHandler(ctx *gin.Context) + func LeaveGroupHandler(ctx *gin.Context) + func LoginUserFromContext(ctx *gin.Context) *database.User + func MessageInvalidFormat(val string) string + func RecoverMiddleware() gin.HandlerFunc + func RemoveGroupMemberHandler(ctx *gin.Context) + func RequestLogMiddleware() gin.HandlerFunc + func RollbackChatMessageHandler(ctx *gin.Context) + func SendChatMessageHandler(ctx *gin.Context) + func SubscribeChatMessageHandler(ctx context.Context, payload *pubsub.Payload) + func SubscribeFriendInviteHandler(ctx context.Context, payload *pubsub.Payload) + func UpdateFriendHandle(ctx *gin.Context) + func UpdateFriendInviteHandler(ctx *gin.Context) + func UpdateGroupHandler(ctx *gin.Context) + func UpdateGroupMemberHandler(ctx *gin.Context) + func WebsocketHandler(ctx *gin.Context) + func WebsocketMiddleware() gin.HandlerFunc + type AddFriendInviteRequest struct + Note string + UserID int64 + type AddGroupMemberRequest struct + GroupID int64 + UserIDs []int64 + type AddGroupMemberResponse struct + Count int64 + type AuthLoginRequest struct + Password string + Username string + type AuthLoginResponse struct + ExpiresAt int64 + Token string + type AuthRegisterRequest struct + BirthDate string + ConfirmPassword string + Nickname string + Password string + Username string + type AuthRegisterResponse struct + Avatar string + BirthDate string + Nickname string + UserID *int64 + Username string + type ChatMessageBody struct + Format string + Latitude string + LocationLabel string + Longitude string + Scale float64 + Size string + Src string + Text string + type CreateGroupRequest struct + MemberIDs []int64 + type CreateGroupResponse struct + GroupID int64 + GroupName string + type FindFriendRequest struct + Nickname *string + StartID *int64 + UserID *int64 + type FindFriendResponse struct + Users []*User + type JoinGroupRequest struct + GroupID int64 + type LeaveGroupRequest struct + GroupID int64 + type ProfileInfoResponse struct + Avatar string + BirthDate string + OnlineStatus int + Username string + type RemoveGroupMemberRequest struct + GroupID int64 + UserIDs []int64 + type RemoveGroupMemberResponse struct + Count int64 + type Response struct + Data any + Error string + Status int + type SendChatMessageRequest struct + ActionID string + Body ChatMessageBody + ReceiverID int64 + SessionType int + Type int + type SendChatMessageResponse struct + CreatedAt int64 + MessageID int64 + SenderID int64 + type UpdateFriendInviteRequest struct + ID int64 + Reply string + Status int + type UpdateFriendRequest struct + BlockStatus *int + Remark *string + Status *int + UserID int64 + type UpdateGroupMemberRequest struct + GroupID int64 + Role *int + SpeakStatus *int + UserID int64 + type UpdateGroupRequest struct + GroupID int64 + Name *string + OwnerID *int64 + SpeakStatus *int + type User struct + Avatar string + BirthDate *time.Time + ID int64 + Nickname string + OnlineStatus int + Username string + type UserClaims struct + UserID int64 + type WebsocketMessageRequest struct + Action string + ActionID string + Data any + type WebsocketMessageResponse struct + Action string + ActionID string + Data any