Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 state

Back to all declarations

errForeignNamespace

*errors.errorString

errForeignNamespace is the one rule this realm adds on top of the library: a namespace is yours or it is not.

Open
OID
0cd56c…3002:4
errForeignNamespace details

Inspect pointer

repo

func(id string) *v1.Repo

repo resolves a repo id or aborts. Read paths use f.Repo directly and return a rendered "not found" instead.

Open
OID
0cd56c…3002:16
repo details

Inspect func

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.

Open
OID
0cd56c…3002:17
requireNamespace details

Inspect func

splitList

func(s string) []string

splitList parses the comma-separated lists the transaction API has to use: gnokey can only pass strings, so a \[]string parameter would not be callable.

Open
OID
0cd56c…3002:19
splitList details

Inspect func

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.

Open
OID
0cd56c…3002:20
CreateRepo details

Inspect func

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.

Open
OID
0cd56c…3002:21
Fork details

Inspect func

SetDescription

func(repoID string, description string)

SetDescription updates the repo description (admin).

Open
OID
0cd56c…3002:22
SetDescription details

Inspect func

SetMirrors

func(repoID string, mirrors string)

SetMirrors replaces the fetch locators, comma-separated, first one canonical (maintainer). The chain records them; it never fetches.

Open
OID
0cd56c…3002:23
SetMirrors details

Inspect func

SetDefaultRef

func(repoID string, name string)

SetDefaultRef points the repo at another default branch (maintainer).

Open
OID
0cd56c…3002:24
SetDefaultRef details

Inspect func

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).

Open
OID
0cd56c…3002:25
SetPolicy details

Inspect func

SetMember

func(repoID string, member .uverse.address, role string)

SetMember grants a role: none, reader, writer, maintainer, admin, owner.

Open
OID
0cd56c…3002:26
SetMember details

Inspect func

SetArchived

func(repoID string, archived bool)

SetArchived freezes or unfreezes a repo (admin). The log stays readable.

Open
OID
0cd56c…3002:27
SetArchived details

Inspect func

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.

Open
OID
0cd56c…3002:28
SetRef details

Inspect func

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.

Open
OID
0cd56c…3002:29
ForceSetRef details

Inspect func

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.

Open
OID
0cd56c…3002:30
DeleteRef details

Inspect func

emitRef

func(repoID string, e *v1.LogEntry)
Open
OID
0cd56c…3002:31
emitRef details

Inspect func

OpenIssue

func(repoID string, title string, body string, labels string) int64

OpenIssue files an issue. Permissionless: the author pays for their bytes. labels is comma-separated. Returns the issue id.

Open
OID
0cd56c…3002:32
OpenIssue details

Inspect func

CommentIssue

func(repoID string, issueID int64, body string)

CommentIssue appends a reply.

Open
OID
0cd56c…3002:33
CommentIssue details

Inspect func

CloseIssue

func(repoID string, issueID int64)

CloseIssue closes an issue (author or maintainer).

Open
OID
0cd56c…3002:34
CloseIssue details

Inspect func

ReopenIssue

func(repoID string, issueID int64)

ReopenIssue reopens an issue (author or maintainer).

Open
OID
0cd56c…3002:35
ReopenIssue details

Inspect func

SetIssueLabels

func(repoID string, issueID int64, labels string)

SetIssueLabels replaces an issue's labels, comma-separated (maintainer).

Open
OID
0cd56c…3002:36
SetIssueLabels details

Inspect func

OpenChange

func(repoID string, title string, body string, sourceRepo string, sourceRef string, headOID string, targetRef string) int64

OpenChange 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.

Open
OID
0cd56c…3002:37
OpenChange details

Inspect func

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.

Open
OID
0cd56c…3002:38
UpdateChangeHead details

Inspect func

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.

Open
OID
0cd56c…3002:39
ReviewChange details

Inspect func

CommentChange

func(repoID string, changeID int64, body string)

CommentChange appends a reply to a change request.

Open
OID
0cd56c…3002:40
CommentChange details

Inspect func

CloseChange

func(repoID string, changeID int64)

CloseChange withdraws or rejects a change (author or maintainer).

Open
OID
0cd56c…3002:41
CloseChange details

Inspect func

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.

Open
OID
0cd56c…3002:42
MergeChange details

Inspect func

PublishPackage

func(repoID string, path string, ref string, oid string, tag string)

PublishPackage records that a repo publishes a deployed package path. The claim is not verified and cannot be: a realm cannot ask the chain who deployed a path. What is guaranteed is that someone with write access to the repo said it, under a namespace r/sys/users governs. A reader weighs it the way they weigh a go.mod. ref, oid and tag may each be empty when unstated.

Open
OID
0cd56c…3002:43
PublishPackage details

Inspect func

UnpublishPackage

