forked from tangled.org/core
this repo has no description
at master 2.7 kB view raw
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT. 2 3package tangled 4 5// schema: sh.tangled.repo.blob 6 7import ( 8 "context" 9 10 "github.com/bluesky-social/indigo/lex/util" 11) 12 13const ( 14 RepoBlobNSID = "sh.tangled.repo.blob" 15) 16 17// RepoBlob_LastCommit is a "lastCommit" in the sh.tangled.repo.blob schema. 18type RepoBlob_LastCommit struct { 19 Author *RepoBlob_Signature `json:"author,omitempty" cborgen:"author,omitempty"` 20 // hash: Commit hash 21 Hash string `json:"hash" cborgen:"hash"` 22 // message: Commit message 23 Message string `json:"message" cborgen:"message"` 24 // shortHash: Short commit hash 25 ShortHash *string `json:"shortHash,omitempty" cborgen:"shortHash,omitempty"` 26 // when: Commit timestamp 27 When string `json:"when" cborgen:"when"` 28} 29 30// RepoBlob_Output is the output of a sh.tangled.repo.blob call. 31type RepoBlob_Output struct { 32 // content: File content (base64 encoded for binary files) 33 Content string `json:"content" cborgen:"content"` 34 // encoding: Content encoding 35 Encoding *string `json:"encoding,omitempty" cborgen:"encoding,omitempty"` 36 // isBinary: Whether the file is binary 37 IsBinary *bool `json:"isBinary,omitempty" cborgen:"isBinary,omitempty"` 38 LastCommit *RepoBlob_LastCommit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"` 39 // mimeType: MIME type of the file 40 MimeType *string `json:"mimeType,omitempty" cborgen:"mimeType,omitempty"` 41 // path: The file path 42 Path string `json:"path" cborgen:"path"` 43 // ref: The git reference used 44 Ref string `json:"ref" cborgen:"ref"` 45 // size: File size in bytes 46 Size *int64 `json:"size,omitempty" cborgen:"size,omitempty"` 47} 48 49// RepoBlob_Signature is a "signature" in the sh.tangled.repo.blob schema. 50type RepoBlob_Signature struct { 51 // email: Author email 52 Email string `json:"email" cborgen:"email"` 53 // name: Author name 54 Name string `json:"name" cborgen:"name"` 55 // when: Author timestamp 56 When string `json:"when" cborgen:"when"` 57} 58 59// RepoBlob calls the XRPC method "sh.tangled.repo.blob". 60// 61// path: Path to the file within the repository 62// raw: Return raw file content instead of JSON response 63// ref: Git reference (branch, tag, or commit SHA) 64// repo: Repository identifier in format 'did:plc:.../repoName' 65func RepoBlob(ctx context.Context, c util.LexClient, path string, raw bool, ref string, repo string) (*RepoBlob_Output, error) { 66 var out RepoBlob_Output 67 68 params := map[string]interface{}{} 69 params["path"] = path 70 if raw { 71 params["raw"] = raw 72 } 73 params["ref"] = ref 74 params["repo"] = repo 75 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.blob", params, nil, &out); err != nil { 76 return nil, err 77 } 78 79 return &out, nil 80}