// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. package tangled // schema: sh.tangled.repo.blob import ( "context" "github.com/bluesky-social/indigo/lex/util" ) const ( RepoBlobNSID = "sh.tangled.repo.blob" ) // RepoBlob_LastCommit is a "lastCommit" in the sh.tangled.repo.blob schema. type RepoBlob_LastCommit struct { Author *RepoBlob_Signature `json:"author,omitempty" cborgen:"author,omitempty"` // hash: Commit hash Hash string `json:"hash" cborgen:"hash"` // message: Commit message Message string `json:"message" cborgen:"message"` // shortHash: Short commit hash ShortHash *string `json:"shortHash,omitempty" cborgen:"shortHash,omitempty"` // when: Commit timestamp When string `json:"when" cborgen:"when"` } // RepoBlob_Output is the output of a sh.tangled.repo.blob call. type RepoBlob_Output struct { // content: File content (base64 encoded for binary files) Content string `json:"content" cborgen:"content"` // encoding: Content encoding Encoding *string `json:"encoding,omitempty" cborgen:"encoding,omitempty"` // isBinary: Whether the file is binary IsBinary *bool `json:"isBinary,omitempty" cborgen:"isBinary,omitempty"` LastCommit *RepoBlob_LastCommit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` // mimeType: MIME type of the file MimeType *string `json:"mimeType,omitempty" cborgen:"mimeType,omitempty"` // path: The file path Path string `json:"path" cborgen:"path"` // ref: The git reference used Ref string `json:"ref" cborgen:"ref"` // size: File size in bytes Size *int64 `json:"size,omitempty" cborgen:"size,omitempty"` } // RepoBlob_Signature is a "signature" in the sh.tangled.repo.blob schema. type RepoBlob_Signature struct { // email: Author email Email string `json:"email" cborgen:"email"` // name: Author name Name string `json:"name" cborgen:"name"` // when: Author timestamp When string `json:"when" cborgen:"when"` } // RepoBlob calls the XRPC method "sh.tangled.repo.blob". // // path: Path to the file within the repository // raw: Return raw file content instead of JSON response // ref: Git reference (branch, tag, or commit SHA) // repo: Repository identifier in format 'did:plc:.../repoName' func RepoBlob(ctx context.Context, c util.LexClient, path string, raw bool, ref string, repo string) (*RepoBlob_Output, error) { var out RepoBlob_Output params := map[string]interface{}{} params["path"] = path if raw { params["raw"] = raw } params["ref"] = ref params["repo"] = repo if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.blob", params, nil, &out); err != nil { return nil, err } return &out, nil }