func(repoID string, path string)

UnpublishPackage withdraws the claim. The package stays on chain; only the repo's assertion about it goes away.

Open
OID
0cd56c…3002:44
UnpublishPackage details

Inspect func

CutRelease

func(repoID string, tag string, name string, notes string, oid string, ref string, prerelease bool)

CutRelease names a point in a repo's history. A tag cannot be re-cut: see YankRelease for withdrawing one.

Open
OID
0cd56c…3002:45
CutRelease details

Inspect func

YankRelease

func(repoID string, tag string, reason string)

YankRelease marks a release withdrawn. It stays visible: a version that vanished reads as "never published" rather than "do not use this".

Open
OID
0cd56c…3002:46
YankRelease details

Inspect func

PackageRepo

func(pkgPath string) string

PackageRepo is the lookup an explorer makes: given a deployed package path, which repo claims to publish it. Empty when nobody does.

Open
OID
0cd56c…3002:47
PackageRepo details

Inspect func

PackageCount

func() int

PackageCount is how many package paths the whole forge claims.

Open
OID
0cd56c…3002:48
PackageCount details

Inspect func

LatestReleaseTag

func(repoID string) string

LatestReleaseTag is the most recently cut release of a repo that is neither a prerelease nor yanked, or "". Most recently CUT, never highest version: tags here are not required to be semver, so there is no order to sort by that would not be wrong for somebody.

Open
OID
0cd56c…3002:49
LatestReleaseTag details

Inspect func

ReleaseCount

func(repoID string) int

ReleaseCount is how many releases a repo has cut, yanked ones included.

Open
OID
0cd56c…3002:50
ReleaseCount details

Inspect func

RefOID

func(repoID string, name string) string

RefOID returns the object a ref points at, or "" if there is no such ref.

Open
OID
0cd56c…3002:51
RefOID details

Inspect func

LogHead

func(repoID string) string

LogHead returns the repo's chain digest: pin it off chain and the whole history of every ref becomes falsifiable.

Open
OID
0cd56c…3002:52
LogHead details

Inspect func

HasRepo

func(repoID string) bool

HasRepo reports whether a repo id is registered.

Open
OID
0cd56c…3002:53
HasRepo details

Inspect func

RepoCount

func() int

RepoCount is the number of repos on this forge.

Open
OID
0cd56c…3002:54
RepoCount details

Inspect func

pageSize

untyped bigint

pageSize bounds every listing: a Render that walks unbounded state is a Render that eventually stops rendering.

Value

(20 <untyped> bigint)

Render

func(path string) string

Render 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

Open
OID
0cd56c…3002:55
Render details

Inspect func

renderRepo

func(r *v1.Repo) string
Open
OID
0cd56c…3002:58
renderRepo details

Inspect func

renderLog

func(r *v1.Repo, page int) string
Open
OID
0cd56c…3002:59
renderLog details

Inspect func

renderIssues

func(r *v1.Repo, page int) string
Open
OID
0cd56c…3002:60
renderIssues details

Inspect func

renderIssue

func(r *v1.Repo, raw string) string
Open
OID
0cd56c…3002:61
renderIssue details

Inspect func

renderChanges

func(r *v1.Repo, page int) string
Open
OID
0cd56c…3002:62
renderChanges details

Inspect func

renderChange

func(r *v1.Repo, raw string) string
Open
OID
0cd56c…3002:63
renderChange details

Inspect func

logList

func(r *v1.Repo, offset int, count int) string
Open
OID
0cd56c…3002:65
logList details

Inspect func

issueList

func(r *v1.Repo, offset int, count int, openOnly bool) string
Open
OID
0cd56c…3002:66
issueList details

Inspect func

changeList

func(r *v1.Repo, offset int, count int, openOnly bool) string
Open
OID
0cd56c…3002:67
changeList details

Inspect func

pager

func(total int, page int, path string) string
Open
OID
0cd56c…3002:68
pager details

Inspect func

issueURL

func(id string, n int64) string
Open
OID
0cd56c…3002:71
issueURL details

Inspect func

changeURL

func(id string, n int64) string
Open
OID
0cd56c…3002:72
changeURL details

Inspect func

notFound

func(why string) string
Open
OID
0cd56c…3002:75
notFound details

Inspect func

state

func(ok bool, yes string, no string) string
Open
OID
0cd56c…3002:76
state details

Inspect func

refOID

func(r *v1.Repo, name string) string
Open
OID
0cd56c…3002:78
refOID details

Inspect func

oidCode

func(oid string) string

oidCode 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.

Open
OID
0cd56c…3002:79
oidCode details

Inspect func

shortDigest

func(d string) string
Open
OID
0cd56c…3002:80
shortDigest details

Inspect func

mirrorRest

