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.getDefaultBranch
6
7import (
8 "context"
9
10 "github.com/bluesky-social/indigo/lex/util"
11)
12
13const (
14 RepoGetDefaultBranchNSID = "sh.tangled.repo.getDefaultBranch"
15)
16
17// RepoGetDefaultBranch_Output is the output of a sh.tangled.repo.getDefaultBranch call.
18type RepoGetDefaultBranch_Output struct {
19 Author *RepoGetDefaultBranch_Signature `json:"author,omitempty" cborgen:"author,omitempty"`
20 // hash: Latest commit hash on default branch
21 Hash string `json:"hash" cborgen:"hash"`
22 // message: Latest commit message
23 Message *string `json:"message,omitempty" cborgen:"message,omitempty"`
24 // name: Default branch name
25 Name string `json:"name" cborgen:"name"`
26 // shortHash: Short commit hash
27 ShortHash *string `json:"shortHash,omitempty" cborgen:"shortHash,omitempty"`
28 // when: Timestamp of latest commit
29 When string `json:"when" cborgen:"when"`
30}
31
32// RepoGetDefaultBranch_Signature is a "signature" in the sh.tangled.repo.getDefaultBranch schema.
33type RepoGetDefaultBranch_Signature struct {
34 // email: Author email
35 Email string `json:"email" cborgen:"email"`
36 // name: Author name
37 Name string `json:"name" cborgen:"name"`
38 // when: Author timestamp
39 When string `json:"when" cborgen:"when"`
40}
41
42// RepoGetDefaultBranch calls the XRPC method "sh.tangled.repo.getDefaultBranch".
43//
44// repo: Repository identifier in format 'did:plc:.../repoName'
45func RepoGetDefaultBranch(ctx context.Context, c util.LexClient, repo string) (*RepoGetDefaultBranch_Output, error) {
46 var out RepoGetDefaultBranch_Output
47
48 params := map[string]interface{}{}
49 params["repo"] = repo
50 if err := c.LexDo(ctx, util.Query, "", "sh.tangled.repo.getDefaultBranch", params, nil, &out); err != nil {
51 return nil, err
52 }
53
54 return &out, nil
55}