~james/core

core/api/org_tangled/tempgitgetRef.go -rw-r--r-- 1.5 KiB
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 14 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.

package org_tangled

// schema: org.tangled.temp.git.getRef

import (
	"context"

	"github.com/bluesky-social/indigo/lex/util"
)

const (
	TempGitGetRefNSID = "org.tangled.temp.git.getRef"
)

// TempGitGetRef_Output is the output of a org.tangled.temp.git.getRef call.
type TempGitGetRef_Output struct {
	// annotation: Present only for annotated tags
	Annotation *TempGitListTags_Annotation `json:"annotation,omitempty" cborgen:"annotation,omitempty"`
	Author     *GitDefs_Signature          `json:"author" cborgen:"author"`
	// message: Latest commit message
	Message string `json:"message" cborgen:"message"`
	// name: Full reference name. Example: refs/heads/master
	Name string `json:"name" cborgen:"name"`
	// oid: Latest commit oid on this reference.
	Oid string `json:"oid" cborgen:"oid"`
	// totalCommits: Number of commits reachable from this tip
	TotalCommits int64 `json:"totalCommits" cborgen:"totalCommits"`
}

// TempGitGetRef calls the XRPC method "org.tangled.temp.git.getRef".
//
// ref: Reference name. Such as master, refs/heads/master, or v1.16.0-alpha.
// repo: DID of the repository
func TempGitGetRef(ctx context.Context, c util.LexClient, ref string, repo string) (*TempGitGetRef_Output, error) {
	var out TempGitGetRef_Output

	params := map[string]interface{}{}
	params["ref"] = ref
	params["repo"] = repo
	if err := c.LexDo(ctx, util.Query, "", "org.tangled.temp.git.getRef", params, nil, &out); err != nil {
		return nil, err
	}

	return &out, nil
}