func(mirrors []string) string
Open
OID
0cd56c…3002:81
mirrorRest details

Inspect func

refSuffix

func(ref string) string
Open
OID
0cd56c…3002:82
refSuffix details

Inspect func

codeList

func(items []string) string
Open
OID
0cd56c…3002:83
codeList details

Inspect func

btoa

func(b bool) string

btoa renders a bool for an event value: chain.Emit takes strings only.

Open
OID
0cd56c…3002:86
btoa details

Inspect func
errForeignNamespace : *errors.errorString Inspect
f : *v1.Forge Inspect
caller : func() .uverse.address Inspect
height : func() int64 Inspect
repo : func(id string) *v1.Repo Inspect
requireNamespace : func(a .uverse.address, id string) Inspect
must : func(err .uverse.error) Inspect
splitList : func(s string) []string Inspect
CreateRepo : func(id string, description string, defaultRef string) Inspect
Fork : func(srcID string, newID string) Inspect
SetDescription : func(repoID string, description string) Inspect
SetMirrors : func(repoID string, mirrors string) Inspect
SetDefaultRef : func(repoID string, name string) Inspect
SetPolicy : func(repoID string, requiredApprovals int, allowSelfApproval bool) Inspect
SetMember : func(repoID string, member .uverse.address, role string) Inspect
SetArchived : func(repoID string, archived bool) Inspect
SetRef : func(repoID string, name string, expectedOID string, newOID string, note string) Inspect
ForceSetRef : func(repoID string, name string, newOID string, note string) Inspect
DeleteRef : func(repoID string, name string, expectedOID string, note string) Inspect
emitRef : func(repoID string, e *v1.LogEntry) Inspect
OpenIssue : func(repoID string, title string, body string, labels string) int64 Inspect
CommentIssue : func(repoID string, issueID int64, body string) Inspect
CloseIssue : func(repoID string, issueID int64) Inspect
ReopenIssue : func(repoID string, issueID int64) Inspect
SetIssueLabels : func(repoID string, issueID int64, labels string) Inspect
OpenChange : func(repoID string, title string, body string, sourceRepo string, sourceRef string, headOID string, targetRef string) int64 Inspect
UpdateChangeHead : func(repoID string, changeID int64, headOID string) Inspect
ReviewChange : func(repoID string, changeID int64, verdict string, body string) Inspect
CommentChange : func(repoID string, changeID int64, body string) Inspect
CloseChange : func(repoID string, changeID int64) Inspect
MergeChange : func(repoID string, changeID int64, expectedTargetOID string, mergedOID string, note string) Inspect
PublishPackage : func(repoID string, path string, ref string, oid string, tag string) Inspect
UnpublishPackage : func(repoID string, path string) Inspect
CutRelease : func(repoID string, tag string, name string, notes string, oid string, ref string, prerelease bool) Inspect
YankRelease : func(repoID string, tag string, reason string) Inspect
PackageRepo : func(pkgPath string) string Inspect
PackageCount : func() int Inspect
LatestReleaseTag : func(repoID string) string Inspect
ReleaseCount : func(repoID string) int Inspect
RefOID : func(repoID string, name string) string Inspect
LogHead : func(repoID string) string Inspect
HasRepo : func(repoID string) bool Inspect
RepoCount : func() int Inspect
pageSize : untyped bigint =(20 <untyped> bigint)
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderRepo : func(r *v1.Repo) string Inspect
renderLog : func(r *v1.Repo, page int) string Inspect
renderIssues : func(r *v1.Repo, page int) string Inspect
renderIssue : func(r *v1.Repo, raw string) string Inspect
renderChanges : func(r *v1.Repo, page int) string Inspect
renderChange : func(r *v1.Repo, raw string) string Inspect
renderHelp : func() string Inspect
logList : func(r *v1.Repo, offset int, count int) string Inspect
issueList : func(r *v1.Repo, offset int, count int, openOnly bool) string Inspect
changeList : func(r *v1.Repo, offset int, count int, openOnly bool) string Inspect
pager : func(total int, page int, path string) string Inspect
base : func() string Inspect
repoURL : func(id string) string Inspect
issueURL : func(id string, n int64) string Inspect
changeURL : func(id string, n int64) string Inspect
notFound : func(why string) string Inspect
state : func(ok bool, yes string, no string) string Inspect
onOff : func(b bool) string Inspect
refOID : func(r *v1.Repo, name string) string Inspect
oidCode : func(oid string) string Inspect
shortDigest : func(d string) string Inspect
mirrorRest : func(mirrors []string) string Inspect
refSuffix : func(ref string) string Inspect
codeList : func(items []string) string Inspect
pageOf : func(req *v0.Request) int Inspect
itoa : func(n int64) string Inspect
btoa : func(b bool) string Inspect