search

package
v0.6.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// BasePathV1 is the base path for serving v1 of the search API
	BasePathV1 = "/api/v1/search"

	// BasePathV2 is the base path for serving v2 of the search API
	BasePathV2 = "/api/v2/search"

	// AccountIDKey -- If provided, statuses returned will be authored only by this account
	AccountIDKey = "account_id"
	// MaxIDKey -- Return results older than this id
	MaxIDKey = "max_id"
	// MinIDKey -- Return results immediately newer than this id
	MinIDKey = "min_id"
	// TypeKey -- Enum(accounts, hashtags, statuses)
	TypeKey = "type"
	// ExcludeUnreviewedKey -- Filter out unreviewed tags? Defaults to false. Use true when trying to find trending tags.
	ExcludeUnreviewedKey = "exclude_unreviewed"
	// QueryKey -- The search query
	QueryKey = "q"
	// ResolveKey -- Attempt WebFinger lookup. Defaults to false.
	ResolveKey = "resolve"
	// LimitKey -- Maximum number of results to load, per type. Defaults to 20. Max 40.
	LimitKey = "limit"
	// OffsetKey -- Offset in search results. Used for pagination. Defaults to 0.
	OffsetKey = "offset"
	// FollowingKey -- Only include accounts that the user is following. Defaults to false.
	FollowingKey = "following"

	// TypeAccounts --
	TypeAccounts = "accounts"
	// TypeHashtags --
	TypeHashtags = "hashtags"
	// TypeStatuses --
	TypeStatuses = "statuses"
)

Variables

This section is empty.

Functions

func New

func New(processor processing.Processor) api.ClientModule

New returns a new search module

Types

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module implements the ClientAPIModule interface for everything related to searching

func (*Module) Route

func (m *Module) Route(r router.Router) error

Route attaches all routes from this module to the given router

func (*Module) SearchGETHandler

func (m *Module) SearchGETHandler(c *gin.Context)

SearchGETHandler swagger:operation GET /api/v1/search searchGet

Search for statuses, accounts, or hashtags, on this instance or elsewhere.

If statuses are in the result, they will be returned in descending chronological order (newest first), with sequential IDs (bigger = newer).

---
tags:
- search

security:
- OAuth2 Bearer:
	- read:search

responses:
	'200':
		name: search results
		description: Results of the search.
		schema:
			type: array
			items:
				"$ref": "#/definitions/searchResult"
	'400':
		description: bad request
	'401':
		description: unauthorized
	'404':
		description: not found
	'406':
		description: not acceptable
	'500':
		description: internal server error

Jump to

Keyboard shortcuts

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