(srv *dagql.Server)
| 49 | type gitSchema struct{} |
| 50 | |
| 51 | func (s *gitSchema) Install(srv *dagql.Server) { |
| 52 | dagql.Fields[*core.Query]{ |
| 53 | dagql.NodeFunc("git", s.git). |
| 54 | WithInput(dagql.PerClientInput). |
| 55 | View(AllVersion). |
| 56 | Doc(`Queries a Git repository.`). |
| 57 | Args( |
| 58 | dagql.Arg("url").Doc( |
| 59 | `URL of the git repository.`, |
| 60 | "Can be formatted as `https://{host}/{owner}/{repo}`, `git@{host}:{owner}/{repo}`.", |
| 61 | `Suffix ".git" is optional.`), |
| 62 | dagql.Arg("keepGitDir"). |
| 63 | View(AllVersion). |
| 64 | Default(dagql.Opt(dagql.Boolean(true))). |
| 65 | Doc(`Set to true to keep .git directory.`).Deprecated(), |
| 66 | dagql.Arg("keepGitDir"). |
| 67 | View(BeforeVersion("v0.13.4")). |
| 68 | Doc(`Set to true to keep .git directory.`).Deprecated(), |
| 69 | dagql.Arg("sshKnownHosts").Doc(`Set SSH known hosts`), |
| 70 | dagql.Arg("sshAuthSocket").Doc(`Set SSH auth socket`), |
| 71 | dagql.Arg("httpAuthUsername").Doc(`Username used to populate the password during basic HTTP Authorization`), |
| 72 | dagql.Arg("httpAuthToken").Doc(`Secret used to populate the password during basic HTTP Authorization`), |
| 73 | dagql.Arg("httpAuthHeader").Doc(`Secret used to populate the Authorization HTTP header`), |
| 74 | dagql.Arg("experimentalServiceHost").Doc(`A service which must be started before the repo is fetched.`), |
| 75 | ), |
| 76 | }.Install(srv) |
| 77 | |
| 78 | dagql.Fields[*core.GitRepository]{ |
| 79 | dagql.NodeFunc("head", s.head). |
| 80 | Doc(`Returns details for HEAD.`), |
| 81 | dagql.NodeFunc("ref", s.ref). |
| 82 | Doc(`Returns details of a ref.`). |
| 83 | Args( |
| 84 | dagql.Arg("name").Doc(`Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).`), |
| 85 | ), |
| 86 | dagql.NodeFunc("branch", s.branch). |
| 87 | View(AllVersion). |
| 88 | Doc(`Returns details of a branch.`). |
| 89 | Args( |
| 90 | dagql.Arg("name").Doc(`Branch's name (e.g., "main").`), |
| 91 | ), |
| 92 | dagql.NodeFunc("tag", s.tag). |
| 93 | View(AllVersion). |
| 94 | Doc(`Returns details of a tag.`). |
| 95 | Args( |
| 96 | dagql.Arg("name").Doc(`Tag's name (e.g., "v0.3.9").`), |
| 97 | ), |
| 98 | dagql.NodeFunc("commit", s.commit). |
| 99 | View(AllVersion). |
| 100 | Doc(`Returns details of a commit.`). |
| 101 | Args( |
| 102 | // TODO: id is normally a reserved word; we should probably rename this |
| 103 | dagql.Arg("id").Doc(`Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").`), |
| 104 | ), |
| 105 | dagql.NodeFunc("latestVersion", s.latestVersion). |
| 106 | Doc(`Returns details for the latest semver tag.`), |
| 107 | |
| 108 | dagql.Func("tags", s.tags). |
nothing calls this directly
no test coverage detected