Monorepo for Tangled
tangled.org
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.git.temp.getEntry
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 GitTempGetEntryNSID = "sh.tangled.git.temp.getEntry"
15)
16
17// GitTempGetEntry_Output is the output of a sh.tangled.git.temp.getEntry call.
18type GitTempGetEntry_Output struct {
19 LastCommit *GitTempDefs_Commit `json:"lastCommit,omitempty" cborgen:"lastCommit,omitempty"`
20 Mode string `json:"mode" cborgen:"mode"`
21 // name: The file name
22 Name string `json:"name" cborgen:"name"`
23 Oid string `json:"oid" cborgen:"oid"`
24 // size: Blob size
25 Size int64 `json:"size" cborgen:"size"`
26 // submodule: Submodule information if path is a submodule
27 Submodule *GitTempDefs_Submodule `json:"submodule,omitempty" cborgen:"submodule,omitempty"`
28}
29
30// GitTempGetEntry calls the XRPC method "sh.tangled.git.temp.getEntry".
31//
32// path: path of the entity
33// ref: Git revision (branch, tag, or commit id)
34// repo: DID of the repository
35func GitTempGetEntry(ctx context.Context, c util.LexClient, path string, ref string, repo string) (*GitTempGetEntry_Output, error) {
36 var out GitTempGetEntry_Output
37
38 params := map[string]interface{}{}
39 params["path"] = path
40 if ref != "" {
41 params["ref"] = ref
42 }
43 params["repo"] = repo
44 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.git.temp.getEntry", params, nil, &out); err != nil {
45 return nil, err
46 }
47
48 return &out, nil
49}