lexicon devex tutorial
at main 1.1 kB view raw
1// Code generated by indigo lexgen tool. DO NOT EDIT MANUALLY. 2 3// Lexicon schema: place.atwork.getListing 4 5package placeatwork 6 7import ( 8 "context" 9 10 lexutil "github.com/bluesky-social/indigo/lex/util" 11) 12 13// GetListing_Output is the output of a place.atwork.getListing call. 14type GetListing_Output struct { 15 // cid: CID of the listing record 16 Cid *string `json:"cid,omitempty" cborgen:"cid,omitempty"` 17 // uri: AT-URI of the listing 18 Uri string `json:"uri" cborgen:"uri"` 19 // value: The job listing record 20 Value Listing `json:"value" cborgen:"value"` 21} 22 23// GetListing calls the XRPC method "place.atwork.getListing". 24// 25// # Get a single job listing by repo (DID) and record key 26// 27// repo: The DID of the repo (repository owner) 28// rkey: The record key (TID) 29func GetListing(ctx context.Context, c lexutil.LexClient, repo string, rkey string) (*GetListing_Output, error) { 30 var out GetListing_Output 31 32 params := map[string]interface{}{} 33 params["repo"] = repo 34 params["rkey"] = rkey 35 36 if err := c.LexDo(ctx, lexutil.Query, "", "place.atwork.getListing", params, nil, &out); err != nil { 37 return nil, err 38 } 39 return &out, nil 40}