A fork of https://github.com/teal-fm/piper
at main 58 lines 3.3 kB view raw
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package bsky 4 5// schema: app.bsky.unspecced.searchPostsSkeleton 6 7import ( 8 "context" 9 10 "github.com/bluesky-social/indigo/xrpc" 11) 12 13// UnspeccedSearchPostsSkeleton_Output is the output of a app.bsky.unspecced.searchPostsSkeleton call. 14type UnspeccedSearchPostsSkeleton_Output struct { 15 Cursor *string `json:"cursor,omitempty" cborgen:"cursor,omitempty"` 16 // hitsTotal: Count of search hits. Optional, may be rounded/truncated, and may not be possible to paginate through all hits. 17 HitsTotal *int64 `json:"hitsTotal,omitempty" cborgen:"hitsTotal,omitempty"` 18 Posts []*UnspeccedDefs_SkeletonSearchPost `json:"posts" cborgen:"posts"` 19} 20 21// UnspeccedSearchPostsSkeleton calls the XRPC method "app.bsky.unspecced.searchPostsSkeleton". 22// 23// author: Filter to posts by the given account. Handles are resolved to DID before query-time. 24// cursor: Optional pagination mechanism; may not necessarily allow scrolling through entire result set. 25// domain: Filter to posts with URLs (facet links or embeds) linking to the given domain (hostname). Server may apply hostname normalization. 26// lang: Filter to posts in the given language. Expected to be based on post language field, though server may override language detection. 27// mentions: Filter to posts which mention the given account. Handles are resolved to DID before query-time. Only matches rich-text facet mentions. 28// q: Search query string; syntax, phrase, boolean, and faceting is unspecified, but Lucene query syntax is recommended. 29// since: Filter results for posts after the indicated datetime (inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYYY-MM-DD). 30// sort: Specifies the ranking order of results. 31// tag: Filter to posts with the given tag (hashtag), based on rich-text facet or tag field. Do not include the hash (#) prefix. Multiple tags can be specified, with 'AND' matching. 32// until: Filter results for posts before the indicated datetime (not inclusive). Expected to use 'sortAt' timestamp, which may not match 'createdAt'. Can be a datetime, or just an ISO date (YYY-MM-DD). 33// url: Filter to posts with links (facet links or embeds) pointing to this URL. Server may apply URL normalization or fuzzy matching. 34// viewer: DID of the account making the request (not included for public/unauthenticated queries). Used for 'from:me' queries. 35func UnspeccedSearchPostsSkeleton(ctx context.Context, c *xrpc.Client, author string, cursor string, domain string, lang string, limit int64, mentions string, q string, since string, sort string, tag []string, until string, url string, viewer string) (*UnspeccedSearchPostsSkeleton_Output, error) { 36 var out UnspeccedSearchPostsSkeleton_Output 37 38 params := map[string]interface{}{ 39 "author": author, 40 "cursor": cursor, 41 "domain": domain, 42 "lang": lang, 43 "limit": limit, 44 "mentions": mentions, 45 "q": q, 46 "since": since, 47 "sort": sort, 48 "tag": tag, 49 "until": until, 50 "url": url, 51 "viewer": viewer, 52 } 53 if err := c.Do(ctx, xrpc.Query, "", "app.bsky.unspecced.searchPostsSkeleton", params, nil, &out); err != nil { 54 return nil, err 55 } 56 57 return &out, nil 58}