servermsg

package
v0.0.0-...-0f16109 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MsgSomethingWentWrong                  = "something went wrong"
	MsgInvalidToken                        = "invalid token"
	MsgInvalidTokenAlgorithm               = "invalid token algorithm"
	MsgFieldRequired                       = "this field is required"
	MsgInvalidLengthOfUsername             = "the username must be between 6 and 191 characters"
	MsgConflictUsername                    = "This username already exists"
	MsgInvalidEmailFormat                  = "Invalid email format"
	MsgInvalidUsernameFormat               = "Invalid username. Please do not use spaces or non-English characters"
	MsgInvalidInput                        = "invalid input"
	MsgInvalidLengthOfPassword             = "the password must be between 8 and 64 characters"
	MsgInvalidLengthOfFullname             = "the fullname must be between 3 and 191 characters"
	MsgInvalidLengthOfEmail                = "the email must be between 10 and 255 characters"
	MsgInvalidUserRole                     = "invalid user role"
	MsgRecordNotFound                      = "record not found"
	MsgInvalidLengthOfUserID               = "the user id must be less than 255 characters"
	MsgInvalidNotificationType             = "invalid notification type"
	MsgInvalidNotificationChannelDelivery  = "invalid notification channel delivery"
	MsgConflictNotificationChannelDelivery = "channel delivery has conflict"
	MsgPageSizeMin                         = "page size must be greater than 0"
	MsgPageMin                             = "page must be greater than 0"
	MsgInvalidLengthOfTemplateName         = "the name must be between 1 and 255"
	MsgInvalidTemplateContent              = "invalid template contents"
	MsgConflictTemplateChannel             = "template channel has conflict"
	MsgConflictTemplateChannelLang         = "template content channel language has conflict"
	MsgConflictTemplate                    = "template is already exists"
	MsgTemplateNotFound                    = "this template does not exist"
	MsgInvalidIgnoreChannel                = "invalid ignore channel"

	MsgQuickConnectReservedUsername = "this username is reserved and cannot be changed"

	MsgUsernameAndPasswordAreRequired = "username and password are required"
	MsgPasswordIsNotCorrect           = "password is not correct"
	MsgPasswordChangedSuccessfully    = "password changed successfully"
	MsgUserDeletedSuccessfully        = "user deleted successfully"
	MsgUserUpdatedSuccessfully        = "user updated successfully"
	MsgUserCreatedSuccessfully        = "user created successfully"
	MsgProfileUpdatedSuccessfully     = "profile updated successfully"

	MsgInvalidConversationStatus           = "invalid conversation status"
	MsgInvalidMessageType                  = "invalid message type"
	MsgYouNotParticipantInThisConversation = "you not participant in this conversation"
	MsgConversationNotFound                = "this conversation does not exists"
	MsgConversationAlreadyClosed           = "this conversation already closed"

	MsgFileInNotPublic      = "this file does not public"
	MsgFileNotFound         = "this file does not exists"
	MsgFileAlreadyConfirmed = "this file already confirmed!"

	MsgInvalidLengthOfStoryTitle    = "the title must be between 3 and 255 characters"
	MsgInvalidLengthOfStoryCaption  = "the caption must be between 3 and 2000 characters"
	MsgInvalidLengthOfStoryLinkURL  = "the link url must be between 10 and 255 characters"
	MsgInvalidLengthOfStoryLinkText = "the link text must be between 3 and 100 characters"
	MsgStoryMediaRequirePublic      = "media Story must be public"
	MsgMediaAlreadyUse              = "this media has already been used."
)

Variables

This section is empty.

Functions

func GRPCCodeToHTTPStatusCode

func GRPCCodeToHTTPStatusCode(code codes.Code) int

func GRPCMsg

func GRPCMsg(err error, t *translation.Translate, logger *slog.Logger) error

GRPCMsg converts a richerror into a gRPC status error, potentially with details.

func HTTPMsg

func HTTPMsg(c echo.Context, err error, t *translation.Translate) error

Types

type ErrorResponse

type ErrorResponse struct {
	Message string            `json:"message"`
	Errors  map[string]string `json:"errors"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL