// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. package tangled // schema: sh.tangled.repo.blame import ( "context" "github.com/bluesky-social/indigo/lex/util" ) const ( RepoBlameNSID = "sh.tangled.repo.blame" ) // RepoBlame_Author is a "author" in the sh.tangled.repo.blame schema. type RepoBlame_Author struct { Email string `json:"email" cborgen:"email"` Name string `json:"name" cborgen:"name"` } // RepoBlame_Commit is a "commit" in the sh.tangled.repo.blame schema. type RepoBlame_Commit struct { Author *RepoBlame_Author `json:"author" cborgen:"author"` // authoredAt: Git author timestamp AuthoredAt string `json:"authoredAt" cborgen:"authoredAt"` Sha string `json:"sha" cborgen:"sha"` Subject string `json:"subject" cborgen:"subject"` } // RepoBlame_Output is the output of a sh.tangled.repo.blame call. type RepoBlame_Output struct { // commit: The resolved git commit object ID Commit string `json:"commit" cborgen:"commit"` // commits: Unique commits referenced by blame runs Commits []*RepoBlame_Commit `json:"commits" cborgen:"commits"` // runs: Complete, gap-free one-based line ranges sorted by start Runs []*RepoBlame_Run `json:"runs" cborgen:"runs"` } // RepoBlame_Run is a "run" in the sh.tangled.repo.blame schema. type RepoBlame_Run struct { // commit: SHA of the commit in the output commits array Commit string `json:"commit" cborgen:"commit"` // count: Number of consecutive lines in this run Count int64 `json:"count" cborgen:"count"` // start: First one-based line in this run Start int64 `json:"start" cborgen:"start"` } // RepoBlame calls the XRPC method "sh.tangled.repo.blame". // // path: Path to the file within the repository // ref: Git reference (branch, tag, or commit SHA) // repo: AT-URI of the sh.tangled.repo record func RepoBlame(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*RepoBlame_Output, error) { var out RepoBlame_Output params := map[string]interface{}{} params["path"] = path params["ref"] = ref params["repo"] = repo if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.blame", params, nil, &out); err != nil { return nil, err } return &out, nil }