search

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrPermissionsRequired  = "permissions required"
	ErrIncorrectGuildID     = "incorrect guild ID"
	ErrUnableToParseBody    = "unable to parse body"
	ErrUnableToFindMessages = "unable to find messages"
	ErrUnableToGetMessages  = "unable to get messages"
	ErrUnableToGetUsers     = "unable to get users"

	// Validation error messages
	ErrMentionIdInvalid   = "mention ID must be positive"
	ErrIncorrectChannelID = "incorrect channel ID"
	ErrChannelIDRequired  = "channel ID is required"
)

Variables

This section is empty.

Functions

func New

func New(dbcon *db.CQLCon, pg *pgdb.DB, search *msgsearch.Search, log *slog.Logger) server.Entity

Types

type MessageSearchRequest

type MessageSearchRequest struct {
	ChannelId int64    `json:"channel_id" example:"2230469276416868352"` // Channel ID to search in. Required.
	Mentions  []int64  `json:"mentions" example:"2230469276416868352"`   // Mentions contains a list of int64 user IDs.
	AuthorId  *int64   `json:"author_id" example:"2230469276416868352"`  // Author ID to search by.
	Content   *string  `json:"content" example:"Hello world!"`           // Content contains a string to search for. Might be empty if need to search by other parameters.
	Has       []string `json:"has" enums:"url,image,video,file"`         // List of specific features to search for.
	Page      int      `json:"page" default:"0"`                         // Page number to get. Starts from 0.
}

func (MessageSearchRequest) Validate

func (r MessageSearchRequest) Validate() error

type MessageSearchResponse

type MessageSearchResponse struct {
	Messages []dto.Message `json:"messages"` // List of messages
	Pages    int           `json:"pages"`    // Total number of pages with current search parameters
}

Jump to

Keyboard shortcuts

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