forked from
tangled.org/core
fork
Configure Feed
Select the types of activity you want to include in your feed.
Monorepo for Tangled
fork
Configure Feed
Select the types of activity you want to include in your feed.
1// Code generated by cmd/lexgen (see Makefile's lexgen); DO NOT EDIT.
2
3package tangled
4
5// schema: sh.tangled.repo.branch
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 RepoBranchNSID = "sh.tangled.repo.branch"
15)
16
17// RepoBranch_Output is the output of a sh.tangled.repo.branch call.
18type RepoBranch_Output struct {
19 Author *RepoBranch_Signature `json:"author,omitempty" cborgen:"author,omitempty"`
20 // hash: Latest commit hash on this branch
21 Hash string `json:"hash" cborgen:"hash"`
22 // isDefault: Whether this is the default branch
23 IsDefault *bool `json:"isDefault,omitempty" cborgen:"isDefault,omitempty"`
24 // message: Latest commit message
25 Message *string `json:"message,omitempty" cborgen:"message,omitempty"`
26 // name: Branch name
27 Name string `json:"name" cborgen:"name"`
28 // shortHash: Short commit hash
29 ShortHash *string `json:"shortHash,omitempty" cborgen:"shortHash,omitempty"`
30 // when: Timestamp of latest commit
31 When string `json:"when" cborgen:"when"`
32}
33
34// RepoBranch_Signature is a "signature" in the sh.tangled.repo.branch schema.
35type RepoBranch_Signature struct {
36 // email: Author email
37 Email string `json:"email" cborgen:"email"`
38 // name: Author name
39 Name string `json:"name" cborgen:"name"`
40 // when: Author timestamp
41 When string `json:"when" cborgen:"when"`
42}
43
44// RepoBranch calls the XRPC method "sh.tangled.repo.branch".
45//
46// name: Branch name to get information for
47// repo: Repository identifier in format 'did:plc:.../repoName'
48func RepoBranch(ctx context.Context, c util.LexClient, name string, repo string) (*RepoBranch_Output, error) {
49 var out RepoBranch_Output
50
51 params := map[string]interface{}{}
52 params["name"] = name
53 params["repo"] = repo
54 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.branch", params, nil, &out); err != nil {
55 return nil, err
56 }
57
58 return &out, nil
59}