errForeignNamespace
*errors.errorStringerrForeignNamespace is the one rule this realm adds on top of the library: a namespace is yours or it is not.
- OID
- 0cf8c3…d559:4
errForeignNamespace details
f
*v0.Forge- OID
- 0cf8c3…d559:7
f details
caller
func() .uverse.address- OID
- 0cf8c3…d559:11
caller details
height
func() int64- OID
- 0cf8c3…d559:13
height details
repo
func(id string) *v0.Reporepo resolves a repo id or aborts. Read paths use f.Repo directly and return a rendered "not found" instead.
- OID
- 0cf8c3…d559:14
repo details
requireNamespace
func(a .uverse.address, id string)requireNamespace enforces the ownership rule. Two namespaces exist and they cannot collide, since an address is 40 characters and a name caps at 39: - an address namespace ("g1.../forge") belongs to that account, always, with nothing to register and nothing to lose; - a name namespace ("moul/forge") belongs to whoever holds that name in r/sys/users, including through a rename, since the lookup resolves aliases to the same record. A realm caller passes the same way a user does, which is what makes a DAO-owned repo possible: the DAO's address is its namespace.
- OID
- 0cf8c3…d559:15
requireNamespace details
must
func(err .uverse.error)- OID
- 0cf8c3…d559:16
must details
splitList
func(s string) []stringsplitList parses the comma-separated lists the transaction API has to use: gnokey can only pass strings, so a \[]string parameter would not be callable.
- OID
- 0cf8c3…d559:17
splitList details
CreateRepo
func(id string, description string, defaultRef string)CreateRepo registers "\<namespace>/\<name>" with the caller as owner. defaultRef may be empty for refs/heads/main. The namespace must be one the caller owns: an r/sys/users name registered to their address, or their own bech32 address. Nobody squats anybody.
- OID
- 0cf8c3…d559:18
CreateRepo details
Fork
func(srcID string, newID string)Fork registers newID as a fork of srcID, snapshotting the parent's current refs into the fork's log so the lineage records exactly what was forked.
- OID
- 0cf8c3…d559:19
Fork details
SetDescription
func(repoID string, description string)SetDescription updates the repo description (admin).
- OID
- 0cf8c3…d559:20
SetDescription details
SetMirrors
func(repoID string, mirrors string)SetMirrors replaces the fetch locators, comma-separated, first one canonical (maintainer). The chain records them; it never fetches.
- OID
- 0cf8c3…d559:21
SetMirrors details
SetDefaultRef
func(repoID string, name string)SetDefaultRef points the repo at another default branch (maintainer).
- OID
- 0cf8c3…d559:22
SetDefaultRef details
SetPolicy
func(repoID string, requiredApprovals int, allowSelfApproval bool)SetPolicy sets how many writer approvals a change needs, and whether the author's own approval counts (admin).
- OID
- 0cf8c3…d559:23
SetPolicy details
SetMember
func(repoID string, member .uverse.address, role string)SetMember grants a role: none, reader, writer, maintainer, admin, owner.
- OID
- 0cf8c3…d559:24
SetMember details
SetArchived
func(repoID string, archived bool)SetArchived freezes or unfreezes a repo (admin). The log stays readable.
- OID
- 0cf8c3…d559:25
SetArchived details
SetRef
func(repoID string, name string, expectedOID string, newOID string, note string)SetRef moves a ref by compare-and-swap (writer). expectedOID is the tip the caller last saw, empty to create. A stale expectation aborts instead of overwriting: git's --force-with-lease, with consensus holding the lease.
- OID
- 0cf8c3…d559:26
SetRef details
ForceSetRef
func(repoID string, name string, newOID string, note string)ForceSetRef moves a ref with no expectation (maintainer). It is not forbidden, it is recorded as a force, in a log nobody can rewrite.
- OID
- 0cf8c3…d559:27
ForceSetRef details
DeleteRef
func(repoID string, name string, expectedOID string, note string)DeleteRef removes a ref by compare-and-swap (maintainer). The default branch is not deletable.
- OID
- 0cf8c3…d559:28
DeleteRef details
emitRef
func(repoID string, e *v0.LogEntry)- OID
- 0cf8c3…d559:29
emitRef details
OpenIssue
func(repoID string, title string, body string, labels string) int64OpenIssue files an issue. Permissionless: the author pays for their bytes. labels is comma-separated. Returns the issue id.
- OID
- 0cf8c3…d559:30
OpenIssue details
CommentIssue
func(repoID string, issueID int64, body string)CommentIssue appends a reply.
- OID
- 0cf8c3…d559:31
CommentIssue details
CloseIssue
func(repoID string, issueID int64)CloseIssue closes an issue (author or maintainer).
- OID
- 0cf8c3…d559:32
CloseIssue details
ReopenIssue
func(repoID string, issueID int64)ReopenIssue reopens an issue (author or maintainer).
- OID
- 0cf8c3…d559:33
ReopenIssue details
SetIssueLabels
func(repoID string, issueID int64, labels string)SetIssueLabels replaces an issue's labels, comma-separated (maintainer).
- OID
- 0cf8c3…d559:34
SetIssueLabels details
OpenChange
func(repoID string, title string, body string, sourceRepo string, sourceRef string, headOID string, targetRef string) int64OpenChange proposes moving targetRef to include headOID. sourceRepo may be another forge repo id, a mirror locator, or empty for this repo. Returns the change id.
- OID
- 0cf8c3…d559:35
OpenChange details
UpdateChangeHead
func(repoID string, changeID int64, headOID string)UpdateChangeHead repoints an open change at a new object (author or writer). Every approval of the previous head stops counting, by construction.
- OID
- 0cf8c3…d559:36
UpdateChangeHead details
ReviewChange
func(repoID string, changeID int64, verdict string, body string)ReviewChange records a verdict: approve, request-changes, comment: against the change's current head. Anyone may review; a writer's approval counts.
- OID
- 0cf8c3…d559:37
ReviewChange details
CommentChange
func(repoID string, changeID int64, body string)CommentChange appends a reply to a change request.
- OID
- 0cf8c3…d559:38
CommentChange details
CloseChange
func(repoID string, changeID int64)CloseChange withdraws or rejects a change (author or maintainer).
- OID
- 0cf8c3…d559:39
CloseChange details
MergeChange
func(repoID string, changeID int64, expectedTargetOID string, mergedOID string, note string)MergeChange moves the target ref to mergedOID and records the move as a merge entry naming the change (maintainer). expectedTargetOID is a compare-and-swap on the target: a change approved against a base that has moved is refused, not silently rebased.
- OID
- 0cf8c3…d559:40
MergeChange details
RefOID
func(repoID string, name string) stringRefOID returns the object a ref points at, or "" if there is no such ref.
- OID
- 0cf8c3…d559:41
RefOID details
LogHead
func(repoID string) stringLogHead returns the repo's chain digest: pin it off chain and the whole history of every ref becomes falsifiable.
- OID
- 0cf8c3…d559:42
LogHead details
HasRepo
func(repoID string) boolHasRepo reports whether a repo id is registered.
- OID
- 0cf8c3…d559:43
HasRepo details
RepoCount
func() intRepoCount is the number of repos on this forge.
- OID
- 0cf8c3…d559:44
RepoCount details
pageSize
untyped bigintpageSize bounds every listing: a Render that walks unbounded state is a Render that eventually stops rendering.
Value
(20 <untyped> bigint)
Render
func(path string) stringRender routes gnoweb paths: / the forge: every repo /<ns>/<name> repo overview /<ns>/<name>/log the full reference log (?page=N) /<ns>/<name>/issues issues (?page=N) /<ns>/<name>/issues/<id> one issue and its replies /<ns>/<name>/changes change requests (?page=N) /<ns>/<name>/changes/<id> one change, its reviews and its replies /help what this realm is and how to call it
- OID
- 0cf8c3…d559:45
Render details
renderHome
func() string- OID
- 0cf8c3…d559:47
renderHome details
renderRepo
func(r *v0.Repo) string- OID
- 0cf8c3…d559:48
renderRepo details
renderLog
func(r *v0.Repo, page int) string- OID
- 0cf8c3…d559:49
renderLog details
renderIssues
func(r *v0.Repo, page int) string- OID
- 0cf8c3…d559:50
renderIssues details
renderIssue
func(r *v0.Repo, raw string) string- OID
- 0cf8c3…d559:51
renderIssue details
renderChanges
func(r *v0.Repo, page int) string- OID
- 0cf8c3…d559:52
renderChanges details
renderChange
func(r *v0.Repo, raw string) string- OID
- 0cf8c3…d559:53
renderChange details
renderHelp
func() string- OID
- 0cf8c3…d559:54
renderHelp details
logList
func(r *v0.Repo, offset int, count int) string- OID
- 0cf8c3…d559:55
logList details
issueList
func(r *v0.Repo, offset int, count int, openOnly bool) string- OID
- 0cf8c3…d559:56
issueList details
changeList
func(r *v0.Repo, offset int, count int, openOnly bool) string- OID
- 0cf8c3…d559:57
changeList details
pager
func(total int, page int, path string) string- OID
- 0cf8c3…d559:58
pager details
base
func() string- OID
- 0cf8c3…d559:59
base details
repoURL
func(id string) string- OID
- 0cf8c3…d559:60
repoURL details
issueURL
func(id string, n int64) string- OID
- 0cf8c3…d559:61
issueURL details
changeURL
func(id string, n int64) string- OID
- 0cf8c3…d559:62
changeURL details
link
func(text string, url string) stringlink builds a markdown link. Internal targets are realm paths this file built, so only the text needs escaping.
- OID
- 0cf8c3…d559:63
link details
userLink
func(a .uverse.address) string- OID
- 0cf8c3…d559:64
userLink details
notFound
func(why string) string- OID
- 0cf8c3…d559:65
notFound details
state
func(ok bool, yes string, no string) string- OID
- 0cf8c3…d559:66
state details
onOff
func(b bool) string- OID
- 0cf8c3…d559:67
onOff details
refOID
func(r *v0.Repo, name string) string- OID
- 0cf8c3…d559:68
refOID details
oidCode
func(oid string) stringoidCode shows the short object id, code-spanned. An empty id renders as "(none)": that is a ref being created or deleted, not a zero object.
- OID
- 0cf8c3…d559:69
oidCode details
shortDigest
func(d string) string- OID
- 0cf8c3…d559:70
shortDigest details
mirrorRest
func(mirrors []string) string- OID
- 0cf8c3…d559:71
mirrorRest details
refSuffix
func(ref string) string- OID
- 0cf8c3…d559:72
refSuffix details
codeList
func(items []string) string- OID
- 0cf8c3…d559:73
codeList details
pageOf
func(req *v0.Request) int- OID
- 0cf8c3…d559:74
pageOf details
itoa
func(n int64) string- OID
- 0cf8c3…d559:75