search

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

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

	// BasePathV2 is the base path for serving v2 of the search API, minus the 'api' prefix
	BasePathV2 = "/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

This section is empty.

Types

type Module

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

func New

func New(processor *processing.Processor) *Module

func (*Module) Route

func (m *Module) Route(attachHandler func(method string, path string, f ...gin.HandlerFunc) gin.IRoutes)

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